coqPackages.mathcomp: 1.8.0 -> 1.9.0 and adding real-closed

This commit is contained in:
Cyril Cohen
2019-06-03 15:23:35 +00:00
committed by Vincent Laporte
parent ddaf94d804
commit 547466064e
3 changed files with 104 additions and 35 deletions
@@ -5,12 +5,14 @@ with builtins // stdenv.lib;
let
# sha256 of released mathcomp versions
mathcomp-sha256 = {
"1.9.0" = "0lid9zaazdi3d38l8042lczb02pw5m9wq0yysiilx891hgq2p81r";
"1.8.0" = "07l40is389ih8bi525gpqs3qp4yb2kl11r9c8ynk1ifpjzpnabwp";
"1.7.0" = "0wnhj9nqpx2bw6n1l4i8jgrw3pjajvckvj3lr4vzjb3my2lbxdd1";
"1.6.1" = "1ilw6vm4dlsdv9cd7kmf0vfrh2kkzr45wrqr8m37miy0byzr4p9i";
};
# versions of coq compatible with released mathcomp versions
mathcomp-coq-versions = {
"1.9.0" = flip elem ["8.7" "8.8" "8.9" "8.10"];
"1.8.0" = flip elem ["8.7" "8.8" "8.9"];
"1.7.0" = flip elem ["8.6" "8.7" "8.8" "8.9"];
"1.6.1" = flip elem ["8.5"];
@@ -56,20 +58,22 @@ let
echo "-I ." >> Make
echo "-R . mathcomp.all" >> Make
'';
is-released = builtins.isString mathcomp-version;
custom-version = if is-released then mathcomp-version else "custom";
# the base set of attributes for mathcomp
attrs = rec {
name = "coq${coq.coq-version}-${pkgname}-${mathcomp-version}";
name = "coq${coq.coq-version}-${pkgname}-${custom-version}";
# used in ssreflect
version = mathcomp-version;
version = custom-version;
src = fetchFromGitHub {
src = if is-released then fetchFromGitHub {
owner = "math-comp";
repo = "math-comp";
rev = "mathcomp-${mathcomp-version}";
sha256 = mathcomp-sha256.${mathcomp-version};
};
} else mathcomp-version;
nativeBuildInputs = optionals withDoc [ graphviz ];
buildInputs = [ ncurses which ] ++ (with coq.ocamlPackages; [ ocaml findlib camlp5 ]);
@@ -117,6 +121,7 @@ getAttrOr = a: n: a."${n}" or (throw a.error);
mathcompCorePkgs_1_7 = mathcompGen "1.7.0";
mathcompCorePkgs_1_8 = mathcompGen "1.8.0";
mathcompCorePkgs_1_9 = mathcompGen "1.9.0";
mathcompCorePkgs = recurseIntoAttrs
(mapDerivationAttrset dontDistribute (mathcompGen default-mathcomp-version));
@@ -126,6 +131,7 @@ in rec {
inherit mathcompGenSingle;
mathcomp_1_7_single = getAttrOr (mathcompGenSingle "1.7.0") "single";
mathcomp_1_8_single = getAttrOr (mathcompGenSingle "1.8.0") "single";
mathcomp_1_9_single = getAttrOr (mathcompGenSingle "1.9.0") "single";
mathcomp_single = dontDistribute
(getAttrOr (mathcompGenSingle default-mathcomp-version) "single");
@@ -133,15 +139,19 @@ mathcomp_single = dontDistribute
# generates an attribute set {ssreflect = <drv>; ... character = <drv>; all = <drv>;}.
# each of these have a special attribute overrideMathcomp which
# must be used instead of overrideAttrs in order to also fix the dependencies
inherit mathcompGen mathcompCorePkgs_1_7 mathcompCorePkgs_1_8 mathcompCorePkgs;
inherit mathcompGen mathcompCorePkgs
mathcompCorePkgs_1_7 mathcompCorePkgs_1_8 mathcompCorePkgs_1_9;
mathcomp = getAttrOr mathcompCorePkgs "all";
mathcomp_1_7 = getAttrOr mathcompCorePkgs_1_7 "all";
mathcomp_1_8 = getAttrOr mathcompCorePkgs_1_8 "all";
mathcomp = getAttrOr mathcompCorePkgs "all";
mathcomp_1_9 = getAttrOr mathcompCorePkgs_1_9 "all";
ssreflect = getAttrOr mathcompCorePkgs "ssreflect";
ssreflect = getAttrOr mathcompCorePkgs "ssreflect";
} //
(mapAttrs' (n: pkg: {name = "mathcomp-${n}"; value = pkg;}) mathcompCorePkgs) //
(mapAttrs' (n: pkg: {name = "mathcomp-${n}_1_7"; value = pkg;}) mathcompCorePkgs_1_7) //
(mapAttrs' (n: pkg: {name = "mathcomp-${n}_1_8"; value = pkg;}) mathcompCorePkgs_1_8)
(mapAttrs' (n: pkg: {name = "mathcomp-${n}_1_8"; value = pkg;}) mathcompCorePkgs_1_8) //
(mapAttrs' (n: pkg: {name = "mathcomp-${n}_1_9"; value = pkg;}) mathcompCorePkgs_1_9)