-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.install.sh
43 lines (37 loc) · 1.18 KB
/
.travis.install.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
#!/bin/sh
set -e
fold_start () { printf 'travis_fold:start:%s\r\033[33;1m%s\033[0m\n' "$1" "$2"; }
fold_end () { printf 'travis_fold:end:%s\r' "$1"; }
## APT dependencies
fold_start apt_deps 'Install APT dependencies...'
sudo apt-get install ocaml
fold_end apt_deps
## Install OPAM
fold_start install_opam 'Install OPAM...'
mkdir -p ~/.local/bin
wget https://raw.github.com/ocaml/opam/master/shell/opam_installer.sh -O - \
| sh -s ~/.local/bin system
export PATH=~/.local/bin:$PATH
fold_end install_opam
## Prepare OPAM
fold_start prep_opam 'Prepare OPAM...'
if [ -z "$OCAML_VERSION" ]; then
printf 'No OCaml version provided in $OCAML_VERSION, using $DEFAULT_OCAML_VERSION (%s).\n' "$DEFAULT_OCAML_VERSION"
OCAML_VERSION=$DEFAULT_OCAML_VERSION
fi
opam switch "$OCAML_VERSION"
eval $(opam config env)
fold_end prep_opam
## OPAM dependencies
fold_start opam_deps 'Install OPAM dependencies...'
opam install -y menhir yojson ppx_deriving_yojson visitors # For Morbig
fold_end opam_deps
## Morbig
fold_start morbig 'Install Morbig...' #FIXME: as soon as there is an OPAM release, use it!
git clone https://github.com/colis-anr/morbig
cd morbig
make
make install
cd ..
rm -rf morbig
fold_end morbig