From 1420cabac5cdb1a7cb1d0999f48f1a7a6af80457 Mon Sep 17 00:00:00 2001 From: Andrzej Kotulski Date: Mon, 4 Jul 2016 03:39:44 -0700 Subject: [PATCH] Install opam deps in build-infer script Summary: build-infer.sh script will create separate switch infer-4.02.3 and install all infer's deps there (including reason) With this change users won't have to run opam install commands directly Reviewed By: jvillard Differential Revision: D3508897 fbshipit-source-id: 9f8e741 --- build-infer.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/build-infer.sh b/build-infer.sh index c46a6d8b4..d8b924bd2 100755 --- a/build-infer.sh +++ b/build-infer.sh @@ -106,8 +106,25 @@ check_installed opam opam init --no-setup --yes > /dev/null || \ opam init --no-setup --yes --comp=4.02.3 +OCAML_VERSION="4.02.3" +OPAM_SWITCH=infer-$OCAML_VERSION + +if ! opam switch $OPAM_SWITCH >/dev/null 2>/dev/null; then + opam switch install $OPAM_SWITCH --alias-of $OCAML_VERSION +fi + eval $(SHELL=bash opam config env) +echo "installing infer dependencies... " +opam update + +opam pin add --yes merlin 'https://github.com/the-lambda-church/merlin.git#reason-0.0.1' +opam pin add --yes merlin_extend 'https://github.com/let-def/merlin-extend.git#reason-0.0.1' +opam pin add --yes --no-action reason 'https://github.com/facebook/reason.git#0.0.6' + +opam pin add --yes --no-action infer . +opam install --yes --deps-only infer + echo "preparing build... " if [ ! -f .release ]; then ./autogen.sh > /dev/null