2016-11-23 13:54:22 +04:00
|
|
|
#! /bin/sh
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2017-04-12 14:55:01 +04:00
|
|
|
script_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")"
|
2017-01-22 04:59:18 +04:00
|
|
|
src_dir="$(dirname "$script_dir")"
|
|
|
|
|
2017-12-06 22:52:00 +04:00
|
|
|
. "$script_dir"/version.sh
|
2017-01-22 04:59:18 +04:00
|
|
|
|
2019-02-19 20:08:02 +04:00
|
|
|
if [ "$1" = "--dev" ]; then
|
|
|
|
dev=yes
|
|
|
|
else
|
|
|
|
dev=
|
|
|
|
fi
|
|
|
|
|
2018-05-25 11:56:14 +04:00
|
|
|
opam repository set-url tezos --dont-select $opam_repository || \
|
2018-07-05 01:08:20 +04:00
|
|
|
opam repository add tezos --dont-select $opam_repository > /dev/null 2>&1
|
2018-05-25 11:56:14 +04:00
|
|
|
|
2019-01-22 21:07:13 +04:00
|
|
|
opam update --repositories --development
|
|
|
|
|
2018-05-25 11:56:14 +04:00
|
|
|
if [ ! -d "$src_dir/_opam" ] ; then
|
|
|
|
opam switch create "$src_dir" --repositories=tezos ocaml-base-compiler.$ocaml_version
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d "$src_dir/_opam" ] ; then
|
|
|
|
echo "Failed to create the opam switch"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2018-07-08 10:12:32 +04:00
|
|
|
eval $(opam env --shell=sh)
|
2018-05-25 11:56:14 +04:00
|
|
|
|
2019-02-19 20:08:02 +04:00
|
|
|
if [ -n "$dev" ]; then
|
|
|
|
opam repository remove default > /dev/null 2>&1 || true
|
|
|
|
fi
|
|
|
|
|
2017-01-22 04:59:18 +04:00
|
|
|
if [ "$(ocaml -vnum)" != "$ocaml_version" ]; then
|
2018-05-25 11:56:14 +04:00
|
|
|
opam install --unlock-base ocaml-base-compiler.$ocaml_version
|
2016-09-08 21:13:10 +04:00
|
|
|
fi
|
|
|
|
|
2018-09-19 21:33:25 +04:00
|
|
|
opam list --installed opam-depext || opam --yes install opam-depext
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2018-06-27 14:58:06 +04:00
|
|
|
"$script_dir"/install_build_deps.raw.sh
|
2019-02-19 20:08:02 +04:00
|
|
|
|
|
|
|
if [ -n "$dev" ]; then
|
|
|
|
opam repository add default --rank=-1 > /dev/null 2>&1 || true
|
|
|
|
opam install merlin
|
|
|
|
fi
|