9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-07 05:53:37 +01:00

Simplified ocaml installation

This commit is contained in:
Anthony Scemama 2021-07-05 15:37:33 +02:00
parent a88d7257fc
commit 11f2bd400a
3 changed files with 4 additions and 50 deletions

52
configure vendored
View File

@ -82,7 +82,6 @@ function execute () {
} }
PACKAGES="" PACKAGES=""
OCAML_PACKAGES="ocamlbuild cryptokit zmq sexplib ppx_sexp_conv ppx_deriving getopt"
while true ; do while true ; do
case "$1" in case "$1" in
@ -299,55 +298,8 @@ EOF
elif [[ ${PACKAGE} = ocaml ]] ; then elif [[ ${PACKAGE} = ocaml ]] ; then
download ${OCAML_URL} "${QP_ROOT}"/external/opam_installer.sh cd "${QP_ROOT}"/external/
./ocaml-bundle.sh
if [[ -n ${TRAVIS} ]] ; then
# Special commands for Travis CI
chmod +x "${QP_ROOT}"/external/opam_installer.sh
rm --force ${QP_ROOT}/bin/opam
if [[ -n ${NO_CACHE} ]] ; then
rm -rf ${HOME}/.opam
fi
export OPAMROOT=${HOME}/.opam
cat << EOF | bash ${QP_ROOT}/external/opam_installer.sh --no-backup
${QP_ROOT}/bin
EOF
rm ${QP_ROOT}/external/opam_installer.sh
# source ${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true
#
# opam switch create ocaml-base-compiler.4.11.1
opam init --verbose --yes --compiler=4.11.1 --disable-sandboxing
eval $(opam env)
opam install -y ${OCAML_PACKAGES} || exit 1
else
# Conventional commands
execute << EOF
chmod +x "${QP_ROOT}"/external/opam_installer.sh
"${QP_ROOT}"/external/opam_installer.sh --no-backup
EOF
execute << EOF
rm --force ${QP_ROOT}/bin/opam
export OPAMROOT=${OPAMROOT:-${QP_ROOT}/external/opam}
echo ${QP_ROOT}/bin \
| sh ${QP_ROOT}/external/opam_installer.sh
EOF
rm ${QP_ROOT}/external/opam_installer.sh
# source ${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true
# opam switch create ocaml-base-compiler.4.11.1 || exit 1
opam init --verbose --yes --compiler=4.11.1 --disable-sandboxing
eval $(opam env)
execute << EOF
opam install -y \${OCAML_PACKAGES} || exit 1
EOF
fi
elif [[ ${PACKAGE} = bse ]] ; then elif [[ ${PACKAGE} = bse ]] ; then

View File

@ -5,6 +5,8 @@ then
# Comment these lines if you have a system-wide OCaml installation # Comment these lines if you have a system-wide OCaml installation
export OPAMROOT=${QP_ROOT}/external/opam export OPAMROOT=${QP_ROOT}/external/opam
export PATH="${QP_ROOT}/external/ocaml-bundle/bootstrap/bin:$PATH"
eval $(opam env --root "${QP_ROOT}/external/ocaml-bundle/opam" --set-root)
fi fi
source ${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true source ${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true

BIN
external/ocaml-bundle.sh vendored Executable file

Binary file not shown.