lib/Tools/ocaml_setup
author wenzelm
Thu, 21 Mar 2019 13:34:37 +0100
changeset 69936 772bdd1ed843
parent 69928 3ed262d72468
child 69938 564985d6867e
permissions -rwxr-xr-x
more robust "switch create"; disable sandboxing to avoid dependency on bubblewrap (unavailable on Ubuntu 16.04);
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
69135
be20f5f6feb9 support for OCaml via command-line tools;
wenzelm
parents:
diff changeset
     1
#!/usr/bin/env bash
be20f5f6feb9 support for OCaml via command-line tools;
wenzelm
parents:
diff changeset
     2
#
be20f5f6feb9 support for OCaml via command-line tools;
wenzelm
parents:
diff changeset
     3
# Author: Makarius
be20f5f6feb9 support for OCaml via command-line tools;
wenzelm
parents:
diff changeset
     4
#
69500
db001bc11855 tuned messages;
wenzelm
parents: 69149
diff changeset
     5
# DESCRIPTION: setup OCaml via OPAM
69135
be20f5f6feb9 support for OCaml via command-line tools;
wenzelm
parents:
diff changeset
     6
69911
036037573080 include zarith in the default opam setup
haftmann
parents: 69500
diff changeset
     7
set -e
036037573080 include zarith in the default opam setup
haftmann
parents: 69500
diff changeset
     8
69924
512ac874bb9d more robust: allow empty root (e.g. via symlink);
wenzelm
parents: 69911
diff changeset
     9
if [ -e "$ISABELLE_OPAM_ROOT/config" ]
69139
4f3d93f0ba94 allow to switch ISABELLE_OCAML_VERSION later on;
wenzelm
parents: 69135
diff changeset
    10
then
69936
772bdd1ed843 more robust "switch create";
wenzelm
parents: 69928
diff changeset
    11
  isabelle_opam switch create "ocaml-base-compiler.$ISABELLE_OCAML_VERSION"
69139
4f3d93f0ba94 allow to switch ISABELLE_OCAML_VERSION later on;
wenzelm
parents: 69135
diff changeset
    12
else
69936
772bdd1ed843 more robust "switch create";
wenzelm
parents: 69928
diff changeset
    13
  isabelle_opam init --disable-sandboxing --no-setup --compiler="ocaml-base-compiler.$ISABELLE_OCAML_VERSION"
69139
4f3d93f0ba94 allow to switch ISABELLE_OCAML_VERSION later on;
wenzelm
parents: 69135
diff changeset
    14
fi
69911
036037573080 include zarith in the default opam setup
haftmann
parents: 69500
diff changeset
    15
69928
3ed262d72468 avoid prompt;
wenzelm
parents: 69924
diff changeset
    16
isabelle_opam install zarith -y