forked from emsec/hal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_dependencies.sh
executable file
·71 lines (65 loc) · 2.89 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env bash
platform='unknown'
unamestr=$(uname)
distribution='unknown'
if [[ "$unamestr" == 'Linux' ]]; then
platform='linux'
distribution=$(lsb_release -is)
elif [[ "$unamestr" == 'Darwin' ]]; then
platform='macOS'
fi
if [[ "$platform" == 'macOS' ]]; then
echo "Executing brew bundle"
brew bundle
pip3 install -r requirements.txt
BREW_PREFIX=$(brew --prefix)
if [ -n "$($SHELL -c 'echo $ZSH_VERSION')" ]; then
grep -Fxq 'export PATH="$BREW_PREFIX/opt/qt@5/bin:$PATH"' ~/.zshrc
if ! [[ $? -eq 0 ]]; then
echo 'export PATH="$BREW_PREFIX/opt/qt@5/bin:$PATH"' >> ~/.zshrc
fi
grep -Fxq 'export PATH="$BREW_PREFIX/opt/flex/bin:$PATH"' ~/.zshrc
if ! [[ $? -eq 0 ]]; then
echo 'export PATH="$BREW_PREFIX/opt/flex/bin:$PATH"' >> ~/.zshrc
fi
grep -Fxq 'export PATH="$BREW_PREFIX/opt/bison/bin:$PATH"' ~/.zshrc
if ! [[ $? -eq 0 ]]; then
echo 'export PATH="$BREW_PREFIX/opt/bison/bin:$PATH"' >> ~/.zshrc
fi
source ~/.zshrc
elif [ -n "$($SHELL -c 'echo $BASH_VERSION')" ]; then
grep -Fxq 'export PATH="$BREW_PREFIX/opt/qt@5/bin:$PATH"' ~/.bash_profile
if ! [[ $? -eq 0 ]]; then
echo 'export PATH="$BREW_PREFIX/opt/qt@5/bin:$PATH"' >> ~/.bash_profile
fi
grep -Fxq 'export PATH="$BREW_PREFIX/opt/flex/bin:$PATH"' ~/.bash_profile
if ! [[ $? -eq 0 ]]; then
echo 'export PATH="$BREW_PREFIX/opt/flex/bin:$PATH"' >> ~/.bash_profile
fi
grep -Fxq 'export PATH="$BREW_PREFIX/opt/bison/bin:$PATH"' ~/.bash_profile
if ! [[ $? -eq 0 ]]; then
echo 'export PATH="$BREW_PREFIX/opt/bison/bin:$PATH"' >> ~/.bash_profile
fi
source ~/.bash_profile
else
echo "Unknown User Shell: abort!"
exit 255
fi
elif [[ "$platform" == 'linux' ]]; then
if [ "$distribution" == 'Ubuntu' ] || [ "$distribution" == 'LinuxMint' ]; then
sudo apt-get update && sudo apt-get install -y build-essential lsb-release git cmake pkgconf qt5-default libboost-all-dev \
libpython3-dev ccache autoconf autotools-dev libsodium-dev libigraph0-dev \
libqt5svg5-dev libqt5svg5* ninja-build lcov gcovr python3-sphinx doxygen python3-sphinx-rtd-theme python3-jedi python3-pip pybind11-dev python3-pybind11 rapidjson-dev libspdlog-dev libz3-dev\
graphviz libomp-dev libsuitesparse-dev # For documentation
sudo pip3 install -r requirements.txt
elif [[ "$distribution" == "Arch" ]]; then
yay -S --needed base-devel lsb-release git cmake boost-libs pkgconf \
qt5-base python ccache autoconf libsodium igraph qt5-svg ninja lcov \
gcovr python-sphinx doxygen python-sphinx_rtd_theme python-jedi \
python-pip pybind11 rapidjson spdlog graphviz boost \
python-dateutil z3
else
echo "Unsupported Linux distribution: abort!"
exit 255
fi
fi