From f4914d4eb4e966d7dbb66f903de391fc921b5349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Zimmermann?= Date: Sun, 22 Oct 2017 19:49:16 +0200 Subject: [PATCH] bignums: init at various versions Bignums used to be part of the standard library of Coq. We provide a version for Coq 8.6, and one for Coq 8.7. --- .../coq-modules/bignums/default.nix | 38 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 39 insertions(+) create mode 100644 pkgs/development/coq-modules/bignums/default.nix diff --git a/pkgs/development/coq-modules/bignums/default.nix b/pkgs/development/coq-modules/bignums/default.nix new file mode 100644 index 000000000000..5762da66fedd --- /dev/null +++ b/pkgs/development/coq-modules/bignums/default.nix @@ -0,0 +1,38 @@ +{ stdenv, fetchFromGitHub, coq }: + +let rev_and_sha = { + "8.6" = { + rev = "v8.6.0"; + sha256 = "0553pcsy21cyhmns6k9qggzb67az8kl31d0lwlnz08bsqswigzrj"; + }; + "8.7" = { + rev = "V8.7.0"; + sha256 = "11c4sdmpd3l6jjl4v6k213z9fhrmmm1xnly3zmzam1wrrdif4ghl"; + }; +}; +in + +if ! (rev_and_sha ? "${coq.coq-version}") then + throw "bignums is not available for Coq ${coq.coq-version}" +else with rev_and_sha."${coq.coq-version}"; + +stdenv.mkDerivation rec { + + name = "coq${coq.coq-version}-bignums"; + + src = fetchFromGitHub { + owner = "coq"; + repo = "bignums"; + inherit rev sha256; + }; + + buildInputs = [ coq.ocaml coq.camlp5 coq.findlib coq ]; + + installFlags = "COQLIB=$(out)/lib/coq/${coq.coq-version}/"; + + meta = with stdenv.lib; { + license = licenses.lgpl2; + platforms = coq.meta.platforms; + }; + +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9226e15d63c5..3eb87bd64f18 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18630,6 +18630,7 @@ with pkgs; coqPackages = self; autosubst = callPackage ../development/coq-modules/autosubst {}; + bignums = callPackage ../development/coq-modules/bignums {}; coq-ext-lib = callPackage ../development/coq-modules/coq-ext-lib {}; coquelicot = callPackage ../development/coq-modules/coquelicot {}; dpdgraph = callPackage ../development/coq-modules/dpdgraph {};