From 92fb69500cab8e40453058f898e6cb25221ff5e0 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 8 Jun 2015 17:23:59 +0200 Subject: [PATCH] Remove install ocaml from ninja --- .travis.yml | 2 +- install/scripts/install_ocaml.sh | 21 +++++++-------------- setup_environment.py | 25 +++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7b12513d..657c4f09 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ before_script: - sudo apt-get install graphviz script: - - travis_wait ./setup_environment.py + - ./setup_environment.py - source ./quantum_package.rc - qp_create_ninja.py --production ./config/gfortran_example.cfg - ninja diff --git a/install/scripts/install_ocaml.sh b/install/scripts/install_ocaml.sh index c2f1d663..efdf0962 100755 --- a/install/scripts/install_ocaml.sh +++ b/install/scripts/install_ocaml.sh @@ -17,24 +17,17 @@ cd - cd Downloads || exit 1 chmod +x ocaml.sh || exit 1 -if [[ -d ${HOME}/.opam ]] -then - source ${HOME}/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true -fi - echo N | ./ocaml.sh ${QP_ROOT}/bin/ || exit 1 -if [[ ! -f ${QP_ROOT}/bin/opam ]] -then - echo "Installation of OPAM failed" - exit 2 -fi -${QP_ROOT}/bin/opam config setup -a --dot-profile ${QP_ROOT}/quantum_package.rc || exit 1 + +${QP_ROOT}/bin/opam config setup -a|| exit 1 export LD_LIBRARY_PATH=${QP_ROOT}/lib:${LD_LIBRARY_PATH} export LIBRARY_PATH=${QP_ROOT}/lib:${LIBRARY_PATH} export C_INCLUDE_PATH=${QP_ROOT}/lib:${C_INCLUDE_PATH} +source ${HOME}/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true -source ${QP_ROOT}/quantum_package.rc -echo Y | ${QP_ROOT}/bin/opam install ${PACKAGES} || exit 1 +${QP_ROOT}/bin/opam install ${PACKAGES} -y -q || exit 1 rm -f ../_build/ocaml.log -exit 0 \ No newline at end of file +exit 0 + + diff --git a/setup_environment.py b/setup_environment.py index e995fccb..8dfdb1f3 100755 --- a/setup_environment.py +++ b/setup_environment.py @@ -201,6 +201,7 @@ for need in l_need: l_need_genealogy = d_need_genealogy.keys() +l_need_genealogy = ["ocaml"] print """ __ (_ ._ _ ._ _ _. ._ @@ -269,6 +270,9 @@ l_build = [] for need in l_need_genealogy: + if need == "ocaml": + continue + url = d_info[need].url extension = splitext(url)[1] @@ -306,6 +310,27 @@ print """ """ subprocess.check_call("./bin/ninja -C install", shell=True) +print "Done" + +if "ocaml" in l_need_genealogy: + + print """ +# ~#~#~#~#~#~#~#~#~#~#~#~#~ # +# I n s t a l l _ o c a m l # +# ~#~#~#~#~#~#~#~#~#~#~#~#~ # +""" + url = d_info["ocaml"].url + extension = splitext(url)[1] + path_archive = "Downloads/{0}{1}".format("ocaml", extension) + + l_cmd = ["cd install &&", + "wget {0} -O {1} -o /dev/null &&".format(url, path_archive), + "./scripts/install_ocaml.sh"] + + os.system(" ".join(l_cmd)) + + print "Done" + l_need_genealogy.remove("ocaml") print """