Skip to content

Commit

Permalink
Merge pull request #7 from ocurrent/opam-2.2
Browse files Browse the repository at this point in the history
Include opam 2.2 in the base image
  • Loading branch information
mtelvers authored Sep 5, 2024
2 parents 504f12a + 56ed914 commit f11ec41
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions roles/base-image/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,19 @@
echo "OPAMCONFIRMLEVEL=unsafe-yes; export OPAMCONFIRMLEVEL" >> .profile
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
git clone https://github.com/ocaml/opam /home/opam/opam && cd /home/opam/opam && cp -P -R -p . ../opam-sources && git checkout 62ad0c21768e28532466572dbaa066913a6c050d && git remote add mtelvers https://github.com/mtelvers/opam && git fetch mtelvers && git cherry-pick bfa86fcc5187bf71080d5f934ff147cdbb64a9e1 && env MAKE='gmake -j' shell/bootstrap-ocaml.sh && gmake -C src_ext cache-archives
cd /home/opam/opam-sources && cp -P -R -p . ../opam-build-2.0 && cd ../opam-build-2.0 && git checkout 2.0 && ln -s ../opam/src_ext/archives src_ext/archives && env PATH="/home/opam/opam/bootstrap/ocaml/bin:$PATH" ./configure --enable-cold-check && env PATH="/home/opam/opam/bootstrap/ocaml/bin:$PATH" gmake lib-ext all && mkdir -p /usr/local/bin && sudo cp /home/opam/opam-build-2.0/opam /usr/local/bin/opam-2.0 && sudo chmod a+x /usr/local/bin/opam-2.0 && rm -rf /home/opam/opam-build-2.0
cd /home/opam/opam-sources && cp -P -R -p . ../opam-build-2.1 && cd ../opam-build-2.1 && git checkout 2.1 && ln -s ../opam/src_ext/archives src_ext/archives && env PATH="/home/opam/opam/bootstrap/ocaml/bin:$PATH" ./configure --enable-cold-check --with-0install-solver && env PATH="/home/opam/opam/bootstrap/ocaml/bin:$PATH" gmake lib-ext all && mkdir -p /usr/local/bin && sudo cp /home/opam/opam-build-2.1/opam /usr/local/bin/opam-2.1 && sudo chmod a+x /usr/local/bin/opam-2.1 && rm -rf /home/opam/opam-build-2.1
cd /home/opam/opam-sources && cp -P -R -p . ../opam-build-master && cd ../opam-build-master && git checkout master && ln -s ../opam/src_ext/archives src_ext/archives && env PATH="/home/opam/opam/bootstrap/ocaml/bin:$PATH" ./configure --enable-cold-check --with-0install-solver --with-vendored-deps && env PATH="/home/opam/opam/bootstrap/ocaml/bin:$PATH" gmake lib-ext all && mkdir -p /usr/local/bin && sudo cp /home/opam/opam-build-master/opam /usr/local/bin/opam-dev && sudo chmod a+x /usr/local/bin/opam-master && rm -rf /home/opam/opam-build-master
sudo ln /usr/local/bin/opam-2.1 /usr/local/bin/opam
curl -s https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh -o install.sh
chmod +x install.sh
for version in 2.1.5 2.2.0 dev ; do
if [ "$version" = "dev" ] ; then
./install.sh --dev --download-only
else
./install.sh --version $version --download-only
fi
chmod a+x opam-*
sudo mv opam-* /usr/local/bin/opam-"${version%.*}"
done
rm install.sh
sudo ln -f /usr/local/bin/opam-2.1 /usr/local/bin/opam
cd /home/opam
git clone https://github.com/ocaml/opam-repository.git
opam init -k git -a ./opam-repository -c {{ version }} -y
Expand Down

0 comments on commit f11ec41

Please sign in to comment.