forked from ponylang/ponyc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis_install.bash
87 lines (67 loc) · 1.85 KB
/
.travis_install.bash
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
#! /bin/bash
set +o errexit
set +o nounset
set +o
if [[ "$TRAVIS_BRANCH" == "release" && "$FAVORITE_CONFIG" != "yes" ]]
then
echo "This is a release branch and there's nothing this matrix element must do."
exit 0
fi
download-llvm(){
echo "Downloading and installing the LLVM specified by envvars..."
wget "http://llvm.org/releases/${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-debian8.tar.xz"
tar -xvf clang+llvm*
pushd clang+llvm* && sudo mkdir /tmp/llvm && sudo cp -r ./* /tmp/llvm/
sudo ln -s "/tmp/llvm/bin/llvm-config" "/usr/local/bin/${LLVM_CONFIG}"
popd
}
download-pcre(){
echo "Downloading and building PCRE2..."
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-10.21.tar.bz2
tar -xjvf pcre2-10.21.tar.bz2
pushd pcre2-10.21 && ./configure --prefix=/usr && make && sudo make install
popd
}
echo "Installing ponyc build dependencies..."
case "${TRAVIS_OS_NAME}:${LLVM_CONFIG}" in
"linux:llvm-config-3.7")
download-llvm
download-pcre
;;
"linux:llvm-config-3.8")
download-llvm
download-pcre
;;
"linux:llvm-config-3.9")
download-llvm
download-pcre
;;
"osx:llvm-config-3.7")
brew update
brew install pcre2
brew install libressl
brew install llvm37
;;
"osx:llvm-config-3.8")
brew update
brew install pcre2
brew install libressl
brew install llvm38
;;
"osx:llvm-config-3.9")
brew update
brew install pcre2
brew install libressl
brew install [email protected]
brew link --overwrite --force [email protected]
mkdir llvmsym
ln -s "$(which llvm-config)" llvmsym/llvm-config-3.9
ln -s "$(which clang++)" llvmsym/clang++-3.9
# do this elsewhere:
#export PATH=llvmsym/:$PATH
;;
*)
echo "ERROR: An unrecognized OS and LLVM tuple was found! Consider OS: ${TRAVIS_OS_NAME} and LLVM: ${LLVM_CONFIG}"
exit 1
;;
esac