From dbcad82b91111616fe3bdc92d182d39fc2a938fc Mon Sep 17 00:00:00 2001
From: Ralf Jung <jung@mpi-sws.org>
Date: Thu, 24 Jan 2019 20:01:14 +0100
Subject: [PATCH] reinstate opam 1.2 compatibility in a separate untested code
 path

---
 Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 5228ead2e..2623cc780 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,13 @@ build-dep: build-dep/opam phony
 	@# To achieve this, we create a fake opam package that has our build-dependencies as
 	@# dependencies, but does not actually install anything itself.
 	@echo "# Pinning build-dep package." && \
-	  opam install $(OPAMFLAGS) build-dep/
+	  if opam --version | grep "^1\." -q; then \
+	    BUILD_DEP_PACKAGE="$$(egrep "^name:" build-dep/opam | sed 's/^name: *"\(.*\)" */\1/')" && \
+	    opam pin add -k path $(OPAMFLAGS) "$$BUILD_DEP_PACKAGE".dev build-dep && \
+	    opam reinstall $(OPAMFLAGS) "$$BUILD_DEP_PACKAGE"; \
+	  else \
+	    opam install $(OPAMFLAGS) build-dep/; \
+	  fi
 
 # Some files that do *not* need to be forwarded to Makefile.coq
 Makefile: ;
-- 
GitLab