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>

authored by larsr Lars Rasmusson and committed by GitHub 5d43a876 23959be5

+19 -4
+19 -4
pkgs/development/coq-modules/metacoq/default.nix
··· 5 5 let 6 6 repo = "metacoq"; 7 7 owner = "MetaCoq"; 8 - defaultVersion = with versions; lib.switch coq.coq-version [ 8 + defaultVersion = with versions; switch coq.coq-version [ 9 9 { case = "8.11"; out = "1.0-beta2-8.11"; } 10 10 { case = "8.12"; out = "1.0-beta2-8.12"; } 11 11 # Do not provide 8.13 because it does not compile with equations 1.3 provided by default (only 1.2.3) ··· 13 13 { case = "8.14"; out = "1.1-8.14"; } 14 14 { case = "8.15"; out = "1.1-8.15"; } 15 15 { case = "8.16"; out = "1.1-8.16"; } 16 + { case = "8.17"; out = "1.2.1-8.17"; } 17 + { case = "8.18"; out = "1.2.1-8.18"; } 16 18 ] null; 17 19 release = { 18 20 "1.0-beta2-8.11".sha256 = "sha256-I9YNk5Di6Udvq5/xpLSNflfjRyRH8fMnRzbo3uhpXNs="; ··· 24 26 "1.1-8.14".sha256 = "sha256-6vViCNQl6BnGgOHX3P/OLfFXN4aUfv4RbDokfz2BgQI="; 25 27 "1.1-8.15".sha256 = "sha256-qCD3wFW4E+8vSVk4XoZ0EU4PVya0al+JorzS9nzmR/0="; 26 28 "1.1-8.16".sha256 = "sha256-cTK4ptxpPPlqxAhasZFX3RpSlsoTZwhTqs2A3BZy9sA="; 29 + "1.2.1-8.17".sha256 = "sha256-FP4upuRsG8B5Q5FIr76t+ecRirrOUX0D1QiLq0/zMyE="; 30 + "1.2.1-8.18".sha256 = "sha256-49g5db2Bv8HpltptJdxA7zrmgNFGC6arx5h2mKHhrko="; 27 31 }; 28 32 releaseRev = v: "v${v}"; 29 33 30 34 # list of core metacoq packages sorted by dependency order 31 - packages = [ "template-coq" "pcuic" "safechecker" "erasure" "all" ]; 35 + packages = if versionAtLeast coq.coq-version "8.17" 36 + then [ "utils" "common" "template-coq" "pcuic" "safechecker" "template-pcuic" "erasure" "quotation" "safechecker-plugin" "erasure-plugin" "all" ] 37 + else [ "template-coq" "pcuic" "safechecker" "erasure" "all" ]; 32 38 33 39 template-coq = metacoq_ "template-coq"; 34 40 ··· 47 53 mlPlugin = true; 48 54 propagatedBuildInputs = [ equations coq.ocamlPackages.zarith ] ++ metacoq-deps; 49 55 50 - patchPhase = '' 56 + patchPhase = if versionAtLeast coq.coq-version "8.17" then '' 57 + patchShebangs ./configure.sh 58 + patchShebangs ./template-coq/update_plugin.sh 59 + patchShebangs ./template-coq/gen-src/to-lower.sh 60 + patchShebangs ./safechecker-plugin/clean_extraction.sh 61 + patchShebangs ./erasure-plugin/clean_extraction.sh 62 + echo "CAMLFLAGS+=-w -60 # Unused module" >> ./safechecker/Makefile.plugin.local 63 + 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 64 + '' else '' 65 + patchShebangs ./configure.sh 51 66 patchShebangs ./template-coq/update_plugin.sh 52 67 patchShebangs ./template-coq/gen-src/to-lower.sh 53 68 patchShebangs ./pcuic/clean_extraction.sh ··· 59 74 60 75 configurePhase = optionalString (package == "all") pkgallMake + '' 61 76 touch ${pkgpath}/metacoq-config 62 - '' + optionalString (elem package ["safechecker" "erasure"]) '' 77 + '' + optionalString (elem package ["safechecker" "erasure" "template-pcuic" "quotation" "safechecker-plugin" "erasure-plugin"]) '' 63 78 echo "-I ${template-coq}/lib/coq/${coq.coq-version}/user-contrib/MetaCoq/Template/" > ${pkgpath}/metacoq-config 64 79 '' + optionalString (package == "single") '' 65 80 ./configure.sh local