aboutsummaryrefslogtreecommitdiff
path: root/clean/bin/install_clean
blob: 4c3d68018c5db387d31492af70afce62eecba3e3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/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