Skip to content

Commit 9f128a2

Browse files
proux01vbgl
authored andcommitted
coqPackages.mathcomp-reals: init at 1.7.0
Following the package split in math-comp/analysis#1349
1 parent 3585030 commit 9f128a2

2 files changed

Lines changed: 27 additions & 6 deletions

File tree

pkgs/development/coq-modules/mathcomp-analysis/default.nix

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,25 @@ let
5151
] null;
5252

5353
# list of analysis packages sorted by dependency order
54-
packages = [ "classical" "analysis" ];
54+
packages = {
55+
"classical" = [];
56+
"reals" = [ "classical" ];
57+
"altreals" = [ "reals" ];
58+
"analysis" = [ "reals" ];
59+
"reals-stdlib" = [ "reals" ];
60+
"analysis-stdlib" = [ "analysis" "reals-stdlib" ];
61+
};
5562

5663
mathcomp_ = package: let
5764
classical-deps = [ mathcomp.algebra mathcomp-finmap ];
5865
analysis-deps = [ mathcomp.field mathcomp-bigenough ];
59-
intra-deps = lib.optionals (package != "single") (map mathcomp_ (lib.head (lib.splitList (lib.pred.equal package) packages)));
60-
pkgpath = if package == "single" then "."
61-
else if package == "analysis" then "theories" else "${package}";
66+
intra-deps = lib.optionals (package != "single") (map mathcomp_ packages.${package});
67+
pkgpath = lib.switch package [
68+
{ case = "single"; out = "."; }
69+
{ case = "analysis"; out = "theories"; }
70+
{ case = "reals-stdlib"; out = "reals_stdlib"; }
71+
{ case = "analysis-stdlib"; out = "analysis_stdlib"; }
72+
] package;
6273
pname = if package == "single" then "mathcomp-analysis-single"
6374
else "mathcomp-${package}";
6475
derivation = mkCoqDerivation ({
@@ -81,7 +92,7 @@ let
8192
license = lib.licenses.cecill-c;
8293
};
8394

84-
passthru = lib.genAttrs packages mathcomp_;
95+
passthru = lib.mapAttrs (package: deps: mathcomp_ package) packages;
8596
});
8697
# split packages didn't exist before 0.6, so bulding nothing in that case
8798
patched-derivation1 = derivation.overrideAttrs (o:
@@ -94,7 +105,13 @@ let
94105
o.version != null && o.version != "dev" && lib.versions.isLt "0.6" o.version)
95106
{ preBuild = ""; }
96107
);
97-
patched-derivation = patched-derivation2.overrideAttrs (o:
108+
# only packages classical and analysis existed before 1.7, so bulding nothing in that case
109+
patched-derivation3 = patched-derivation2.overrideAttrs (o:
110+
lib.optionalAttrs (o.pname != null && o.pname != "mathcomp-classical" && o.pname != "mathcomp-analysis" &&
111+
o.version != null && o.version != "dev" && lib.versions.isLt "1.7" o.version)
112+
{ preBuild = ""; buildPhase = "echo doing nothing"; installPhase = "echo doing nothing"; }
113+
);
114+
patched-derivation = patched-derivation3.overrideAttrs (o:
98115
lib.optionalAttrs (o.version != null
99116
&& (o.version == "dev" || lib.versions.isGe "0.3.4" o.version))
100117
{

pkgs/top-level/coq-packages.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,17 @@ let
9999
mathcomp-character = self.mathcomp.character;
100100
mathcomp-abel = callPackage ../development/coq-modules/mathcomp-abel {};
101101
mathcomp-algebra-tactics = callPackage ../development/coq-modules/mathcomp-algebra-tactics {};
102+
mathcomp-altreals = self.mathcomp-analysis.altreals;
102103
mathcomp-analysis = callPackage ../development/coq-modules/mathcomp-analysis {};
104+
mathcomp-analysis-stdlib = self.mathcomp-analysis.analysis-stdlib;
103105
mathcomp-apery = callPackage ../development/coq-modules/mathcomp-apery {};
104106
mathcomp-bigenough = callPackage ../development/coq-modules/mathcomp-bigenough {};
105107
mathcomp-classical = self.mathcomp-analysis.classical;
106108
mathcomp-finmap = callPackage ../development/coq-modules/mathcomp-finmap {};
107109
mathcomp-infotheo = callPackage ../development/coq-modules/mathcomp-infotheo {};
108110
mathcomp-real-closed = callPackage ../development/coq-modules/mathcomp-real-closed {};
111+
mathcomp-reals = self.mathcomp-analysis.reals;
112+
mathcomp-reals-stdlib = self.mathcomp-analysis.reals-stdlib;
109113
mathcomp-tarjan = callPackage ../development/coq-modules/mathcomp-tarjan {};
110114
mathcomp-word = callPackage ../development/coq-modules/mathcomp-word {};
111115
mathcomp-zify = callPackage ../development/coq-modules/mathcomp-zify {};

0 commit comments

Comments
 (0)