Skip to content
Snippets Groups Projects
Commit a405ab11 authored by Ralf Jung's avatar Ralf Jung
Browse files

update build system

parent 1f37b537
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,7 @@ Makefile.coq: _CoqProject Makefile awk.Makefile ...@@ -20,7 +20,7 @@ Makefile.coq: _CoqProject Makefile awk.Makefile
# Install build-dependencies # Install build-dependencies
build-dep/opam: opam Makefile build-dep/opam: opam Makefile
# Create the build-dep package. # Creating the build-dep package.
@mkdir -p build-dep @mkdir -p build-dep
@sed <opam -E 's/^(build|install|remove):.*/\1: []/; s/^name: *"(.*)" */name: "\1-builddep"/' >build-dep/opam @sed <opam -E 's/^(build|install|remove):.*/\1: []/; s/^name: *"(.*)" */name: "\1-builddep"/' >build-dep/opam
@fgrep builddep build-dep/opam >/dev/null || (echo "sed failed to fix the package name" && exit 1) # sanity check @fgrep builddep build-dep/opam >/dev/null || (echo "sed failed to fix the package name" && exit 1) # sanity check
...@@ -34,7 +34,7 @@ build-dep: build-dep/opam phony ...@@ -34,7 +34,7 @@ build-dep: build-dep/opam phony
@# Upgrading is needed in case the pin already exists, but the builddep package changed. @# Upgrading is needed in case the pin already exists, but the builddep package changed.
@BUILD_DEP_PACKAGE="$$(egrep "^name:" build-dep/opam | sed 's/^name: *"\(.*\)" */\1/')"; \ @BUILD_DEP_PACKAGE="$$(egrep "^name:" build-dep/opam | sed 's/^name: *"\(.*\)" */\1/')"; \
echo "# Pinning build-dep package." && \ echo "# Pinning build-dep package." && \
opam pin add "$$BUILD_DEP_PACKAGE".dev "$$(pwd)/build-dep" -k path $(OPAMFLAGS) && \ opam pin add -k path $(OPAMFLAGS) "$$BUILD_DEP_PACKAGE".dev build-dep && \
echo "# Updating build-dep package." && \ echo "# Updating build-dep package." && \
opam upgrade "$$BUILD_DEP_PACKAGE" opam upgrade "$$BUILD_DEP_PACKAGE"
......
...@@ -14,22 +14,28 @@ export OPAM_EDITOR="$(which false)" ...@@ -14,22 +14,28 @@ export OPAM_EDITOR="$(which false)"
# Make sure we got a good OPAM. # Make sure we got a good OPAM.
test -d "$OPAMROOT" || (mkdir "$OPAMROOT" && run_and_print opam init --no-setup -y) test -d "$OPAMROOT" || (mkdir "$OPAMROOT" && run_and_print opam init --no-setup -y)
eval `opam conf env` eval `opam conf env`
# Delete old pins from opam.pins times.
run_and_print opam pin remove coq-stdpp -n
run_and_print opam pin remove coq-iris -n
# Make sure the pin for the builddep package is not stale. # Make sure the pin for the builddep package is not stale.
run_and_print make build-dep/opam run_and_print make build-dep/opam
# Get us all the latest repositories # Update repositories
if test $(find "$OPAMROOT/repo/package-index" -mtime +0); then if test $(find "$OPAMROOT/repo/package-index" -mtime +0); then
# last update was more than a day ago # last update was more than a day ago
run_and_print opam update run_and_print opam update
else else
# only update iris-dev # only update iris-dev, and only if it already exists
if test -d "$OPAMROOT/repo/iris-dev"; then run_and_print opam update iris-dev; fi if test -d "$OPAMROOT/repo/iris-dev"; then run_and_print opam update iris-dev; fi
fi fi
test -d "$OPAMROOT/repo/coq-extra-dev" && run_and_print opam repo remove coq-extra-dev # Make sure we got the right set of repositories registered
test -d "$OPAMROOT/repo/coq-core-dev" || run_and_print opam repo add coq-core-dev https://coq.inria.fr/opam/core-dev -p 5 if echo "$@" | fgrep "dev"; then
# We are compiling against a dev version of something. Get ourselves the dev repositories.
test -d "$OPAMROOT/repo/coq-extra-dev" || run_and_print opam repo add coq-extra-dev https://coq.inria.fr/opam/extra-dev -p 0
test -d "$OPAMROOT/repo/coq-core-dev" || run_and_print opam repo add coq-core-dev https://coq.inria.fr/opam/core-dev -p 5
else
# No dev version, make sure we do not have the dev repositories.
test -d "$OPAMROOT/repo/coq-extra-dev" && run_and_print opam repo remove coq-extra-dev
test -d "$OPAMROOT/repo/coq-core-dev" && run_and_print opam repo remove coq-core-dev
fi
test -d "$OPAMROOT/repo/coq-released" || run_and_print opam repo add coq-released https://coq.inria.fr/opam/released -p 10 test -d "$OPAMROOT/repo/coq-released" || run_and_print opam repo add coq-released https://coq.inria.fr/opam/released -p 10
test -d "$OPAMROOT/repo/iris-dev" || run_and_print opam repo add iris-dev https://gitlab.mpi-sws.org/FP/opam-dev.git -p 20 test -d "$OPAMROOT/repo/iris-dev" || run_and_print opam repo add iris-dev https://gitlab.mpi-sws.org/FP/opam-dev.git -p 20
echo echo
...@@ -48,7 +54,7 @@ while (( "$#" )); do # while there are arguments left ...@@ -48,7 +54,7 @@ while (( "$#" )); do # while there are arguments left
echo "[opam-ci] $PACKAGE already pinned to $VERSION" echo "[opam-ci] $PACKAGE already pinned to $VERSION"
else else
echo "[opam-ci] Pinning $PACKAGE to $VERSION" echo "[opam-ci] Pinning $PACKAGE to $VERSION"
run_and_print opam pin add "$PACKAGE" "$VERSION" -k version -y run_and_print opam pin add -y -k version "$PACKAGE" "$VERSION"
fi fi
done done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment