2abd923d74beacc36d0e0336752e396b3bb3ad9c
[dotfiles.git] / clean / .local / bin / install_clean.sh
1 #!/bin/bash
2 set -e
3
4 DISTRO="https://ftp.cs.ru.nl/Clean/builds/linux-x64/clean-bundle-complete-linux-x64-latest.tgz"
5 TAGS="https://gitlab.science.ru.nl/cloogle/cloogle-tags/-/jobs/artifacts/master/raw/cloogletags?job=build"
6 CLMMAN="https://gitlab.science.ru.nl/clean-and-itasks/clm/raw/master/clm.1"
7 CP2CG="https://gitlab.science.ru.nl/clean-and-itasks/cleanprof2callgrind/-/jobs/artifacts/master/raw/cleanprof2callgrind?job=test"
8 CLEAN_HOME="${CLEAN_HOME:-/opt/clean}"
9
10 echo "Cleaning up the old distro"
11 rm -rf "$CLEAN_HOME"/*
12 echo "Downloading clean"
13 curl -sSL "$DISTRO" | tar -C "$CLEAN_HOME" --strip-components=1 -xz
14 echo "Installing manpages"
15 mkdir -p ~/.local/man/man1
16 curl -sSLo ~/.local/man/man1/clm.1 "$CLMMAN"
17 echo "Downloading cleanprof2callgrind"
18 curl -sSLo "$CLEAN_HOME/bin/cleanprof2callgrind" "$CP2CG"
19 chmod +x "$CLEAN_HOME"/bin/cleanprof2callgrind
20 echo "Downloading cloogletags"
21 curl -sSLo "$CLEAN_HOME"/bin/cloogletags "$TAGS"
22 chmod +x "$CLEAN_HOME"/bin/cloogletags
23 echo "Generating tags"
24 cloogletags -a -c -d "$CLEAN_HOME"/lib -o "$CLEAN_HOME"/lib/tags 2>/dev/null
25
26 echo "Adding the iTasks-git environment"
27 patch /opt/clean/etc/IDEEnvs <<EOPATCH
28 --- IDEEnvs.orig 2019-11-19 08:13:53.243123284 +0100
29 +++ IDEEnvs 2019-11-19 08:15:02.819053965 +0100
30 @@ -61,6 +61,39 @@
31 Path: {Application}/lib/ABCInterpreter
32 Path: {Application}/lib/GraphCopy
33 Path: {Application}/lib/iTasks
34 + Path: {Application}/lib/Gast
35 + EnvironmentCompiler: lib/exe/cocl-itasks::-dynamics
36 + EnvironmentCodeGen: lib/exe/cg
37 + EnvironmentLinker: /usr/bin/gcc::-Wl,--gc-sections|lib/exe/itasks-web-collector
38 + EnvironmentABCOptimise: lib/exe/abcopt
39 + EnvironmentByteCodeGen: lib/exe/bcgen
40 + EnvironmentByteCodeLink: lib/exe/bclink
41 + EnvironmentByteCodeStrip: lib/exe/bcstrip
42 + EnvironmentByteCodePrelink: lib/exe/bcprelink
43 + EnvironmentVersion: 920
44 + EnvironmentRedirect: False
45 + EnvironmentCompileMethod: Pers
46 + EnvironmentProcessor: I386
47 + Environment64BitProcessor: True
48 + Environment
49 + EnvironmentName: iTasks-git
50 + EnvironmentPaths
51 + Path: {Application}/lib/StdEnv
52 + Path: {Application}/lib/Dynamics
53 + Path: {Application}/lib/TCPIP
54 + Path: {Application}/lib/ABCInterpreter
55 + Path: {Application}/lib/GraphCopy
56 + Path: {Application}/lib/Gast
57 + Path: /home/mrl/projects/clean/clean-platform/src/libraries/Platform-x86
58 + Path: /home/mrl/projects/clean/clean-platform/src/libraries/OS-Posix
59 + Path: /home/mrl/projects/clean/clean-platform/src/libraries/OS-Linux
60 + Path: /home/mrl/projects/clean/clean-platform/src/libraries/OS-Linux-64
61 + Path: /home/mrl/projects/clean/clean-platform/src/libraries/OS-Independent
62 + Path: /home/mrl/projects/clean/clean-platform/src/libraries/OS-Independent/Deprecated/Generics
63 + Path: /home/mrl/projects/clean/clean-platform/src/libraries/OS-Independent/Deprecated/StdLib
64 + Path: /home/mrl/projects/clean/clean-platform/src/libraries/OS-Independent/Deprecated/ArgEnv
65 + Path: /home/mrl/projects/clean/clean-platform/src/libraries/OS-Independent/Deprecated/MersenneTwister
66 + Path: /home/mrl/projects/clean/iTasks-SDK/Libraries
67 EnvironmentCompiler: lib/exe/cocl-itasks::-dynamics
68 EnvironmentCodeGen: lib/exe/cg
69 EnvironmentLinker: /usr/bin/gcc::-Wl,--gc-sections|lib/exe/itasks-web-collector
70 EOPATCH