summary refs log tree commit diff
path: root/pkgs/development/coq-modules/ssreflect/default.nix
blob: 1fcb7e2da8ae5c4069a69ed6a225b6879067a63f (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
{ stdenv, fetchFromGitHub, coq, ncurses, which
, graphviz, mathcomp, withDoc ? false
}:

stdenv.mkDerivation rec {
  name = "coq${coq.coq-version}-ssreflect-${version}";

  inherit (mathcomp) src version meta;

  nativeBuildInputs = stdenv.lib.optionals withDoc [ graphviz ];
  buildInputs = [ coq ncurses which ] ++ (with coq.ocamlPackages; [ ocaml findlib camlp5 ]);

  enableParallelBuilding = true;

  COQBIN = "${coq}/bin/";

  preBuild = ''
    patchShebangs etc/utils/ssrcoqdep || true
    cd mathcomp/ssreflect
  '';

  installPhase = ''
    make -f Makefile.coq COQLIB=$out/lib/coq/${coq.coq-version}/ install
  '';

  postInstall = stdenv.lib.optionalString withDoc ''
    mkdir -p $out/share/doc/coq/${coq.coq-version}/user-contrib/mathcomp/ssreflect/
    cp -r html $out/share/doc/coq/${coq.coq-version}/user-contrib/mathcomp/ssreflect/
  '';

  passthru.compatibleCoqVersions = mathcomp.compatibleCoqVersions;
}