···
1
-
# generated during the install step
2
-
source .travis-ocaml.env
4
-
# Ensure build logs are printed live
5
-
export OPAMVERBOSE=yes
7
-
# display info about OS distribution and version
8
-
case $TRAVIS_OS_NAME in
10
-
freebsd) uname -a ;;
11
-
*) cat /etc/*-release
18
-
echo OCAML_VERSION=$OCAML_VERSION
19
-
echo OPAM_SWITCH=$OPAM_SWITCH
21
-
echo pull req: $TRAVIS_PULL_REQUEST
22
-
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
23
-
curl -L https://github.com/$TRAVIS_REPO_SLUG/pull/$TRAVIS_PULL_REQUEST.diff -o pullreq.diff
25
-
git show > pullreq.diff.tmp
26
-
merge=`grep "^Merge: " pullreq.diff.tmp | awk -F: '{print $2}'`
27
-
if [ "$merge" = "" ]; then
29
-
mv pullreq.diff.tmp pullreq.diff
31
-
echo Merge detected, extracting $merge diff
32
-
git show $merge > pullreq.diff
38
-
case $TRAVIS_OS_NAME in
39
-
osx) export OPAMFETCH=wget ;;
42
-
cd $TRAVIS_BUILD_DIR
45
-
# CR: this will be replaced with the OCamlot analysis of affected packages
46
-
cat pullreq.diff | sed -E -n -e 's,\+\+\+ b/packages/[^/]*/([^/]*)/.*,\1,p' | sort -u > tobuild.txt
50
-
function build_one {
52
-
echo "build one: $pkg"
53
-
# test for installability
54
-
echo "Checking for availability..."
55
-
if ! opam depext --with-test -ls $pkg; then
56
-
echo "Package unavailable."
57
-
if opam show $pkg; then
58
-
echo "Package is unavailable on this configuration, skipping:"
59
-
opam install $pkg --dry-run || true
61
-
echo "ERROR: Package not found."
62
-
echo "Maybe its definition failed to parse, check above."
66
-
echo "... package available."
67
-
depext=$(opam depext --with-test -ls $pkg)
68
-
opam depext --with-test $pkg
70
-
echo "====== Installing dependencies ======"
71
-
opam install --deps-only $pkg
73
-
echo "====== Installing package ======"
74
-
opam install -t $pkg
75
-
opam remove -a ${pkg%%.*}
76
-
if [ "$depext" != "" ]; then
77
-
case $TRAVIS_OS_NAME in
79
-
sudo apt-get remove $depext
80
-
sudo apt-get autoremove
86
-
pkg remove -ay $depext
99
-
echo "====== External dependency handling ======"
100
-
opam install 'opam-depext>=1.1.3'
102
-
for i in `cat tobuild.txt`; do
103
-
name=$(echo $i | cut -f1 -d".")
105
-
ocaml|ocaml-base-compiler) ;;