forked from ThePhD/sol2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.deps.sh
96 lines (73 loc) · 2.12 KB
/
install.deps.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env bash
# This script installs and configures the dependencies for the project
case `uname` in
Darwin) export OS_NAME="osx" ;;
Linux) export OS_NAME="linux" ;;
esac
echo "Building on: ${OS_NAME}"
if env | grep -qE '^(?:TRAVIS|CI)='; then
# We're on Travis, intialize variables:
echo "Detected CI Build -> CI=${CI}"
else
# We're building locally
export CI=false
echo "Detected Local Build -> CI=${CI}"
fi
export_compiler_vars() {
case ${COMPILER} in
appleclang*)
export CC=clang
export CXX=clang++
;;
clang*)
export CC=$(echo ${COMPILER} | sed 's/\+//g')
export CXX=${COMPILER}
;;
g++-*)
export CC=$(echo ${COMPILER} | sed 's/\+/c/g')
export CXX=${COMPILER}
;;
*) echo "Invalid compiler version" ; exit 2 ;;
esac
echo "CC=${CC}"
$CC --version
echo "CXX=${CXX}"
$CXX --version
}
install_os_deps() {
# Install all of the OS specific OS dependencies
echo "Install: os-based dependencies"
local wd=`pwd`
case ${OS_NAME} in
osx)
export HOMEBREW_NO_EMOJI=1
echo "brew update ..."; brew update > /dev/null
case ${COMPILER} in
appleclang*) ;;
g++-5)
brew install gcc5
brew link gcc5 --overwrite --force
;;
g++-4.9) ;;
*) echo "Invalid compiler version" ; exit 2 ;;
esac
brew install ninja
local lua_pkg
case ${LUA_VERSION} in
lua53) lua_pkg=lua53 ;;
lua52) lua_pkg=lua ;;
lua51) lua_pkg=lua51 ;;
luajit52) lua_pkg=luajit ;;
luajit) lua_pkg=luajit ;;
*) echo "Invalid Lua Version for OSX"
exit 2
;;
esac
brew install ${lua_pkg}
;;
linux)
# no extras currently
;;
esac
cd ${wd}
}