biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / development / coq-modules / serapi / default.nix
blobf48cce55d4dc22f94e206ac8fc0489578d970247
1 { lib, fetchzip, mkCoqDerivation, coq, version ? null }:
3 let
4   release = {
5     "8.19.0+0.19.0".sha256 = "sha256-M9d0ne2veTjf8/mFIDwtWdHi64JXjwCPWupnO2Ztd/Y=";
6     "8.18.0+0.18.0".sha256 = "sha256-c+3yG9vcbek/uvQ27OOQGqqsIHU1VuQhQvNVOjfucbo=";
7     "8.17.0+0.17.0".sha256 = "sha256-I81qvaXpJfXcbFw8vyzYLzlnhPg1QD0lTqAFXhoZ0rI=";
8     "8.16.0+0.16.3".sha256 = "sha256-22Kawp8jAsgyBTppwN5vmN7zEaB1QfPs0qKxd6x/7Uc=";
9     "8.15.0+0.15.0".sha256 = "1vh99ya2dq6a8xl2jrilgs0rpj4j227qx8zvzd2v5xylx0p4bbrp";
10     "8.14.0+0.14.0".sha256 = "1kh80yb791yl771qbqkvwhbhydfii23a7lql0jgifvllm2k8hd8d";
11     "8.13.0+0.13.0".sha256 = "0k69907xn4k61w4mkhwf8kh8drw9pijk9ynijsppihw98j8w38fy";
12     "8.12.0+0.12.1".sha256 = "048x3sgcq4h845hi6hm4j4dsfca8zfj70dm42w68n63qcm6xf9hn";
13     "8.11.0+0.11.1".sha256 = "1phmh99yqv71vlwklqgfxiq2vj99zrzxmryj2j4qvg5vav3y3y6c";
14     "8.10.0+0.7.2".sha256  = "1ljzm63hpd0ksvkyxcbh8rdf7p90vg91gb4h0zz0941v1zh40k8c";
15   };
18 (with lib; mkCoqDerivation {
19   pname = "serapi";
20   inherit version release;
22   defaultVersion =  with versions;
23     lib.switch coq.version [
24       { case = isEq "8.19"; out = "8.19.0+0.19.0"; }
25       { case = isEq "8.18"; out = "8.18.0+0.18.0"; }
26       { case = isEq "8.17"; out = "8.17.0+0.17.0"; }
27       { case = isEq "8.16"; out = "8.16.0+0.16.3"; }
28       { case = isEq "8.15"; out = "8.15.0+0.15.0"; }
29       { case = isEq "8.14"; out = "8.14.0+0.14.0"; }
30       { case = isEq "8.13"; out = "8.13.0+0.13.0"; }
31       { case = isEq "8.12"; out = "8.12.0+0.12.1"; }
32       { case = isEq "8.11"; out = "8.11.0+0.11.1"; }
33       { case = isEq "8.10"; out = "8.10.0+0.7.2";  }
34     ] null;
36   useDune = true;
38   patches = [ ./janestreet-0.15.patch ];
40   propagatedBuildInputs =
41     with coq.ocamlPackages; [
42       cmdliner
43       findlib # run time dependency of SerAPI
44       ppx_deriving
45       ppx_deriving_yojson
46       ppx_import
47       ppx_sexp_conv
48       ppx_hash
49       sexplib
50       yojson
51       zarith # needed because of Coq
52     ];
54   installPhase = ''
55     runHook preInstall
56     dune install --prefix $out --libdir $OCAMLFIND_DESTDIR coq-serapi
57     runHook postInstall
58   '';
60   meta = with lib; {
61     homepage = "https://github.com/ejgallego/coq-serapi";
62     description = "SerAPI is a library for machine-to-machine interaction with the Coq proof assistant";
63     license = licenses.lgpl21Plus;
64     maintainers = with maintainers; [ alizter Zimmi48 ];
65   };
66 }).overrideAttrs(o:
67   let inherit (o) version; in {
68   src = fetchzip {
69     url =
70         "https://github.com/ejgallego/coq-serapi/releases/download/${version}/coq-serapi-${
71           if version == "8.11.0+0.11.1" then version
72           else builtins.replaceStrings [ "+" ] [ "." ] version
73         }.tbz";
74     sha256 = release."${version}".sha256;
75   };
77   patches =
78     if version == "8.10.0+0.7.2"
79     then [
80       ./8.10.0+0.7.2.patch
81     ]
82     else if version == "8.11.0+0.11.1"
83     then [
84       ./8.11.0+0.11.1.patch
85     ]
86     else if version == "8.12.0+0.12.1" || version == "8.13.0+0.13.0"
87     then [
88       ./8.12.0+0.12.1.patch
89     ]
90     else if version == "8.14.0+0.14.0" || version == "8.15.0+0.15.0"
91     then [
92       ./janestreet-0.15.patch
93     ]
94     else if version == "8.16.0+0.16.3" || version == "8.17.0+0.17.0"
95     then [
96       ./janestreet-0.16.patch
97     ]
98     else [
99     ];
101     propagatedBuildInputs = o.propagatedBuildInputs ++
102       lib.optional (version == "8.16.0+0.16.3" || version == "dev") coq.ocamlPackages.ppx_hash
103     ;