haskell, update
[dotfiles.git] / clean / .local / bin / install_clean.sh
index 0bcd7f3..2abd923 100755 (executable)
@@ -3,99 +3,43 @@ 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"
-CLM="https://gitlab.science.ru.nl/mlubbers/clm/builds/artifacts/master/raw/clm?job=compile"
-CLM1="https://gitlab.science.ru.nl/mlubbers/clm/builds/artifacts/master/raw/clm.1?job=compile"
+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 "Replacing clm"
-curl -sSLo "$CLEAN_HOME/bin/clm" "$CLM"
 echo "Installing manpages"
 mkdir -p ~/.local/man/man1
-curl -sSLo ~/.local/man/man1/clm.1 "$CLM1"
+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 "Patching StdEnv for binumap"
-patch /opt/clean/lib/StdEnv/StdGeneric.dcl <<EOPATCH
---- StdGeneric.dcl     2018-12-17 02:43:55.000000000 +0100
-+++ StdGeneric.dcl     2018-12-17 11:06:09.196234236 +0100
-@@ -64,6 +64,16 @@
- derive bimap FIELD
- derive bimap (->)
-+generic binumap a b | binumap b a :: a -> b
-+derive binumap c
-+derive binumap PAIR
-+derive binumap EITHER
-+derive binumap OBJECT
-+derive binumap CONS
-+derive binumap RECORD
-+derive binumap FIELD
-+derive binumap (->)
-+
- // HACK: dictionaries for all generics.
- // It works since all generic classes have only one method and do not inherit 
- // from other classes
-EOPATCH
-
-patch /opt/clean/lib/StdEnv/StdGeneric.icl <<EOPATCH
---- StdGeneric.icl     2018-12-17 02:43:55.000000000 +0100
-+++ StdGeneric.icl     2018-12-17 11:06:09.196234236 +0100
-@@ -21,6 +21,23 @@
- bimap{|(->)|} _ ba fr _ f = comp3 fr f ba
-+binumap{|c|} x = x
-+
-+binumap{|PAIR|} fx _ fy _ (PAIR x y) = PAIR (fx x) (fy y)
-+
-+binumap{|EITHER|} fl _ fr _ (LEFT x)  = LEFT (fl x)
-+binumap{|EITHER|} fl _ fr _ (RIGHT x) = RIGHT (fr x)
-+
-+binumap{|CONS|} fx _ (CONS x) = CONS (fx x)
-+
-+binumap{|RECORD|} fx _ (RECORD x) = RECORD (fx x)
-+
-+binumap{|FIELD|} fx _ (FIELD x) = FIELD (fx x)
-+
-+binumap{|OBJECT|} fx _ (OBJECT x) = OBJECT (fx x)
-+
-+binumap{|(->)|} _ ba fr _ f = comp3 fr f ba
-+
- comp3 :: !(.a -> .b) u:(.c -> .a) !(.d -> .c) -> u:(.d -> .b)
- comp3 f g h
-       | is_id f
-EOPATCH
-
 echo "Adding the iTasks-git environment"
-patch /opt/clean/etc/IDEEnvs <<EOPATCH
---- IDEEnvs    2018-12-17 11:58:48.876039159 +0100
-+++ IDEEnvs    2018-12-17 12:00:52.384066455 +0100
-@@ -35,13 +35,44 @@
-                       Path:   {Application}/lib/StdEnv
-                       Path:   {Application}/lib/Dynamics
-                       Path:   {Application}/lib/TCPIP
-+                      Path:   {Application}/lib/Gast
-                       Path:   {Application}/lib/Platform
-                       Path:   {Application}/lib/Platform/Deprecated/Generics
-+                      Path:   {Application}/lib/Platform/Deprecated/ArgEnv
-+                      Path:   {Application}/lib/Platform/Deprecated/MersenneTwister
-                       Path:   {Application}/lib/Platform/Deprecated/StdLib
-                       Path:   {Application}/lib/Sapl
+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
--              EnvironmentCompiler:    lib/exe/cocl::-dynamics -sapl
-+              EnvironmentCompiler:    lib/exe/cocl:-h 500m -s 20m:-dynamics -sapl
++                      Path:   {Application}/lib/Gast
++              EnvironmentCompiler:    lib/exe/cocl-itasks::-dynamics
 +              EnvironmentCodeGen:     lib/exe/cg
-+              EnvironmentLinker:      lib/exe/linker|lib/exe/sapl-collector-linker|lib/exe/itasks-web-collector
-+              EnvironmentDynLink:     lib/exe/linker
++              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
@@ -107,7 +51,7 @@ patch /opt/clean/etc/IDEEnvs <<EOPATCH
 +                      Path:   {Application}/lib/StdEnv
 +                      Path:   {Application}/lib/Dynamics
 +                      Path:   {Application}/lib/TCPIP
-+                      Path:   {Application}/lib/Sapl
++                      Path:   {Application}/lib/ABCInterpreter
 +                      Path:   {Application}/lib/GraphCopy
 +                      Path:   {Application}/lib/Gast
 +                      Path:   /home/mrl/projects/clean/clean-platform/src/libraries/Platform-x86
@@ -120,8 +64,7 @@ patch /opt/clean/etc/IDEEnvs <<EOPATCH
 +                      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:-h 500m -s 20m:-dynamics -sapl
+               EnvironmentCompiler:    lib/exe/cocl-itasks::-dynamics
                EnvironmentCodeGen:     lib/exe/cg
-               EnvironmentLinker:      lib/exe/linker|lib/exe/sapl-collector-linker|lib/exe/itasks-web-collector
-               EnvironmentDynLink:     lib/exe/linker
+               EnvironmentLinker:      /usr/bin/gcc::-Wl,--gc-sections|lib/exe/itasks-web-collector
 EOPATCH