|
51 | 51 | ] null; |
52 | 52 |
|
53 | 53 | # 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 | + }; |
55 | 62 |
|
56 | 63 | mathcomp_ = package: let |
57 | 64 | classical-deps = [ mathcomp.algebra mathcomp-finmap ]; |
58 | 65 | 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; |
62 | 73 | pname = if package == "single" then "mathcomp-analysis-single" |
63 | 74 | else "mathcomp-${package}"; |
64 | 75 | derivation = mkCoqDerivation ({ |
|
81 | 92 | license = lib.licenses.cecill-c; |
82 | 93 | }; |
83 | 94 |
|
84 | | - passthru = lib.genAttrs packages mathcomp_; |
| 95 | + passthru = lib.mapAttrs (package: deps: mathcomp_ package) packages; |
85 | 96 | }); |
86 | 97 | # split packages didn't exist before 0.6, so bulding nothing in that case |
87 | 98 | patched-derivation1 = derivation.overrideAttrs (o: |
|
94 | 105 | o.version != null && o.version != "dev" && lib.versions.isLt "0.6" o.version) |
95 | 106 | { preBuild = ""; } |
96 | 107 | ); |
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: |
98 | 115 | lib.optionalAttrs (o.version != null |
99 | 116 | && (o.version == "dev" || lib.versions.isGe "0.3.4" o.version)) |
100 | 117 | { |
|
0 commit comments