haskell, update
[dotfiles.git] / clean / .local / bin / install_clean.sh
index acf04f0..2abd923 100755 (executable)
@@ -1,4 +1,70 @@
-#!/bin/sh
-mv /opt/clean /opt/clean.bak
-curl ftp://ftp.cs.ru.nl/pub/Clean/builds/linux-x64/clean-bundle-complete-linux-x64-latest.tgz | tar -xz
-mv clean-bundle-complete /opt/clean
+#!/bin/bash
+set -e
+
+DISTRO="https://ftp.cs.ru.nl/Clean/builds/linux-x64/clean-bundle-complete-linux-x64-latest.tgz"
+TAGS="https://gitlab.science.ru.nl/cloogle/cloogle-tags/-/jobs/artifacts/master/raw/cloogletags?job=build"
+CLMMAN="https://gitlab.science.ru.nl/clean-and-itasks/clm/raw/master/clm.1"
+CP2CG="https://gitlab.science.ru.nl/clean-and-itasks/cleanprof2callgrind/-/jobs/artifacts/master/raw/cleanprof2callgrind?job=test"
+CLEAN_HOME="${CLEAN_HOME:-/opt/clean}"
+
+echo "Cleaning up the old distro"
+rm -rf "$CLEAN_HOME"/*
+echo "Downloading clean"
+curl -sSL "$DISTRO" | tar -C "$CLEAN_HOME" --strip-components=1 -xz
+echo "Installing manpages"
+mkdir -p ~/.local/man/man1
+curl -sSLo ~/.local/man/man1/clm.1 "$CLMMAN"
+echo "Downloading cleanprof2callgrind"
+curl -sSLo "$CLEAN_HOME/bin/cleanprof2callgrind" "$CP2CG"
+chmod +x "$CLEAN_HOME"/bin/cleanprof2callgrind
+echo "Downloading cloogletags"
+curl -sSLo "$CLEAN_HOME"/bin/cloogletags "$TAGS"
+chmod +x "$CLEAN_HOME"/bin/cloogletags
+echo "Generating tags"
+cloogletags -a -c -d "$CLEAN_HOME"/lib -o "$CLEAN_HOME"/lib/tags 2>/dev/null
+
+echo "Adding the iTasks-git environment"
+patch  /opt/clean/etc/IDEEnvs <<EOPATCH
+--- IDEEnvs.orig       2019-11-19 08:13:53.243123284 +0100
++++ IDEEnvs    2019-11-19 08:15:02.819053965 +0100
+@@ -61,6 +61,39 @@
+                       Path:   {Application}/lib/ABCInterpreter
+                       Path:   {Application}/lib/GraphCopy
+                       Path:   {Application}/lib/iTasks
++                      Path:   {Application}/lib/Gast
++              EnvironmentCompiler:    lib/exe/cocl-itasks::-dynamics
++              EnvironmentCodeGen:     lib/exe/cg
++              EnvironmentLinker:      /usr/bin/gcc::-Wl,--gc-sections|lib/exe/itasks-web-collector
++              EnvironmentABCOptimise: lib/exe/abcopt
++              EnvironmentByteCodeGen: lib/exe/bcgen
++              EnvironmentByteCodeLink:        lib/exe/bclink
++              EnvironmentByteCodeStrip:       lib/exe/bcstrip
++              EnvironmentByteCodePrelink:     lib/exe/bcprelink
++              EnvironmentVersion:     920
++              EnvironmentRedirect:    False
++              EnvironmentCompileMethod:       Pers
++              EnvironmentProcessor:   I386
++              Environment64BitProcessor:      True
++      Environment
++              EnvironmentName:        iTasks-git
++              EnvironmentPaths
++                      Path:   {Application}/lib/StdEnv
++                      Path:   {Application}/lib/Dynamics
++                      Path:   {Application}/lib/TCPIP
++                      Path:   {Application}/lib/ABCInterpreter
++                      Path:   {Application}/lib/GraphCopy
++                      Path:   {Application}/lib/Gast
++                      Path:   /home/mrl/projects/clean/clean-platform/src/libraries/Platform-x86
++                      Path:   /home/mrl/projects/clean/clean-platform/src/libraries/OS-Posix
++                      Path:   /home/mrl/projects/clean/clean-platform/src/libraries/OS-Linux
++                      Path:   /home/mrl/projects/clean/clean-platform/src/libraries/OS-Linux-64
++                      Path:   /home/mrl/projects/clean/clean-platform/src/libraries/OS-Independent
++                      Path:   /home/mrl/projects/clean/clean-platform/src/libraries/OS-Independent/Deprecated/Generics
++                      Path:   /home/mrl/projects/clean/clean-platform/src/libraries/OS-Independent/Deprecated/StdLib
++                      Path:   /home/mrl/projects/clean/clean-platform/src/libraries/OS-Independent/Deprecated/ArgEnv
++                      Path:   /home/mrl/projects/clean/clean-platform/src/libraries/OS-Independent/Deprecated/MersenneTwister
++                      Path:   /home/mrl/projects/clean/iTasks-SDK/Libraries
+               EnvironmentCompiler:    lib/exe/cocl-itasks::-dynamics
+               EnvironmentCodeGen:     lib/exe/cg
+               EnvironmentLinker:      /usr/bin/gcc::-Wl,--gc-sections|lib/exe/itasks-web-collector
+EOPATCH