diff --git a/.nix/config.nix b/.nix/config.nix index babe0af..c0e1256 100644 --- a/.nix/config.nix +++ b/.nix/config.nix @@ -57,7 +57,7 @@ }; bundles."master".coqPackages = { coq.override.version = "master"; - coq-elpi.override.version = "coq-master"; + coq-elpi.override.version = "master"; hierarchy-builder.override.version = "master"; mathcomp.override.version = "master"; }; diff --git a/.nix/coq-overlays/coq-elpi/default.nix b/.nix/coq-overlays/coq-elpi/default.nix new file mode 100644 index 0000000..9a7879f --- /dev/null +++ b/.nix/coq-overlays/coq-elpi/default.nix @@ -0,0 +1,85 @@ +{ lib, mkCoqDerivation, which, coq, version ? null }: + +let + elpi = coq.ocamlPackages.elpi.override (lib.switch coq.coq-version [ + { case = "8.11"; out = { version = "1.11.4"; };} + { case = "8.12"; out = { version = "1.12.0"; };} + { case = "8.13"; out = { version = "1.13.7"; };} + { case = "8.14"; out = { version = "1.13.7"; };} + { case = "8.15"; out = { version = "1.15.0"; };} + { case = "8.16"; out = { version = "1.17.0"; };} + { case = "8.17"; out = { version = "1.17.0"; };} + { case = "8.18"; out = { version = "1.18.1"; };} + { case = "8.20"; out = { version = "1.19.2"; };} + ] { version = "v1.19.4"; } ); +in (mkCoqDerivation { + pname = "elpi"; + repo = "coq-elpi"; + owner = "LPCIC"; + inherit version; + defaultVersion = lib.switch coq.coq-version [ + { case = "8.20"; out = "2.2.0"; } + { case = "8.19"; out = "2.0.1"; } + { case = "8.18"; out = "2.0.0"; } + { case = "8.17"; out = "1.18.0"; } + { case = "8.16"; out = "1.15.6"; } + { case = "8.15"; out = "1.14.0"; } + { case = "8.14"; out = "1.11.2"; } + { case = "8.13"; out = "1.11.1"; } + { case = "8.12"; out = "1.8.3_8.12"; } + { case = "8.11"; out = "1.6.3_8.11"; } + ] null; + release."2.2.0".sha256 = "sha256-rADEoqTXM7/TyYkUKsmCFfj6fjpWdnZEOK++5oLfC/I="; + release."2.0.1".sha256 = "sha256-cuoPsEJ+JRLVc9Golt2rJj4P7lKltTrrmQijjoViooc="; + release."2.0.0".sha256 = "sha256-A/cH324M21k3SZ7+YWXtaYEbu6dZQq3K0cb1RMKjbsM="; + release."1.19.0".sha256 = "sha256-kGoo61nJxeG/BqV+iQaV3iinwPStND+7+fYMxFkiKrQ="; + release."1.18.0".sha256 = "sha256-2fCOlhqi4YkiL5n8SYHuc3pLH+DArf9zuMH7IhpBc2Y="; + release."1.17.0".sha256 = "sha256-J8GatRKFU0ekNCG3V5dBI+FXypeHcLgC5QJYGYzFiEM="; + release."1.15.6".sha256 = "sha256-qc0q01tW8NVm83801HHOBHe/7H1/F2WGDbKO6nCXfno="; + release."1.15.1".sha256 = "sha256-NT2RlcIsFB9AvBhMxil4ZZIgx+KusMqDflj2HgQxsZg="; + release."1.14.0".sha256 = "sha256:1v2p5dlpviwzky2i14cj7gcgf8cr0j54bdm9fl5iz1ckx60j6nvp"; + release."1.13.0".sha256 = "1j7s7dlnjbw222gnbrsjgmjck1yrx7h6hwm8zikcyxi0zys17w7n"; + release."1.12.1".sha256 = "sha256-4mO6/co7NcIQSGIQJyoO8lNWXr6dqz+bIYPO/G0cPkY="; + release."1.11.2".sha256 = "0qk5cfh15y2zrja7267629dybd3irvxk1raz7z8qfir25a81ckd4"; + release."1.11.1".sha256 = "10j076vc2hdcbm15m6s7b6xdzibgfcbzlkgjnlkr2vv9k13qf8kc"; + release."1.10.1".sha256 = "1zsyx26dvj7pznfd2msl2w7zbw51q1nsdw0bdvdha6dga7ijf7xk"; + release."1.9.7".sha256 = "0rvn12h9dpk9s4pxy32p8j0a1h7ib7kg98iv1cbrdg25y5vs85n1"; + release."1.9.5".sha256 = "0gjdwmb6bvb5gh0a6ra48bz5fb3pr5kpxijb7a8mfydvar5i9qr6"; + release."1.9.4".sha256 = "0nii7238mya74f9g6147qmpg6gv6ic9b54x5v85nb6q60d9jh0jq"; + release."1.9.3".sha256 = "198irm800fx3n8n56vx1c6f626cizp1d7jfkrc6ba4iqhb62ma0z"; + release."1.9.2".sha256 = "1rr2fr8vjkc0is7vh1461aidz2iwkigdkp6bqss4hhv0c3ijnn07"; + release."1.8.3_8.12".sha256 = "15z2l4zy0qpw0ws7bvsmpmyv543aqghrfnl48nlwzn9q0v89p557"; + release."1.8.3_8.12".version = "1.8.3"; + release."1.8.2_8.12".sha256 = "1n6jwcdazvjgj8vsv2r9zgwpw5yqr5a1ndc2pwhmhqfl04b5dk4y"; + release."1.8.2_8.12".version = "1.8.2"; + release."1.8.1".sha256 = "1fbbdccdmr8g4wwpihzp4r2xacynjznf817lhijw6kqfav75zd0r"; + release."1.8.0".sha256 = "13ywjg94zkbki22hx7s4gfm9rr87r4ghsgan23xyl3l9z8q0idd1"; + release."1.7.0".sha256 = "1ws5cqr0xawv69prgygbl3q6dgglbaw0vc397h9flh90kxaqgyh8"; + release."1.6.3_8.11".sha256 = "1j340cr2bv95clzzkkfmsjkklham1mj84cmiyprzwv20q89zr1hp"; + release."1.6.3_8.11".version = "1.6.3"; + release."1.6.2_8.11".sha256 = "06xrx0ljilwp63ik2sxxr7h617dgbch042xfcnfpy5x96br147rn"; + release."1.6.2_8.11".version = "1.6.2"; + release."1.6.1_8.11".sha256 = "0yyyh35i1nb3pg4hw7cak15kj4y6y9l84nwar9k1ifdsagh5zq53"; + release."1.6.1_8.11".version = "1.6.1"; + release."1.6.0_8.11".sha256 = "0ahxjnzmd7kl3gl38kyjqzkfgllncr2ybnw8bvgrc6iddgga7bpq"; + release."1.6.0_8.11".version = "1.6.0"; + release."1.6.0".sha256 = "0kf99i43mlf750fr7fric764mm495a53mg5kahnbp6zcjcxxrm0b"; + releaseRev = v: "v${v}"; + + buildFlags = [ "OCAMLWARN=" ]; + + mlPlugin = true; + useDuneifVersion = v: lib.versions.isGe "2.2.0" v || v == "dev"; + propagatedBuildInputs = [ coq.ocamlPackages.findlib elpi ]; + + meta = { + description = "Coq plugin embedding ELPI"; + maintainers = [ lib.maintainers.cohencyril ]; + license = lib.licenses.lgpl21Plus; + }; +}).overrideAttrs (o: + lib.optionalAttrs (o.version != null + && (o.version == "dev" || lib.versions.isGe "2.2.0" o.version)) + { + propagatedBuildInputs = o.propagatedBuildInputs ++ [ coq.ocamlPackages.ppx_optcomp ]; + }) diff --git a/.nix/coq-overlays/mathcomp/default.nix b/.nix/coq-overlays/mathcomp/default.nix deleted file mode 100644 index dbaf587..0000000 --- a/.nix/coq-overlays/mathcomp/default.nix +++ /dev/null @@ -1,122 +0,0 @@ -############################################################################ -# This file mainly provides the `mathcomp` derivation, which is # -# essentially a meta-package containing all core mathcomp libraries # -# (ssreflect fingroup algebra solvable field character). They can be # -# accessed individually through the passthrough attributes of mathcomp # -# bearing the same names (mathcomp.ssreflect, etc). # -############################################################################ -# Compiling a custom version of mathcomp using `mathcomp.override`. # -# This is the replacement for the former `mathcomp_ config` function. # -# See the documentation at doc/languages-frameworks/coq.section.md. # -############################################################################ - -{ lib, ncurses, graphviz, lua, fetchzip, - coq-elpi, hierarchy-builder, - mkCoqDerivation, recurseIntoAttrs, withDoc ? false, single ? false, - coqPackages, coq, version ? null }@args: -with builtins // lib; -let - repo = "math-comp"; - owner = "math-comp"; - withDoc = single && (args.withDoc or false); - defaultVersion = with versions; switch coq.coq-version [ - { case = isGe "8.11"; out = "1.14.0"; } - { case = range "8.11" "8.15"; out = "1.13.0"; } - { case = range "8.10" "8.13"; out = "1.12.0"; } - { case = range "8.7" "8.12"; out = "1.11.0"; } - { case = range "8.7" "8.11"; out = "1.10.0"; } - { case = range "8.7" "8.11"; out = "1.9.0"; } - { case = range "8.7" "8.9"; out = "1.8.0"; } - { case = range "8.6" "8.9"; out = "1.7.0"; } - { case = range "8.5" "8.7"; out = "1.6.4"; } - ] null; - release = { - "1.14.0".sha256 = "07yamlp1c0g5nahkd2gpfhammcca74ga2s6qr7a3wm6y6j5pivk9"; - "1.13.0".sha256 = "0j4cz2y1r1aw79snkcf1pmicgzf8swbaf9ippz0vg99a572zqzri"; - "1.12.0".sha256 = "1ccfny1vwgmdl91kz5xlmhq4wz078xm4z5wpd0jy5rn890dx03wp"; - "1.11.0".sha256 = "06a71d196wd5k4wg7khwqb7j7ifr7garhwkd54s86i0j7d6nhl3c"; - "1.10.0".sha256 = "1b9m6pwxxyivw7rgx82gn5kmgv2mfv3h3y0mmjcjfypi8ydkrlbv"; - "1.9.0".sha256 = "0lid9zaazdi3d38l8042lczb02pw5m9wq0yysiilx891hgq2p81r"; - "1.8.0".sha256 = "07l40is389ih8bi525gpqs3qp4yb2kl11r9c8ynk1ifpjzpnabwp"; - "1.7.0".sha256 = "0wnhj9nqpx2bw6n1l4i8jgrw3pjajvckvj3lr4vzjb3my2lbxdd1"; - "1.6.4".sha256 = "09ww48qbjsvpjmy1g9yhm0rrkq800ffq21p6fjkbwd34qvd82raz"; - "1.6.1".sha256 = "1ilw6vm4dlsdv9cd7kmf0vfrh2kkzr45wrqr8m37miy0byzr4p9i"; - }; - releaseRev = v: "mathcomp-${v}"; - - # list of core mathcomp packages sorted by dependency order - packages = [ "ssreflect" "fingroup" "algebra" "solvable" "field" "character" "all" ]; - - mathcomp_ = package: let - mathcomp-deps = if package == "single" then [] - else map mathcomp_ (head (splitList (pred.equal package) packages)); - pkgpath = if package == "single" then "mathcomp" else "mathcomp/${package}"; - pname = if package == "single" then "mathcomp" else "mathcomp-${package}"; - pkgallMake = '' - echo "all.v" > Make - echo "-I ." >> Make - echo "-R . mathcomp.all" >> Make - ''; - derivation = mkCoqDerivation ({ - inherit version pname defaultVersion release releaseRev repo owner; - - mlPlugin = versions.isLe "8.6" coq.coq-version; - nativeBuildInputs = optionals withDoc [ graphviz lua ]; - buildInputs = [ ncurses ]; - propagatedBuildInputs = [ coq-elpi hierarchy-builder ] ++ mathcomp-deps; - - buildFlags = optional withDoc "doc"; - - preBuild = '' - if [[ -f etc/utils/ssrcoqdep ]] - then patchShebangs etc/utils/ssrcoqdep - fi - if [[ -f etc/buildlibgraph ]] - then patchShebangs etc/buildlibgraph - fi - '' + '' - cd ${pkgpath} - '' + optionalString (package == "all") pkgallMake; - - meta = { - homepage = "https://math-comp.github.io/"; - license = licenses.cecill-b; - maintainers = with maintainers; [ vbgl jwiegley cohencyril ]; - }; - } // optionalAttrs (package != "single") - { passthru = genAttrs packages mathcomp_; } - // optionalAttrs withDoc { - htmldoc_template = - fetchzip { - url = "https://github.com/math-comp/math-comp.github.io/archive/doc-1.12.0.zip"; - sha256 = "0y1352ha2yy6k2dl375sb1r68r1qi9dyyy7dyzj5lp9hxhhq69x8"; - }; - postBuild = '' - cp -rf _build_doc/* . - rm -r _build_doc - ''; - postInstall = - let tgt = "$out/share/coq/${coq.coq-version}/"; in - optionalString withDoc '' - mkdir -p ${tgt} - cp -r htmldoc ${tgt} - cp -r $htmldoc_template/htmldoc_template/* ${tgt}/htmldoc/ - ''; - buildTargets = "doc"; - extraInstallFlags = [ "-f Makefile.coq" ]; - }); - patched-derivation1 = derivation.overrideAttrs (o: - optionalAttrs (o.pname != null && o.pname == "mathcomp-all" && - o.version != null && o.version != "dev" && versions.isLt "1.7" o.version) - { preBuild = ""; buildPhase = ""; installPhase = "echo doing nothing"; } - ); - patched-derivation = patched-derivation1.overrideAttrs (o: - optionalAttrs (versions.isLe "8.7" coq.coq-version || - (o.version != "dev" && versions.isLe "1.7" o.version)) - { - installFlags = o.installFlags ++ [ "-f Makefile.coq" ]; - } - ); - in patched-derivation; -in -mathcomp_ (if single then "single" else "all")