summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO10
-rw-r--r--PKGBUILD48
-rw-r--r--clean-lang.sh5
-rw-r--r--clenv.sh56
-rw-r--r--clm-wrapper.sh20
5 files changed, 113 insertions, 26 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 0bf3b6bd1800..54866d57dd58 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,18 +1,20 @@
pkgbase = clean-lang-bin
pkgdesc = Provides the general purpose, pure and lazy functional programming language Clean.
pkgver = 3.0
- pkgrel = 4
+ pkgrel = 5
url = https://clean.cs.ru.nl
arch = x86_64
license = custom
- depends = glibc
+ depends = bash
provides = clean-lang
conflicts = clean-lang
replaces = clean-lang
source = https://ftp.cs.ru.nl/Clean/Clean30/linux/clean3.0_64.tar.gz
- source = clean-lang.sh
+ source = clm-wrapper.sh
+ source = clenv.sh
sha256sums = c71024cc6d27df357fed771a75f5d43e584369c3ee963bfd6d5cffe9af731ca8
- sha256sums = 872a1bbe40b2b846e7aef38cee182df731bd2fca60bfb639d44fbb8ed21649d3
+ sha256sums = 70d90c34c0c9716b59cb843a7a617c986f56810a70342be3d4c2389436317c82
+ sha256sums = c190821ac6c72d159c9713fba3140b886d5d1716021bf8e28b676418774d0915
pkgname = clean-lang-bin
diff --git a/PKGBUILD b/PKGBUILD
index ac6e14bec9b5..8be7d5b59791 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,30 +2,51 @@
pkgname=clean-lang-bin
pkgver=3.0
-pkgrel=4
+pkgrel=5
pkgdesc="Provides the general purpose, pure and lazy functional programming language Clean."
arch=('x86_64')
url="https://clean.cs.ru.nl"
license=('custom')
-depends=('glibc')
+depends=('bash')
conflicts=('clean-lang')
provides=('clean-lang')
replaces=('clean-lang')
source=("https://ftp.cs.ru.nl/Clean/Clean30/linux/clean${pkgver}_64.tar.gz"
- 'clean-lang.sh')
+ 'clm-wrapper.sh'
+ 'clenv.sh')
sha256sums=('c71024cc6d27df357fed771a75f5d43e584369c3ee963bfd6d5cffe9af731ca8'
- '872a1bbe40b2b846e7aef38cee182df731bd2fca60bfb639d44fbb8ed21649d3')
+ '70d90c34c0c9716b59cb843a7a617c986f56810a70342be3d4c2389436317c82'
+ 'c190821ac6c72d159c9713fba3140b886d5d1716021bf8e28b676418774d0915')
package() {
cd "${pkgname/-lang-bin/}"
+ local _install_dir="${pkgdir}/usr"
+ local _install_bin_dir="${_install_dir}/libexec/${pkgname}"
+ local _install_man_dir="${_install_dir}/share/man"
+ local _install_exe_dir="${_install_dir}/libexec/${pkgname}/exe"
+
# install the main files (does a bit of compiling as well...)
- make INSTALL_DIR="$pkgdir/usr" INSTALL_MAN_DIR="$pkgdir/usr/share/man" install
+ make INSTALL_DIR="$_install_dir" INSTALL_BIN_DIR="$_install_bin_dir" \
+ INSTALL_EXE_DIR="$_install_exe_dir" INSTALL_MAN_DIR="$_install_man_dir" install
# resolve permissions on binaries
- chmod go+r "$pkgdir/usr/bin/BatchBuild" "$pkgdir/usr/bin/clm" \
- "$pkgdir/usr/bin/htoclean" "$pkgdir/usr/lib/exe/cg" \
- "$pkgdir/usr/lib/exe/cocl" "$pkgdir/usr/lib/exe/linker"
+ chmod go+r "${_install_bin_dir}/BatchBuild" "${_install_bin_dir}/clm" \
+ "${_install_bin_dir}/htoclean" "${_install_exe_dir}/cg" \
+ "${_install_exe_dir}/cocl" "${_install_exe_dir}/linker"
+
+ # add missing binaries
+ install -Dm755 "bin/cpm" "${_install_bin_dir}/cpm"
+ install -Dm755 "bin/patch_bin" "${_install_bin_dir}/patch_bin"
+
+ # add wrapper(s) and symlinks
+ install -d "$pkgdir/usr/bin"
+ install -Dm755 "$srcdir/clm-wrapper.sh" "$pkgdir/usr/bin/clm"
+ install -Dm755 "$srcdir/clenv.sh" "$pkgdir/usr/bin/clenv"
+ ln -s "/usr/libexec/${pkgname}/htoclean" "$pkgdir/usr/bin/htoclean"
+ ln -s "/usr/libexec/${pkgname}/BatchBuild" "$pkgdir/usr/bin/BatchBuild"
+ ln -s "/usr/libexec/${pkgname}/cpm" "$pkgdir/usr/bin/cpm"
+ ln -s "/usr/libexec/${pkgname}/patch_bin" "$pkgdir/usr/bin/patch_bin"
# remove empty dir
rmdir "$pkgdir/usr/Temp"
@@ -34,14 +55,7 @@ package() {
rmdir "$pkgdir/usr/lib/Dynamics/Clean System Files"
rmdir "$pkgdir/usr/lib/StdLib/Clean System Files"
- # add missing binaries
- install -Dm755 "bin/cpm" "$pkgdir/usr/bin/cpm"
- install -Dm755 "bin/patch_bin" "$pkgdir/usr/bin/patch_bin"
- install -Dm755 "bin/BatchBuild" "$pkgdir/usr/bin/BatchBuild"
-
- # add profile
- install -Dm755 "$srcdir/clean-lang.sh" "$pkgdir/etc/profile.d/clean-lang.sh"
-
# install license
- install -Dm644 CleanLicenseConditions.txt "$pkgdir/usr/share/licenses/${pkgname}/CleanLicenseConditions.txt"
+ install -Dm644 CleanLicenseConditions.txt \
+ "$pkgdir/usr/share/licenses/${pkgname}/CleanLicenseConditions.txt"
}
diff --git a/clean-lang.sh b/clean-lang.sh
deleted file mode 100644
index a933cf42a824..000000000000
--- a/clean-lang.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# These env variables are need to make Clean's compiler and
-# build system to work correctly.
-
-export CLEANLIB=/usr/lib/exe
-export CLEANPATH=/usr/lib/StdEnv
diff --git a/clenv.sh b/clenv.sh
new file mode 100644
index 000000000000..080a2b81928f
--- /dev/null
+++ b/clenv.sh
@@ -0,0 +1,56 @@
+#!/usr/bin/env bash
+
+# this script creates a copy of the current system-level
+# StdEnv files of the Clean distribution and places them
+# in the users home directory (under .local)
+
+_install_dir="$HOME/.local/lib"
+
+usage () {
+ echo "USAGE: clenv [cmd]" >&2
+ echo ""
+ echo "Commands: status, init, deinit"
+}
+
+if [ $# -lt 1 ]; then
+ usage
+ exit 0
+fi
+
+case $1 in
+ status)
+ if [ ! -d "$_install_dir/StdEnv" ]; then
+ echo "not initilised"
+ else
+ echo "initilised"
+ fi
+ ;;
+ init)
+ if [ -d "$_install_dir/StdEnv" ]; then
+ echo -n "already initilised, overwrite? [Y/n]: "
+ read -r yn
+ if [ "$yn" != "${yn#[Yy]}" ] ;then
+ rm -rf "$_install_dir/StdEnv"
+ cp -r /usr/lib/StdEnv "$_install_dir"
+ echo "done"
+ fi
+ else
+ [ -d "$_install_dir" ] || mkdir -p "$_install_dir"
+ cp -r /usr/lib/StdEnv "$_install_dir"
+ echo "done"
+ fi
+ ;;
+ deinit)
+ if [ ! -d "$_install_dir/StdEnv" ]; then
+ echo "not initilised, nothing to do :("
+ else
+ rm -rf "$_install_dir/StdEnv"
+ echo "done"
+ fi
+ ;;
+ *)
+ echo "unknown command..."
+ usage
+ exit 1
+ ;;
+esac
diff --git a/clm-wrapper.sh b/clm-wrapper.sh
new file mode 100644
index 000000000000..ff77d4826f5e
--- /dev/null
+++ b/clm-wrapper.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+
+# default paths
+CLEANPATH=/usr/lib/StdEnv
+CLEANLIB=/usr/libexec/clean-lang-bin/exe
+
+if [ -d "$HOME/.local/lib/StdEnv" ]; then
+ CLEANPATH="$HOME/.local/lib/StdEnv"
+elif [ -d "$PWD/StdEnv" ]; then
+ echo "Notice: using CWD install of StdEnv"
+ CLEANPATH="$PWD/StdEnv"
+else
+ echo "Warning: you are calling clm using the system install of StdEnv," >&2
+ echo " this cause compilation to fail. Use the clenv tool create" >&2
+ echo " a user specific checkout of StdEnv." >&2
+fi
+
+export CLEANPATH
+export CLEANLIB
+exec /usr/libexec/clean-lang-bin/clm "$@"