diff --git a/install/scripts/install_ocaml.sh b/install/scripts/install_ocaml.sh index 022cc59a..b0092659 100755 --- a/install/scripts/install_ocaml.sh +++ b/install/scripts/install_ocaml.sh @@ -1,5 +1,23 @@ #!/bin/bash +cd .. +QP_ROOT=$PWD +cd - + +# Fast installation +if [[ "$1" == "--fast" && ! -d ${HOME}/.opam ]] +then + MEGA_DL="${QP_ROOT}/bin/mega-dl.sh" + wget 'https://gist.githubusercontent.com/scemama/b9debaed0b76321229a5/raw/d06ca00e6ad7f3703ff4738b210f6f913c1bd8d5/mega-dl.sh' -O ${MEGA_DL} + chmod +x ${MEGA_DL} + url='https://mega.co.nz/#!ykh32ajD!2aeqh87c53tL-Z4W1msQvem-TrmRN3ftlZ_QdhKo3c4' + ${MEGA_DL} $url /tmp/opam.tgz + cd $HOME + tar -zxf /tmp/opam.tgz + cd - +fi + +# Normal installation PACKAGES="core cryptokit ocamlfind sexplib" declare -i i @@ -10,9 +28,10 @@ then exit 1 fi -cd .. -QP_ROOT=$PWD -cd - +if [[ -d ${HOME}/.opam ]] +then + source ${HOME}/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true +fi cd Downloads || exit 1 chmod +x ocaml.sh || exit 1 diff --git a/setup_environment.py b/setup_environment.py index 972eefb4..2c682493 100755 --- a/setup_environment.py +++ b/setup_environment.py @@ -326,7 +326,7 @@ if "ocaml" in l_need_genealogy: l_cmd = ["cd install &&", "wget {0} -O {1} -o /dev/null &&".format(url, path_archive), - "./scripts/install_ocaml.sh"] + "./scripts/install_ocaml.sh --fast"] os.system(" ".join(l_cmd)) @@ -369,7 +369,7 @@ l_rc = [ 'export PATH="${PATH}":"${QP_PYTHON}":"${QP_ROOT}"/bin', 'export LD_LIBRARY_PATH="${QP_ROOT}"/lib:"${LD_LIBRARY_PATH}"', 'export LIBRARY_PATH="${QP_ROOT}"/lib:"${LIBRARY_PATH}"', "" - 'source . ${HOME}/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true', + 'source ${HOME}/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true', "" ]