#!/bin/bash if [ -d "$CLEAN_HOME" ]; then rm -rf "$CLEAN_HOME.bak" mv "$CLEAN_HOME" "$CLEAN_HOME.bak" else rm -rf "$CLEAN_HOME" fi mkdir -p "$CLEAN_HOME" for pkg in base lib-argenv lib-directory lib-dynamics lib-gast lib-graphcopy lib-itasks lib-platform lib-sapl lib-tcpip test do curl ftp://ftp.cs.ru.nl/pub/Clean/builds/linux-x64/clean-$pkg-linux-x64-latest.tgz\ | tar xz --strip-components=1 -C "$CLEAN_HOME" done grep -h '^[[:space:]]' "$CLEAN_HOME"/etc/*.env >> "$CLEAN_HOME/etc/IDEEnvs" cat ~/.clean/iTasksDev.env >> "$CLEAN_HOME/etc/IDEEnvs" sed -i 's=lib/exe/linker=lib/exe/linker::-no-pie=' "$CLEAN_HOME/etc/IDEEnvs" ln -s lib/exe "$CLEAN_HOME/exe" # cloogletags cloogletags -a -c -d "$CLEAN_HOME/lib" -o "$CLEAN_HOME/lib/tags" link_local_file(){ echo "$1 -> $2" mkdir -p "$(dirname "$CLEAN_HOME/$1")" if [ -f "$CLEAN_HOME/$1" ]; then mv "$CLEAN_HOME/$1" "$CLEAN_HOME/$1.org" ln -s "$(realpath --no-symlinks "$2")" "$CLEAN_HOME/$1.new" ln -s "$(basename "$1").new" "$CLEAN_HOME/$1" else ln -s "$(realpath --no-symlinks "$2")" "$CLEAN_HOME/$1" fi } # Local versions of binaries link_local_file bin/clm ~/VersionControl/clean-tools-git/clm/clm link_local_file bin/cpm ~/VersionControl/clean-ide/cpm/cpm link_local_file lib/exe/cocl /home/camil/VersionControl/clean-compiler/cocl link_local_file bin/cleantest ~/VersionControl/clean-test/cleantest link_local_file bin/testproperties ~/VersionControl/clean-test-properties/src/testproperties link_local_file data/cleandoc-default ~/VersionControl/clean-doc/data/cleandoc-default link_local_file bin/cleandoc ~/VersionControl/clean-doc/src/cleandoc link_local_file bin/cleanprof2callgrind ~/VersionControl/cleanprof2callgrind/cleanprof2callgrind # ABC interpreter binaries link_local_file lib/exe/abcopt ~/VersionControl/abc-interpreter/src/abcopt link_local_file lib/exe/bcgen ~/VersionControl/abc-interpreter/src/bcgen link_local_file lib/exe/bclink ~/VersionControl/abc-interpreter/src/bclink link_local_file lib/exe/bcstrip ~/VersionControl/abc-interpreter/src/bcstrip tail +3 ~/VersionControl/abc-interpreter/etc/ByteCode.env >> "$CLEAN_HOME/etc/IDEEnvs" # completion for f in ~/VersionControl/clean-completion/*; do [ -f "$f" ] || continue base="$(basename "$f")" if [[ "$base" == "Makefile" ]] || [[ "$base" == "README.md" ]] || [[ "$base" =~ .tar.gz$ ]]; then continue fi link_local_file "etc/completion/$base" "$f" done