summaryrefslogtreecommitdiff
path: root/pkgs/development/coq-modules/stdlib/default.nix
blob: eb1091ea642af10e9db01dcdc9c92b7911521d5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{
  coq,
  mkCoqDerivation,
  lib,
  version ? null,
}:

let
  derivation = mkCoqDerivation {

    pname = "stdlib";
    repo = "stdlib";
    owner = "coq";
    opam-name = "coq-stdlib";

    inherit version;
    defaultVersion =
      let
        case = case: out: { inherit case out; };
      in
      with lib.versions;
      lib.switch coq.coq-version [
        (case (isLe "9.1") "9.0.0")
        # the < 9.0 above is artificial as stdlib was included in Coq before
      ] null;
    releaseRev = v: "V${v}";

    release."9.0.0".sha256 = "sha256-2l7ak5Q/NbiNvUzIVXOniEneDXouBMNSSVFbD1Pf8cQ=";

    configurePhase = ''
      echo no configuration
    '';
    buildPhase = ''
      echo building nothing
    '';
    installPhase = ''
      echo installing nothing
      # Make an output directory rather than a file, so this is more friendly to buildEnv
      mkdir $out
    '';

    meta = {
      description = "Compatibility metapackage for Coq Stdlib library after the Rocq renaming";
      license = lib.licenses.lgpl21Only;
    };
  };
in
# this is just a wrapper for rocqPackages.stdlib for Rocq >= 9.0
if coq.rocqPackages ? stdlib then
  coq.rocqPackages.stdlib.override {
    inherit version;
    inherit (coq.rocqPackages) rocq-core;
  }
else
  derivation