about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorlarsr <Lars.Rasmusson@gmail.com>2023-12-12 07:19:37 +0100
committerGitHub <noreply@github.com>2023-12-12 07:19:37 +0100
commit5d43a8764fa6b933eb01b8bb0f4bd253226bf261 (patch)
tree848ecd41431f48f788edd8d42c8fe6c1d679da57 /pkgs
parent23959be581c8adf54bc76a23d742ba3e51bdbcc9 (diff)
downloadnixlib-5d43a8764fa6b933eb01b8bb0f4bd253226bf261.tar
nixlib-5d43a8764fa6b933eb01b8bb0f4bd253226bf261.tar.gz
nixlib-5d43a8764fa6b933eb01b8bb0f4bd253226bf261.tar.bz2
nixlib-5d43a8764fa6b933eb01b8bb0f4bd253226bf261.tar.lz
nixlib-5d43a8764fa6b933eb01b8bb0f4bd253226bf261.tar.xz
nixlib-5d43a8764fa6b933eb01b8bb0f4bd253226bf261.tar.zst
nixlib-5d43a8764fa6b933eb01b8bb0f4bd253226bf261.zip
coqPackages.metacoq: update for coq 8.17 and 8.18 (#273541)
Also update default.nix to match the default.nix in
MetaCoq/metacoq:.nix/coq-overlays/metacoq/default.nix

Because some files have changed names, some version-dependent
building is required to keep building older versions.

And Metacoq's default.nix had older version checksums.
We use the more recent versions from nixpkgs for coq 8.14-8.16

Co-authored-by: Lars Rasmusson <Lars.Rasmusson@rise>
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/coq-modules/metacoq/default.nix23
1 files changed, 19 insertions, 4 deletions
diff --git a/pkgs/development/coq-modules/metacoq/default.nix b/pkgs/development/coq-modules/metacoq/default.nix
index 9ab49f8e0861..5695bcf2ee99 100644
--- a/pkgs/development/coq-modules/metacoq/default.nix
+++ b/pkgs/development/coq-modules/metacoq/default.nix
@@ -5,7 +5,7 @@ with builtins // lib;
 let
   repo  = "metacoq";
   owner = "MetaCoq";
-  defaultVersion = with versions; lib.switch coq.coq-version [
+  defaultVersion = with versions; switch coq.coq-version [
       { case = "8.11"; out = "1.0-beta2-8.11"; }
       { case = "8.12"; out = "1.0-beta2-8.12"; }
       # Do not provide 8.13 because it does not compile with equations 1.3 provided by default (only 1.2.3)
@@ -13,6 +13,8 @@ let
       { case = "8.14"; out = "1.1-8.14"; }
       { case = "8.15"; out = "1.1-8.15"; }
       { case = "8.16"; out = "1.1-8.16"; }
+      { case = "8.17"; out = "1.2.1-8.17"; }
+      { case = "8.18"; out = "1.2.1-8.18"; }
     ] null;
   release = {
     "1.0-beta2-8.11".sha256 = "sha256-I9YNk5Di6Udvq5/xpLSNflfjRyRH8fMnRzbo3uhpXNs=";
@@ -24,11 +26,15 @@ let
     "1.1-8.14".sha256 = "sha256-6vViCNQl6BnGgOHX3P/OLfFXN4aUfv4RbDokfz2BgQI=";
     "1.1-8.15".sha256 = "sha256-qCD3wFW4E+8vSVk4XoZ0EU4PVya0al+JorzS9nzmR/0=";
     "1.1-8.16".sha256 = "sha256-cTK4ptxpPPlqxAhasZFX3RpSlsoTZwhTqs2A3BZy9sA=";
+    "1.2.1-8.17".sha256 = "sha256-FP4upuRsG8B5Q5FIr76t+ecRirrOUX0D1QiLq0/zMyE=";
+    "1.2.1-8.18".sha256 = "sha256-49g5db2Bv8HpltptJdxA7zrmgNFGC6arx5h2mKHhrko=";
   };
   releaseRev = v: "v${v}";
 
   # list of core metacoq packages sorted by dependency order
-  packages = [ "template-coq" "pcuic" "safechecker" "erasure" "all" ];
+  packages = if versionAtLeast coq.coq-version "8.17"
+     then [ "utils" "common" "template-coq" "pcuic" "safechecker" "template-pcuic" "erasure" "quotation" "safechecker-plugin" "erasure-plugin" "all" ]
+     else [ "template-coq" "pcuic" "safechecker" "erasure" "all" ];
 
   template-coq = metacoq_ "template-coq";
 
@@ -47,7 +53,16 @@ let
         mlPlugin = true;
         propagatedBuildInputs = [ equations coq.ocamlPackages.zarith ] ++ metacoq-deps;
 
-        patchPhase =  ''
+        patchPhase =  if versionAtLeast coq.coq-version "8.17" then ''
+          patchShebangs ./configure.sh
+          patchShebangs ./template-coq/update_plugin.sh
+          patchShebangs ./template-coq/gen-src/to-lower.sh
+          patchShebangs ./safechecker-plugin/clean_extraction.sh
+          patchShebangs ./erasure-plugin/clean_extraction.sh
+          echo "CAMLFLAGS+=-w -60 # Unused module" >> ./safechecker/Makefile.plugin.local
+          sed -i -e 's/mv $i $newi;/mv $i tmp; mv tmp $newi;/' ./template-coq/gen-src/to-lower.sh ./safechecker-plugin/clean_extraction.sh ./erasure-plugin/clean_extraction.sh
+        '' else ''
+          patchShebangs ./configure.sh
           patchShebangs ./template-coq/update_plugin.sh
           patchShebangs ./template-coq/gen-src/to-lower.sh
           patchShebangs ./pcuic/clean_extraction.sh
@@ -59,7 +74,7 @@ let
 
         configurePhase = optionalString (package == "all") pkgallMake + ''
           touch ${pkgpath}/metacoq-config
-        '' + optionalString (elem package ["safechecker" "erasure"]) ''
+        '' + optionalString (elem package ["safechecker" "erasure" "template-pcuic" "quotation" "safechecker-plugin" "erasure-plugin"]) ''
           echo  "-I ${template-coq}/lib/coq/${coq.coq-version}/user-contrib/MetaCoq/Template/" > ${pkgpath}/metacoq-config
         '' + optionalString (package == "single") ''
           ./configure.sh local