2021-08-18 13:19:15 +00:00
|
|
|
{ lib, fetchzip, mkCoqDerivation, coq, version ? null }:
|
|
|
|
|
|
|
|
let
|
|
|
|
release = {
|
2024-06-20 14:57:18 +00:00
|
|
|
"8.19.0+0.19.3".sha256 = "sha256-QWRXBTcjtAGskZBeLIuX7WDE95KfH6SxV8MJSMx8B2Q=";
|
|
|
|
"8.18.0+0.18.3".sha256 = "sha256-3JGZCyn62LYJVpfXiwnSMxvdA2vQNTL7li2ZBPcjF0M=";
|
|
|
|
"8.17.0+0.17.3".sha256 = "sha256-XolzpJd8zs4LLyJO4eWvCiAJ0HJSGBJTGVSBClQRGnw=";
|
2023-03-04 12:14:45 +00:00
|
|
|
"8.16.0+0.16.3".sha256 = "sha256-22Kawp8jAsgyBTppwN5vmN7zEaB1QfPs0qKxd6x/7Uc=";
|
2022-01-27 00:19:43 +00:00
|
|
|
"8.15.0+0.15.0".sha256 = "1vh99ya2dq6a8xl2jrilgs0rpj4j227qx8zvzd2v5xylx0p4bbrp";
|
|
|
|
"8.14.0+0.14.0".sha256 = "1kh80yb791yl771qbqkvwhbhydfii23a7lql0jgifvllm2k8hd8d";
|
2021-10-14 00:43:12 +00:00
|
|
|
"8.13.0+0.13.0".sha256 = "0k69907xn4k61w4mkhwf8kh8drw9pijk9ynijsppihw98j8w38fy";
|
|
|
|
"8.12.0+0.12.1".sha256 = "048x3sgcq4h845hi6hm4j4dsfca8zfj70dm42w68n63qcm6xf9hn";
|
|
|
|
"8.11.0+0.11.1".sha256 = "1phmh99yqv71vlwklqgfxiq2vj99zrzxmryj2j4qvg5vav3y3y6c";
|
|
|
|
"8.10.0+0.7.2".sha256 = "1ljzm63hpd0ksvkyxcbh8rdf7p90vg91gb4h0zz0941v1zh40k8c";
|
2021-08-18 13:19:15 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
(with lib; mkCoqDerivation {
|
2021-08-18 13:19:15 +00:00
|
|
|
pname = "serapi";
|
|
|
|
inherit version release;
|
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
defaultVersion = with versions;
|
2023-02-02 18:25:31 +00:00
|
|
|
lib.switch coq.version [
|
2024-06-20 14:57:18 +00:00
|
|
|
{ case = isEq "8.19"; out = "8.19.0+0.19.3"; }
|
|
|
|
{ case = isEq "8.18"; out = "8.18.0+0.18.3"; }
|
|
|
|
{ case = isEq "8.17"; out = "8.17.0+0.17.3"; }
|
2023-03-04 12:14:45 +00:00
|
|
|
{ case = isEq "8.16"; out = "8.16.0+0.16.3"; }
|
2022-01-27 00:19:43 +00:00
|
|
|
{ case = isEq "8.15"; out = "8.15.0+0.15.0"; }
|
2021-12-19 01:06:50 +00:00
|
|
|
{ case = isEq "8.14"; out = "8.14.0+0.14.0"; }
|
2021-08-18 13:19:15 +00:00
|
|
|
{ case = isEq "8.13"; out = "8.13.0+0.13.0"; }
|
|
|
|
{ case = isEq "8.12"; out = "8.12.0+0.12.1"; }
|
|
|
|
{ case = isEq "8.11"; out = "8.11.0+0.11.1"; }
|
|
|
|
{ case = isEq "8.10"; out = "8.10.0+0.7.2"; }
|
|
|
|
] null;
|
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
useDune = true;
|
2021-08-18 13:19:15 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
patches = [ ./janestreet-0.15.patch ];
|
|
|
|
|
2021-08-18 13:19:15 +00:00
|
|
|
propagatedBuildInputs =
|
2022-01-27 00:19:43 +00:00
|
|
|
with coq.ocamlPackages; [
|
2021-08-18 13:19:15 +00:00
|
|
|
cmdliner
|
|
|
|
findlib # run time dependency of SerAPI
|
|
|
|
ppx_deriving
|
|
|
|
ppx_deriving_yojson
|
|
|
|
ppx_import
|
|
|
|
ppx_sexp_conv
|
2023-04-12 12:48:02 +00:00
|
|
|
ppx_hash
|
2021-08-18 13:19:15 +00:00
|
|
|
sexplib
|
|
|
|
yojson
|
|
|
|
zarith # needed because of Coq
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
dune install --prefix $out --libdir $OCAMLFIND_DESTDIR coq-serapi
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "https://github.com/ejgallego/coq-serapi";
|
2021-08-18 13:19:15 +00:00
|
|
|
description = "SerAPI is a library for machine-to-machine interaction with the Coq proof assistant";
|
|
|
|
license = licenses.lgpl21Plus;
|
2023-04-12 12:48:02 +00:00
|
|
|
maintainers = with maintainers; [ alizter Zimmi48 ];
|
2021-08-18 13:19:15 +00:00
|
|
|
};
|
|
|
|
}).overrideAttrs(o:
|
|
|
|
let inherit (o) version; in {
|
|
|
|
src = fetchzip {
|
2021-10-14 00:43:12 +00:00
|
|
|
url =
|
|
|
|
"https://github.com/ejgallego/coq-serapi/releases/download/${version}/coq-serapi-${
|
|
|
|
if version == "8.11.0+0.11.1" then version
|
|
|
|
else builtins.replaceStrings [ "+" ] [ "." ] version
|
|
|
|
}.tbz";
|
2021-08-18 13:19:15 +00:00
|
|
|
sha256 = release."${version}".sha256;
|
|
|
|
};
|
2021-10-28 06:52:43 +00:00
|
|
|
|
|
|
|
patches =
|
|
|
|
if version == "8.10.0+0.7.2"
|
|
|
|
then [
|
|
|
|
./8.10.0+0.7.2.patch
|
|
|
|
]
|
|
|
|
else if version == "8.11.0+0.11.1"
|
|
|
|
then [
|
|
|
|
./8.11.0+0.11.1.patch
|
|
|
|
]
|
|
|
|
else if version == "8.12.0+0.12.1" || version == "8.13.0+0.13.0"
|
|
|
|
then [
|
|
|
|
./8.12.0+0.12.1.patch
|
|
|
|
]
|
2022-09-30 11:47:45 +00:00
|
|
|
else if version == "8.14.0+0.14.0" || version == "8.15.0+0.15.0"
|
|
|
|
then [
|
2022-08-12 12:06:08 +00:00
|
|
|
./janestreet-0.15.patch
|
2022-09-30 11:47:45 +00:00
|
|
|
]
|
2023-10-09 19:29:22 +00:00
|
|
|
else if version == "8.16.0+0.16.3" || version == "8.17.0+0.17.0"
|
|
|
|
then [
|
|
|
|
./janestreet-0.16.patch
|
|
|
|
]
|
2022-09-30 11:47:45 +00:00
|
|
|
else [
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = o.propagatedBuildInputs ++
|
2023-03-04 12:14:45 +00:00
|
|
|
lib.optional (version == "8.16.0+0.16.3" || version == "dev") coq.ocamlPackages.ppx_hash
|
2022-09-30 11:47:45 +00:00
|
|
|
;
|
|
|
|
|
2021-08-18 13:19:15 +00:00
|
|
|
})
|