Skip to content

Commit

Permalink
Add rocqPackages.bignums
Browse files Browse the repository at this point in the history
  • Loading branch information
proux01 committed Jan 29, 2025
1 parent b48fc50 commit 1baece1
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 2 deletions.
23 changes: 21 additions & 2 deletions pkgs/development/coq-modules/bignums/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
lib,
mkCoqDerivation,
coq,
rocqPackages,
stdlib,
version ? null,
}:

mkCoqDerivation {
(mkCoqDerivation {
pname = "bignums";
owner = "coq";
inherit version;
Expand Down Expand Up @@ -58,4 +59,22 @@ mkCoqDerivation {
meta = {
license = lib.licenses.lgpl2;
};
}
}).overrideAttrs
(
o:
# this is just a wrapper for rocPackages.bignums for Rocq >= 9.0
lib.optionalAttrs (coq.version != null && (coq.version == "dev"
|| lib.versions.isGe "9.0" coq.version)) {
configurePhase = ''
echo no configuration
'';
buildPhase = ''
echo building nothing
'';
installPhase = ''
echo installing nothing
'';
propagatedBuildInputs = o.propagatedBuildInputs
++ [ rocqPackages.bignums ];
}
)
32 changes: 32 additions & 0 deletions pkgs/development/rocq-modules/bignums/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
lib,
mkRocqDerivation,
rocq-core,
stdlib,
version ? null,
}:

mkRocqDerivation {
pname = "bignums";
owner = "coq";
inherit version;
defaultVersion =
with lib.versions;
lib.switch rocq-core.rocq-version [
{
case = range "9.0" "9.0";
out = "9.0.0+rocq${rocq-core.rocq-version}";
}
] null;

release."9.0.0+rocq9.0".sha256 = "sha256-ctnwpyNVhryEUA5YEsAImrcJsNMhtBgDSOz+z5Z4R78=";
releaseRev = v: "${if lib.versions.isGe "9.0" v then "v" else "V"}${v}";

mlPlugin = true;

propagatedBuildInputs = [ stdlib ];

meta = {
license = lib.licenses.lgpl2;
};
}
1 change: 1 addition & 0 deletions pkgs/top-level/rocq-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ let
{inherit lib stdenv fetchzip fetchurl; };
mkRocqDerivation = lib.makeOverridable (callPackage ../build-support/rocq {});

bignums = callPackage ../development/rocq-modules/bignums {};
stdlib = callPackage ../development/rocq-modules/stdlib {};

filterPackages = doesFilter: if doesFilter then filterRocqPackages self else self;
Expand Down

0 comments on commit 1baece1

Please sign in to comment.