forked from vmware/differential-datalog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-dependencies.sh
executable file
·52 lines (40 loc) · 1.37 KB
/
install-dependencies.sh
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
#!/bin/bash
# Script that installs the dependencies needed to build and run Differential Datalog
echo "Installing dependencies for DDlog"
echo "This script should be invoked with '. ./install-dependencies.sh' to set up the environment properly"
case "$OSTYPE" in
linux*) sudo apt install -y libgoogle-perftools-dev ;;
darwin*) ;;
*) echo "Unhandled operating system $OSTYPE"; exit 1;;
esac
RUST_VERSION="1.52.1"
echo "Installing Haskell"
./tools/install-stack.sh
echo "Installing Rust"
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain ${RUST_VERSION} -y
export PATH=$HOME/.cargo/bin:$PATH
# If another version is installed the previous line does not do anything
rustup default ${RUST_VERSION}
rustup toolchain install ${RUST_VERSION}
rustup component add rustfmt
rustup component add clippy
pip3 install parglare==0.12.0
if [[ "${OSTYPE}" =~ "linux" ]]; then
sudo apt install -y default-jdk
fi
./tools/install-flatbuf.sh
cd flatbuffers
export CLASSPATH=`pwd`"/java":$CLASSPATH
export PATH=`pwd`:$PATH
cd ..
GITDIR=$(git rev-parse --git-dir)
# handle if invoked from worktrees
if [ $(git rev-parse --is-inside-work-tree) == "true" ];then
if [ ! -d ${GITDIR}/hooks ]; then
echo "Worktree = true"
echo "Creating hooks directory under ${GITDIR}"
mkdir ${GITDIR}/hooks
fi
fi
# Link to pre-commit script
ln -sf $(pwd)/tools/prepush.sh ${GITDIR}/hooks/pre-push