nixpkgs/pkgs/top-level/rocq-packages.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

95 lines
2.5 KiB
Nix
Raw Normal View History

2024-12-23 15:36:52 +01:00
{
lib,
stdenv,
fetchurl,
fetchzip,
callPackage,
newScope,
recurseIntoAttrs,
ocamlPackages_4_14,
fetchpatch,
makeWrapper,
}@args:
let
lib = import ../build-support/rocq/extra-lib.nix { inherit (args) lib; };
in
let
2024-12-23 15:36:52 +01:00
mkRocqPackages' =
self: rocq-core:
let
callPackage = self.callPackage;
in
{
inherit rocq-core lib;
rocqPackages = self // {
__attrsFailEvaluation = true;
recurseForDerivations = false;
};
metaFetch = import ../build-support/coq/meta-fetch/default.nix {
inherit
lib
stdenv
fetchzip
fetchurl
;
};
mkRocqDerivation = lib.makeOverridable (callPackage ../build-support/rocq { });
2025-01-16 13:06:49 +01:00
bignums = callPackage ../development/rocq-modules/bignums { };
2025-02-18 11:40:14 +01:00
rocq-elpi = callPackage ../development/rocq-modules/rocq-elpi { };
2024-12-23 15:36:52 +01:00
stdlib = callPackage ../development/rocq-modules/stdlib { };
filterPackages = doesFilter: if doesFilter then filterRocqPackages self else self;
};
filterRocqPackages =
set:
lib.listToAttrs (
lib.concatMap (
name:
let
v = set.${name} or null;
in
lib.optional (!v.meta.rocqFilter or false) (
lib.nameValuePair name (
if lib.isAttrs v && v.recurseForDerivations or false then filterRocqPackages v else v
)
)
2024-12-23 15:36:52 +01:00
) (lib.attrNames set)
);
mkRocq =
version:
callPackage ../applications/science/logic/rocq-core {
inherit
version
ocamlPackages_4_14
;
};
in
rec {
2024-12-23 15:36:52 +01:00
/*
The function `mkRocqPackages` takes as input a derivation for Rocq and produces
a set of libraries built with that specific Rocq. More libraries are known to
this function than what is compatible with that version of Rocq. Therefore,
libraries that are not known to be compatible are removed (filtered out) from
the resulting set. For meta-programming purposes (inspecting the derivations
2024-12-23 15:36:52 +01:00
rather than building the libraries) this filtering can be disabled by setting
a `dontFilter` attribute into the Rocq derivation.
*/
mkRocqPackages =
rocq-core:
let
self = lib.makeScope newScope (lib.flip mkRocqPackages' rocq-core);
in
self.filterPackages (!rocq-core.dontFilter or false);
2025-03-13 08:59:01 +01:00
rocq-core_9_0 = mkRocq "9.0";
2024-12-23 15:36:52 +01:00
rocqPackages_9_0 = mkRocqPackages rocq-core_9_0;
rocqPackages = recurseIntoAttrs rocqPackages_9_0;
rocq-core = rocqPackages.rocq-core;
}