Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include opam 2.2 in the base image #7

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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