Commit bdc60fb9 authored by Stephane Glondu's avatar Stephane Glondu

opam-bootstrap.sh: switch to opam 2.0.0

parent dbc0ec43
Pipeline #54064 passed with stages
in 11 minutes and 55 seconds
......@@ -5,8 +5,8 @@ stages:
build_and_test_with_preinstalled_image:
stage: build_and_test_with_preinstalled_image
# Image glondu/beleniosbase:20181206-1 is built by Dockerfile_base_environment
image: glondu/beleniosbase:20181206-1
# Image glondu/beleniosbase:YYYYMMDD-N is built by Dockerfile_base_environment
image: glondu/beleniosbase:20181206-2
script:
# Initialize environment
- source ~/env.sh
......@@ -47,8 +47,8 @@ build_and_test_with_debian_image:
build_and_run_automated_test_scenario_1_with_preinstalled_image:
stage: build_and_run_automated_test_scenario_1_with_preinstalled_image
# Image glondu/beleniosbase-tests:20181206-1 is built by Dockerfile_test_scenario_environment
image: glondu/beleniosbase-tests:20181206-1
# Image glondu/beleniosbase-tests:YYYYMMDD-N is built by Dockerfile_test_scenario_environment
image: glondu/beleniosbase-tests:20181206-2
script:
# Initialize environment
- source ~/env.sh
......
wrap-build-commands: []
wrap-install-commands: []
wrap-remove-commands: []
required-tools: []
FROM debian:9
RUN apt-get update -qq && apt-get upgrade -qq && apt-get install -qq bubblewrap build-essential libgmp-dev libpcre3-dev pkg-config m4 libssl-dev libsqlite3-dev wget ca-certificates zip unzip aspcud libncurses-dev uuid-runtime zlib1g-dev libgd-securityimage-perl cracklib-runtime git
RUN useradd --create-home belenios
COPY .opamrc-nosandbox /home/belenios/.opamrc
COPY opam-bootstrap.sh /home/belenios
USER belenios
WORKDIR /home/belenios
......
# Docker image used as FROM has been generated from ./Dockerfile_base_environment
FROM glondu/beleniosbase:20181206-1
FROM glondu/beleniosbase:20181206-2
USER root
......
......@@ -13,6 +13,7 @@ OCaml projects.
The non-OCaml prerequisites are:
* a POSIX system with a C compiler
* on Linux, [Bubblewrap](https://github.com/projectatomic/bubblewrap)
* [GMP](http://gmplib.org/)
* [PCRE](http://www.pcre.org/)
* [pkg-config](http://www.freedesktop.org/wiki/Software/pkg-config/)
......@@ -32,7 +33,7 @@ These libraries and tools are pretty common, and might be directly part
of your operating system. On [Debian](http://www.debian.org/) and its
derivatives, they can be installed with the following command:
sudo apt install build-essential libgmp-dev libpcre3-dev pkg-config m4 libssl-dev libsqlite3-dev wget ca-certificates zip unzip aspcud libncurses-dev uuid-runtime zlib1g-dev libgd-securityimage-perl cracklib-runtime
sudo apt install bubblewrap build-essential libgmp-dev libpcre3-dev pkg-config m4 libssl-dev libsqlite3-dev wget ca-certificates zip unzip aspcud libncurses-dev uuid-runtime zlib1g-dev libgd-securityimage-perl cracklib-runtime
If you are unfamiliar with OCaml or OPAM, we provide an
`opam-bootstrap.sh` shell script that creates a whole, hopefully
......@@ -43,7 +44,7 @@ variable, or it will take `~/.belenios` by default. Just run:
./opam-bootstrap.sh
On a modern desktop system, this needs approximately 11 minutes and 2
On a modern desktop system, this needs approximately 20 minutes and 2.6
gigabytes of disk space.
If everything goes successfully, follow the given instructions to
......
......@@ -34,43 +34,26 @@ fi
mkdir -p "$BELENIOS_SYSROOT/bootstrap/src"
cd "$BELENIOS_SYSROOT/bootstrap/src"
wget http://caml.inria.fr/pub/distrib/ocaml-4.02/ocaml-4.02.3.tar.gz
wget https://github.com/ocaml/opam/releases/download/1.2.2/opam-full-1.2.2.tar.gz
wget https://github.com/ocaml/opam/releases/download/2.0.0/opam-full-2.0.0.tar.gz
if which sha256sum >/dev/null; then
sha256sum --check <<EOF
928fb5f64f4e141980ba567ff57b62d8dc7b951b58be9590ffb1be2172887a72 ocaml-4.02.3.tar.gz
15e617179251041f4bf3910257bbb8398db987d863dd3cfc288bdd958de58f00 opam-full-1.2.2.tar.gz
9dad4fcb4f53878c9daa6285d8456ccc671e21bfa71544d1f926fb8a63bfed25 opam-full-2.0.0.tar.gz
EOF
else
echo "WARNING: sha256sum was not found, checking tarballs is impossible!"
fi
echo
echo "=-=-= Compilation and installation of OCaml =-=-="
echo
cd "$BELENIOS_SYSROOT/bootstrap/src"
tar -xzf ocaml-4.02.3.tar.gz
cd ocaml-4.02.3
./configure -prefix "$BELENIOS_SYSROOT/bootstrap"
make world
if ! grep -q ARCH=none config/Makefile; then
make opt
make opt.opt
fi
make install
export PATH="$BELENIOS_SYSROOT/bootstrap/bin:$PATH"
echo
echo "=-=-= Compilation and installation of OPAM =-=-="
echo
cd "$BELENIOS_SYSROOT/bootstrap/src"
tar -xzf opam-full-1.2.2.tar.gz
cd opam-full-1.2.2
./configure -prefix "$BELENIOS_SYSROOT/bootstrap"
make lib-ext
make
make install
tar -xzf opam-full-2.0.0.tar.gz
cd opam-full-2.0.0
make cold CONFIGURE_ARGS="--prefix $BELENIOS_SYSROOT/bootstrap"
make cold-install LIBINSTALL_DIR="$BELENIOS_SYSROOT/bootstrap/lib/ocaml"
echo
echo "=-=-= Generation of env.sh =-=-="
......@@ -78,16 +61,15 @@ echo
cat > $BELENIOS_SRC/env.sh <<EOF
PATH="$BELENIOS_SYSROOT/bootstrap/bin:\$PATH"; export PATH;
OPAMROOT=$OPAMROOT; export OPAMROOT;
eval \`opam config env\`
eval \$(opam env)
EOF
echo
echo "=-=-= Initialization of OPAM root =-=-="
echo
opam init --no-setup
eval `opam config env`
opam switch 4.06.1
eval `opam config env`
opam init --bare --no-setup
opam switch create 4.06.1
eval $(opam env)
echo
echo "=-=-= Installation of Belenios build-dependencies =-=-="
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment