Make: add make build-dev-deps

This commit is contained in:
Grégoire Henry 2019-02-19 17:08:02 +01:00
parent fbd97da7b4
commit 14656a288b
No known key found for this signature in database
GPG Key ID: 50D984F20BD445D2
4 changed files with 33 additions and 9 deletions

View File

@ -81,6 +81,9 @@ fix-indent:
build-deps: build-deps:
@./scripts/install_build_deps.sh @./scripts/install_build_deps.sh
build-dev-deps:
@./scripts/install_build_deps.sh --dev
docker-image: docker-image:
@./scripts/create_docker_image.sh @./scripts/create_docker_image.sh

View File

@ -152,6 +152,14 @@ Install the OCaml compiler and the libraries which Tezos depends on:
make build-deps make build-deps
Alternatively, if you want to be able to install extra packages
(development packages such as `merlin`), you may use the following
command instead:
::
make build-dev-deps
This command creates a local opam switch ``_opam`` where the right This command creates a local opam switch ``_opam`` where the right
version of OCaml is compiled and installed (this takes a while but version of OCaml is compiled and installed (this takes a while but
it's only done once). it's only done once).
@ -174,11 +182,3 @@ Lastly you can also add Tezos binaries to your ``PATH`` variable,
activate bash autocompletion and after reading the Disclaimer a few activate bash autocompletion and after reading the Disclaimer a few
hundred times you are allowed to disable it with hundred times you are allowed to disable it with
``TEZOS_CLIENT_UNSAFE_DISABLE_DISCLAIMER=Y``. ``TEZOS_CLIENT_UNSAFE_DISABLE_DISCLAIMER=Y``.
To add the default opam repository at a lower priority (for example to
install merlin or test other opam packages), you can use the following
command:
::
opam repo add default --rank=-1

View File

@ -7,4 +7,10 @@ src_dir="$(dirname "$script_dir")"
opams=$(find "$src_dir/vendors" "$src_dir/src" -name \*.opam -print) opams=$(find "$src_dir/vendors" "$src_dir/src" -name \*.opam -print)
opam install $opams --deps-only --with-test -y --criteria="-notuptodate,-changed,-removed" export OPAMYES=${OPAMYES:=true}
## In an ideal world, `--with-test` should be present only when using
## `--dev`. But this would probably break the CI, so we postponed this
## change until someone have some spare time. (@pirbo, @hnrgrgr)
opam install $opams --deps-only --with-test --criteria="-notuptodate,-changed,-removed"

View File

@ -5,6 +5,12 @@ src_dir="$(dirname "$script_dir")"
. "$script_dir"/version.sh . "$script_dir"/version.sh
if [ "$1" = "--dev" ]; then
dev=yes
else
dev=
fi
opam repository set-url tezos --dont-select $opam_repository || \ opam repository set-url tezos --dont-select $opam_repository || \
opam repository add tezos --dont-select $opam_repository > /dev/null 2>&1 opam repository add tezos --dont-select $opam_repository > /dev/null 2>&1
@ -21,6 +27,10 @@ fi
eval $(opam env --shell=sh) eval $(opam env --shell=sh)
if [ -n "$dev" ]; then
opam repository remove default > /dev/null 2>&1 || true
fi
if [ "$(ocaml -vnum)" != "$ocaml_version" ]; then if [ "$(ocaml -vnum)" != "$ocaml_version" ]; then
opam install --unlock-base ocaml-base-compiler.$ocaml_version opam install --unlock-base ocaml-base-compiler.$ocaml_version
fi fi
@ -28,3 +38,8 @@ fi
opam list --installed opam-depext || opam --yes install opam-depext opam list --installed opam-depext || opam --yes install opam-depext
"$script_dir"/install_build_deps.raw.sh "$script_dir"/install_build_deps.raw.sh
if [ -n "$dev" ]; then
opam repository add default --rank=-1 > /dev/null 2>&1 || true
opam install merlin
fi