summary refs log tree commit diff
path: root/pkgs/development/coq-modules/coqprime/default.nix
blob: 6228bd4be9d09e19fe381b21d871fcf3b65b888f (plain) (blame)
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
{ stdenv, fetchFromGitHub, coq, bignums }:

let params =
  let v_8_8 = {
      version = "8.8";
      sha256 = "075yjczk79pf1hd3lgdjiz84ilkzfxjh18lgzrhhqp7d3kz5lxp5";
    };
  in
  {
    "8.7" = {
      version = "8.7.2";
      sha256 = "15zlcrx06qqxjy3nhh22wzy0rb4npc8l4nx2bbsfsvrisbq1qb7k";
    };
    "8.8" = v_8_8;
    "8.9" = v_8_8;
    "8.10" = v_8_8;
    };
  param = params.${coq.coq-version}
; in

stdenv.mkDerivation rec {

  inherit (param) version;
  name = "coq${coq.coq-version}-coqprime-${version}";

  src = fetchFromGitHub {
    owner = "thery";
    repo = "coqprime";
    rev = "v${version}";
    inherit (param) sha256;
  };

  buildInputs = [ coq ];

  propagatedBuildInputs = [ bignums ];

  installFlags = "COQLIB=$(out)/lib/coq/${coq.coq-version}/";

  meta = with stdenv.lib; {
    description = "Library to certify primality using Pocklington certificate and Elliptic Curve Certificate";
    license = licenses.lgpl21;
    maintainers = [ stdenv.lib.maintainers.vbgl ];
    inherit (coq.meta) platforms;
    inherit (src.meta) homepage;
  };

  passthru = {
    compatibleCoqVersions = v: builtins.hasAttr v params;
  };
}