forked from goblint/analyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtravis-ci.sh
executable file
·54 lines (46 loc) · 1.91 KB
/
travis-ci.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
# This script is for either running in a Travis CI worker or the VM setup by vagrant. See .travis.yml and Vagrantfile
# Inspired by https://github.com/lunaryorn/flycheck
# setup base system and clone goblint if not running in travis-ci
if test -e "make.sh"; then # travis-ci
echo "already in repository"
# USER=`whoami`
else # vagrant
apt () {
sudo apt-get install -yy --fix-missing "$@"
}
# update repositories to prevent errors caused by missing packages
sudo apt-get update -qq
apt python-software-properties # needed for ppa
apt make m4 # needed for compiling ocamlfind
apt patch # needed for compiling xml-light
apt autoconf # needed for compiling cil
apt git # needed for cloning goblint source
# USER=vagrant # provisioning is done as root, but ssh login is 'vagrant'
cd /root # just do everything as root and later use 'sudo su -' for ssh
if test ! -e "analyzer"; then # ignore if source already exists
git clone https://github.com/goblint/analyzer.git
# chown -hR $USER:$USER analyzer # make ssh user the owner
fi
pushd analyzer
fi
# install ocaml and friends, see http://anil.recoil.org/2013/09/30/travis-and-ocaml.html
OPAM_DEPENDS="ocamlfind camomile batteries xml-light cil"
# use default versions if none are set in environment
case "${OCAML_VERSION:=4.01.0},${OPAM_VERSION:=1.0.0}" in
3.12.1,1.0.0) ppa=avsm/ocaml312+opam10 ;;
3.12.1,1.1.0) ppa=avsm/ocaml312+opam11 ;;
4.00.1,1.0.0) ppa=avsm/ocaml40+opam10 ;;
4.00.1,1.1.0) ppa=avsm/ocaml40+opam11 ;;
4.01.0,1.0.0) ppa=avsm/ocaml41+opam10 ;;
4.01.0,1.1.0) ppa=avsm/ocaml41+opam11 ;;
*) echo Unknown $OCAML_VERSION,$OPAM_VERSION; exit 1 ;;
esac
echo "yes" | sudo add-apt-repository ppa:$ppa
sudo apt-get update -qq
sudo apt-get install -qq ocaml ocaml-native-compilers camlp4-extra opam
export OPAMYES=1
opam init
opam install ${OPAM_DEPENDS}
eval `opam config env`
# compile
./make.sh