2022-09-30 11:47:45 +00:00
|
|
|
{ lib,
|
2024-07-01 15:47:52 +00:00
|
|
|
mkCoqDerivation,
|
2022-10-21 18:38:19 +00:00
|
|
|
mathcomp, mathcomp-finmap, mathcomp-bigenough,
|
2022-09-30 11:47:45 +00:00
|
|
|
hierarchy-builder,
|
2022-10-21 18:38:19 +00:00
|
|
|
single ? false,
|
2022-09-30 11:47:45 +00:00
|
|
|
coqPackages, coq, version ? null }@args:
|
2024-07-01 15:47:52 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
let
|
2023-03-04 12:14:45 +00:00
|
|
|
repo = "analysis";
|
2021-01-09 10:05:03 +00:00
|
|
|
owner = "math-comp";
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
release."1.2.0".sha256 = "sha256-w6BivDM4dF4Iv4rUTy++2feweNtMAJxgGExPfYGhXxo=";
|
|
|
|
release."1.1.0".sha256 = "sha256-wl4kZf4mh9zbFfGcqaFEgWRyp0Bj511F505mYodpS6o=";
|
2024-02-29 20:09:43 +00:00
|
|
|
release."1.0.0".sha256 = "sha256-KiXyaWB4zQ3NuXadq4BSWfoN1cIo1xiLVSN6nW03tC4=";
|
|
|
|
release."0.7.0".sha256 = "sha256-JwkyetXrFsFHqz8KY3QBpHsrkhmEFnrCGuKztcoen60=";
|
|
|
|
release."0.6.7".sha256 = "sha256-3i2PBMEwihwgwUmnS0cmrZ8s+aLPFVq/vo0aXMUaUyA=";
|
2023-11-16 04:20:00 +00:00
|
|
|
release."0.6.6".sha256 = "sha256-tWtv6yeB5/vzwpKZINK9OQ0yQsvD8qu9zVSNHvLMX5Y=";
|
|
|
|
release."0.6.5".sha256 = "sha256-oJk9/Jl1SWra2aFAXRAVfX7ZUaDfajqdDksYaW8dv8E=";
|
2023-03-04 12:14:45 +00:00
|
|
|
release."0.6.1".sha256 = "sha256-1VyNXu11/pDMuH4DmFYSUF/qZ4Bo+/Zl3Y0JkyrH/r0=";
|
|
|
|
release."0.6.0".sha256 = "sha256-0msICcIrK6jbOSiBu0gIVU3RHwoEEvB88CMQqW/06rg=";
|
2022-09-09 14:08:57 +00:00
|
|
|
release."0.5.3".sha256 = "sha256-1NjFsi5TITF8ZWx1NyppRmi8g6YaoUtTdS9bU/sUe5k=";
|
|
|
|
release."0.5.2".sha256 = "0yx5p9zyl8jv1vg7rgkyq8dqzkdnkqv969mi62whmhkvxbavgzbw";
|
|
|
|
release."0.5.1".sha256 = "1hnzqb1gxf88wgj2n1b0f2xm6sxg9j0735zdsv6j12hlvx5lwk68";
|
2022-02-10 20:34:41 +00:00
|
|
|
release."0.3.13".sha256 = "sha256-Yaztew79KWRC933kGFOAUIIoqukaZOdNOdw4XszR1Hg=";
|
2021-09-18 10:52:07 +00:00
|
|
|
release."0.3.10".sha256 = "sha256-FBH2c8QRibq5Ycw/ieB8mZl0fDiPrYdIzZ6W/A3pIhI=";
|
2021-07-17 21:14:59 +00:00
|
|
|
release."0.3.9".sha256 = "sha256-uUU9diBwUqBrNRLiDc0kz0CGkwTZCUmigPwLbpDOeg4=";
|
2021-03-15 08:37:03 +00:00
|
|
|
release."0.3.6".sha256 = "0g2j7b2hca4byz62ssgg90bkbc8wwp7xkb2d3225bbvihi92b4c5";
|
|
|
|
release."0.3.4".sha256 = "18mgycjgg829dbr7ps77z6lcj03h3dchjbj5iir0pybxby7gd45c";
|
|
|
|
release."0.3.3".sha256 = "1m2mxcngj368vbdb8mlr91hsygl430spl7lgyn9qmn3jykack867";
|
2021-01-09 10:05:03 +00:00
|
|
|
release."0.3.1".sha256 = "1iad288yvrjv8ahl9v18vfblgqb1l5z6ax644w49w9hwxs93f2k8";
|
|
|
|
release."0.2.3".sha256 = "0p9mr8g1qma6h10qf7014dv98ln90dfkwn76ynagpww7qap8s966";
|
|
|
|
|
2024-07-01 15:47:52 +00:00
|
|
|
defaultVersion = let inherit (lib.versions) range; in
|
|
|
|
lib.switch [ coq.version mathcomp.version ] [
|
|
|
|
{ cases = [ (range "8.17" "8.20") (range "2.0.0" "2.2.0") ]; out = "1.1.0"; }
|
2024-02-29 20:09:43 +00:00
|
|
|
{ cases = [ (range "8.17" "8.19") (range "1.17.0" "1.19.0") ]; out = "0.7.0"; }
|
|
|
|
{ cases = [ (range "8.17" "8.18") (range "1.15.0" "1.18.0") ]; out = "0.6.7"; }
|
|
|
|
{ cases = [ (range "8.17" "8.18") (range "1.15.0" "1.18.0") ]; out = "0.6.6"; }
|
|
|
|
{ cases = [ (range "8.14" "8.18") (range "1.15.0" "1.17.0") ]; out = "0.6.5"; }
|
|
|
|
{ cases = [ (range "8.14" "8.18") (range "1.13.0" "1.16.0") ]; out = "0.6.1"; }
|
2024-07-01 15:47:52 +00:00
|
|
|
{ cases = [ (range "8.14" "8.18") (range "1.13" "1.15") ]; out = "0.5.2"; }
|
|
|
|
{ cases = [ (range "8.13" "8.15") (range "1.13" "1.14") ]; out = "0.5.1"; }
|
|
|
|
{ cases = [ (range "8.13" "8.15") (range "1.12" "1.14") ]; out = "0.3.13"; }
|
|
|
|
{ cases = [ (range "8.11" "8.14") (range "1.12" "1.13") ]; out = "0.3.10"; }
|
|
|
|
{ cases = [ (range "8.10" "8.12") "1.11.0" ]; out = "0.3.3"; }
|
|
|
|
{ cases = [ (range "8.10" "8.11") "1.11.0" ]; out = "0.3.1"; }
|
|
|
|
{ cases = [ (range "8.8" "8.11") (range "1.8" "1.10") ]; out = "0.2.3"; }
|
2021-01-09 10:05:03 +00:00
|
|
|
] null;
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
# list of analysis packages sorted by dependency order
|
|
|
|
packages = [ "classical" "analysis" ];
|
|
|
|
|
|
|
|
mathcomp_ = package: let
|
2023-07-15 17:15:38 +00:00
|
|
|
classical-deps = [ mathcomp.algebra mathcomp-finmap ];
|
2022-10-21 18:38:19 +00:00
|
|
|
analysis-deps = [ mathcomp.field mathcomp-bigenough ];
|
2024-07-01 15:47:52 +00:00
|
|
|
intra-deps = lib.optionals (package != "single") (map mathcomp_ (lib.head (lib.splitList (lib.pred.equal package) packages)));
|
2022-10-21 18:38:19 +00:00
|
|
|
pkgpath = if package == "single" then "."
|
|
|
|
else if package == "analysis" then "theories" else "${package}";
|
|
|
|
pname = if package == "single" then "mathcomp-analysis-single"
|
|
|
|
else "mathcomp-${package}";
|
2022-09-30 11:47:45 +00:00
|
|
|
derivation = mkCoqDerivation ({
|
|
|
|
inherit version pname defaultVersion release repo owner;
|
|
|
|
|
|
|
|
namePrefix = [ "coq" "mathcomp" ];
|
|
|
|
|
|
|
|
propagatedBuildInputs =
|
2022-10-21 18:38:19 +00:00
|
|
|
intra-deps
|
2024-07-01 15:47:52 +00:00
|
|
|
++ lib.optionals (lib.elem package [ "classical" "single" ]) classical-deps
|
|
|
|
++ lib.optionals (lib.elem package [ "analysis" "single" ]) analysis-deps;
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
cd ${pkgpath}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Analysis library compatible with Mathematical Components";
|
2024-07-01 15:47:52 +00:00
|
|
|
maintainers = [ lib.maintainers.cohencyril ];
|
|
|
|
license = lib.licenses.cecill-c;
|
2022-09-30 11:47:45 +00:00
|
|
|
};
|
|
|
|
|
2024-07-01 15:47:52 +00:00
|
|
|
passthru = lib.genAttrs packages mathcomp_;
|
2022-09-30 11:47:45 +00:00
|
|
|
});
|
|
|
|
# split packages didn't exist before 0.6, so bulding nothing in that case
|
|
|
|
patched-derivation1 = derivation.overrideAttrs (o:
|
2024-07-01 15:47:52 +00:00
|
|
|
lib.optionalAttrs (o.pname != null && o.pname != "mathcomp-analysis" &&
|
|
|
|
o.version != null && o.version != "dev" && lib.versions.isLt "0.6" o.version)
|
2022-09-30 11:47:45 +00:00
|
|
|
{ preBuild = ""; buildPhase = "echo doing nothing"; installPhase = "echo doing nothing"; }
|
|
|
|
);
|
|
|
|
patched-derivation2 = patched-derivation1.overrideAttrs (o:
|
2024-07-01 15:47:52 +00:00
|
|
|
lib.optionalAttrs (o.pname != null && o.pname == "mathcomp-analysis" &&
|
|
|
|
o.version != null && o.version != "dev" && lib.versions.isLt "0.6" o.version)
|
2022-09-30 11:47:45 +00:00
|
|
|
{ preBuild = ""; }
|
|
|
|
);
|
|
|
|
patched-derivation = patched-derivation2.overrideAttrs (o:
|
2024-07-01 15:47:52 +00:00
|
|
|
lib.optionalAttrs (o.version != null
|
|
|
|
&& (o.version == "dev" || lib.versions.isGe "0.3.4" o.version))
|
2022-09-30 11:47:45 +00:00
|
|
|
{
|
|
|
|
propagatedBuildInputs = o.propagatedBuildInputs ++ [ hierarchy-builder ];
|
|
|
|
}
|
|
|
|
);
|
|
|
|
in patched-derivation;
|
|
|
|
in
|
2022-10-21 18:38:19 +00:00
|
|
|
mathcomp_ (if single then "single" else "analysis")
|