1 { lib, fetchzip, mkCoqDerivation, coq, version ? null }:
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";
18 (with lib; mkCoqDerivation {
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"; }
38 patches = [ ./janestreet-0.15.patch ];
40 propagatedBuildInputs =
41 with coq.ocamlPackages; [
43 findlib # run time dependency of SerAPI
51 zarith # needed because of Coq
56 dune install --prefix $out --libdir $OCAMLFIND_DESTDIR coq-serapi
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 ];
67 let inherit (o) version; in {
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
74 sha256 = release."${version}".sha256;
78 if version == "8.10.0+0.7.2"
82 else if version == "8.11.0+0.11.1"
86 else if version == "8.12.0+0.12.1" || version == "8.13.0+0.13.0"
90 else if version == "8.14.0+0.14.0" || version == "8.15.0+0.15.0"
92 ./janestreet-0.15.patch
94 else if version == "8.16.0+0.16.3" || version == "8.17.0+0.17.0"
96 ./janestreet-0.16.patch
101 propagatedBuildInputs = o.propagatedBuildInputs ++
102 lib.optional (version == "8.16.0+0.16.3" || version == "dev") coq.ocamlPackages.ppx_hash