about summary refs log tree commit diff
path: root/pkgs/development/coq-modules/coq-ext-lib/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/coq-modules/coq-ext-lib/default.nix')
-rw-r--r--pkgs/development/coq-modules/coq-ext-lib/default.nix84
1 files changed, 25 insertions, 59 deletions
diff --git a/pkgs/development/coq-modules/coq-ext-lib/default.nix b/pkgs/development/coq-modules/coq-ext-lib/default.nix
index e0ca52086206b..8acb0643781da 100644
--- a/pkgs/development/coq-modules/coq-ext-lib/default.nix
+++ b/pkgs/development/coq-modules/coq-ext-lib/default.nix
@@ -1,63 +1,29 @@
-{ stdenv, fetchFromGitHub, coq, ...}@args:
-
-let
-  hashes = {
-    "0.9.4" = "1y66pamgsdxlq2w1338lj626ln70cwj7k53hxcp933g8fdsa4hp0";
-    "0.9.5" = "1b4cvz3llxin130g13calw5n1zmvi6wdd5yb8a41q7yyn2hd3msg";
-    "0.9.7" = "00v4bm4glv1hy08c8xsm467az6d1ashrznn8p2bmbmmp52lfg7ag";
-    "0.10.0" = "1kxi5bmjwi5zqlqgkyzhhxwgcih7wf60cyw9398k2qjkmi186r4a";
-    "0.10.1" = "0r1vspad8fb8bry3zliiz4hfj4w1iib1l2gm115a94m6zbiksd95";
-    "0.10.2" = "1b150rc5bmz9l518r4m3vwcrcnnkkn9q5lrwygkh0a7mckgg2k9f";
-    "0.10.3" = "0795gs2dlr663z826mp63c8h2zfadn541dr8q0fvnvi2z7kfyslb";
-    "0.11.1" = "0dmf1p9j8lm0hwaq0af18jxdwg869xi2jm8447zng7krrq3kvkg5";
-    "0.11.2" = "0iyka81g26x5n99xic7kqn8vxqjw8rz7vw9rs27iw04lf137vzv6";
-    "0.11.3" = "1w99nzpk72lffxis97k235axss5lmzhy5z3lga2i0si95mbpil42";
-  };
-
-  default-versions = {
-    "8.5" = "0.9.4";
-    "8.6" = "0.9.5";
-    "8.7" = "0.9.7";
-    "8.8" = "0.11.3";
-    "8.9" = "0.11.3";
-    "8.10" = "0.11.3";
-    "8.11" = "0.11.3";
-    "8.12" = "0.11.3";
-  };
-
-  param = rec {
-    version = args.version or default-versions.${coq.coq-version};
-    sha256 = hashes.${version};
-  };
-
-in
-
-stdenv.mkDerivation rec {
-
-  name = "coq${coq.coq-version}-coq-ext-lib-${version}";
-  inherit (param) version;
-
-  src = fetchFromGitHub {
-    owner = "coq-community";
-    repo = "coq-ext-lib";
-    rev = "v${version}";
-    inherit (param) sha256;
-  };
-
-  buildInputs = [ coq ];
-
-  enableParallelBuilding = true;
-
-  installFlags = [ "COQLIB=$(out)/lib/coq/${coq.coq-version}/" ];
-
-  meta = with stdenv.lib; {
-    homepage = "https://github.com/coq-ext-lib/coq-ext-lib";
+{ lib, mkCoqDerivation, coq, version ? null }:
+
+with lib; mkCoqDerivation rec {
+  pname = "coq-ext-lib";
+  owner = "coq-ext-lib";
+  inherit version;
+  defaultVersion = with versions; switch coq.coq-version [
+    { case = range "8.8" "8.12"; out = "0.11.3"; }
+    { case = "8.7";              out = "0.9.7"; }
+    { case = "8.6";              out = "0.9.5"; }
+    { case = "8.5";              out = "0.9.4"; }
+  ] null;
+  release."0.11.3".sha256 = "1w99nzpk72lffxis97k235axss5lmzhy5z3lga2i0si95mbpil42";
+  release."0.11.2".sha256 = "0iyka81g26x5n99xic7kqn8vxqjw8rz7vw9rs27iw04lf137vzv6";
+  release."0.10.3".sha256 = "0795gs2dlr663z826mp63c8h2zfadn541dr8q0fvnvi2z7kfyslb";
+  release."0.11.1".sha256 = "0dmf1p9j8lm0hwaq0af18jxdwg869xi2jm8447zng7krrq3kvkg5";
+  release."0.10.2".sha256 = "1b150rc5bmz9l518r4m3vwcrcnnkkn9q5lrwygkh0a7mckgg2k9f";
+  release."0.10.1".sha256 = "0r1vspad8fb8bry3zliiz4hfj4w1iib1l2gm115a94m6zbiksd95";
+  release."0.10.0".sha256 = "1kxi5bmjwi5zqlqgkyzhhxwgcih7wf60cyw9398k2qjkmi186r4a";
+  release."0.9.7".sha256  = "00v4bm4glv1hy08c8xsm467az6d1ashrznn8p2bmbmmp52lfg7ag";
+  release."0.9.5".sha256  = "1b4cvz3llxin130g13calw5n1zmvi6wdd5yb8a41q7yyn2hd3msg";
+  release."0.9.4".sha256  = "1y66pamgsdxlq2w1338lj626ln70cwj7k53hxcp933g8fdsa4hp0";
+  releaseRev = v: "v${v}";
+
+  meta = {
     description = "A collection of theories and plugins that may be useful in other Coq developments";
     maintainers = with maintainers; [ jwiegley ptival ];
-    platforms = coq.meta.platforms;
-  };
-
-  passthru = {
-    compatibleCoqVersions = v: builtins.hasAttr v default-versions;
   };
 }