@@ -0,0 +1,38 @@
1+{ stdenv, fetchFromGitHub, coq }:
2+
3+let rev_and_sha = {
4+ "8.6" = {
5+ rev = "v8.6.0";
6+ sha256 = "0553pcsy21cyhmns6k9qggzb67az8kl31d0lwlnz08bsqswigzrj";
7+ };
8+ "8.7" = {
9+ rev = "V8.7.0";
10+ sha256 = "11c4sdmpd3l6jjl4v6k213z9fhrmmm1xnly3zmzam1wrrdif4ghl";
11+ };
12+};
13+in
14+
15+if ! (rev_and_sha ? "${coq.coq-version}") then
16+ throw "bignums is not available for Coq ${coq.coq-version}"
17+else with rev_and_sha."${coq.coq-version}";
18+
19+stdenv.mkDerivation rec {
20+
21+ name = "coq${coq.coq-version}-bignums";
22+
23+ src = fetchFromGitHub {
24+ owner = "coq";
25+ repo = "bignums";
26+ inherit rev sha256;
27+ };
28+
29+ buildInputs = [ coq.ocaml coq.camlp5 coq.findlib coq ];
30+
31+ installFlags = "COQLIB=$(out)/lib/coq/${coq.coq-version}/";
32+
33+ meta = with stdenv.lib; {
34+ license = licenses.lgpl2;
35+ platforms = coq.meta.platforms;
36+ };
37+
38+}