ligo/scripts/install_build_deps.sh
Grégoire Henry 5c428a5ea3 CI: avoids broken packages
Otherwise:

```
The actions to process have cyclic dependencies:
  - install bos.0.1.4 -> install base64.2.1.2 -> install js_of_ocaml.2.8.3 -> install mtime.0.8.3 -> install bos.0.1.4
  - install bos.0.1.4 -> install base64.2.1.2 -> install js_of_ocaml.2.8.3 -> install logs.0.6.2 -> install bos.0.1.4
```
2016-12-09 11:19:24 +01:00

69 lines
1.6 KiB
Bash
Executable File

#!/bin/sh
if ! [ -f 'src/tezos-deps.opam' ]; then
echo
echo " Please run from the project's root directory. Aborting."
echo
exit 1
fi
ocaml_version=4.03.0
if [ "$(ocaml -vnum)" != "$ocaml_version" ]; then
echo
echo " Unexpected compiler version ($(ocaml -vnum))"
echo " You should use ocaml-$ocaml_version."
echo
exit 1
fi
cmd="$1"
if [ -z "$cmd" ]; then cmd=all; fi
case "$cmd" in
pin)
pin=yes
;;
depext)
depext=yes
;;
install)
install=yes
;;
all)
pin=yes
depext=yes
install=yes
;;
*)
echo "Unknown command '$cmd'."
echo "Usage: $0 [pin|depext|install|all|]"
exit 1
esac
set -e
set -x
if ! [ -z "$pin" ]; then
opam pin --yes remove --no-action --dev-repo ocplib-resto || true
opam pin --yes add --no-action --dev-repo sodium
opam pin --yes add --no-action --dev-repo ocp-ocamlres
opam pin --yes add --no-action --dev-repo ocplib-json-typed
opam pin --yes add --no-action --dev-repo ocplib-resto
## Force opam to take account of the new `tezos-deps.opam`
opam pin --yes remove tezos-deps
opam pin --yes add --no-action tezos-deps src
fi
if ! [ -z "$depext" ]; then
## In our CI, this rule is executed as user 'root'
## The other rules are executed as user 'opam'.
opam list --installed depext || opam install depext
opam depext tezos-deps
fi
if ! [ -z "$install" ]; then
opam install tezos-deps
## This seems broken in the current opam-repo (2016-12-09)
## opam install --build-test tezos-deps
fi