2021-03-23 19:22:30 +00:00
|
|
|
{ buildDunePackage
|
|
|
|
, stdlib-shims
|
|
|
|
, ppx_yojson_conv_lib
|
|
|
|
, ocaml-syntax-shims
|
|
|
|
, yojson
|
|
|
|
, result
|
2021-04-12 18:23:04 +00:00
|
|
|
, fetchurl
|
2021-03-23 19:22:30 +00:00
|
|
|
, lib
|
2021-04-12 18:23:04 +00:00
|
|
|
, ocaml
|
2021-03-23 19:22:30 +00:00
|
|
|
}:
|
|
|
|
|
2021-04-12 18:23:04 +00:00
|
|
|
let params =
|
2022-04-27 09:35:20 +00:00
|
|
|
if lib.versionAtLeast ocaml.version "4.14"
|
2021-04-12 18:23:04 +00:00
|
|
|
then {
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "1.11.3";
|
|
|
|
sha256 = "sha256-KlMFh05O04I0Xil2B+nL2hUxZw0jaDMUnI23oUwGyhs=";
|
|
|
|
} else if lib.versionAtLeast ocaml.version "4.13"
|
|
|
|
then {
|
|
|
|
version = "1.10.5";
|
|
|
|
sha256 = "sha256-TeJS6t1ruWhWPvWNatrnSUWI6T17XKiosHLYizBDDcw=";
|
2021-12-19 01:06:50 +00:00
|
|
|
} else if lib.versionAtLeast ocaml.version "4.12"
|
|
|
|
then {
|
|
|
|
version = "1.9.0";
|
|
|
|
sha256 = "sha256:1ac44n6g3rf84gvhcca545avgf9vpkwkkkm0s8ipshfhp4g4jikh";
|
2021-04-12 18:23:04 +00:00
|
|
|
} else {
|
|
|
|
version = "1.4.1";
|
|
|
|
sha256 = "1ssyazc0yrdng98cypwa9m3nzfisdzpp7hqnx684rqj8f0g3gs6f";
|
|
|
|
}
|
|
|
|
; in
|
2021-03-23 19:22:30 +00:00
|
|
|
|
|
|
|
buildDunePackage rec {
|
|
|
|
pname = "jsonrpc";
|
2021-04-12 18:23:04 +00:00
|
|
|
inherit (params) version;
|
|
|
|
src = fetchurl {
|
2021-03-23 19:22:30 +00:00
|
|
|
url = "https://github.com/ocaml/ocaml-lsp/releases/download/${version}/jsonrpc-${version}.tbz";
|
2021-04-12 18:23:04 +00:00
|
|
|
inherit (params) sha256;
|
2021-03-23 19:22:30 +00:00
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
duneVersion = if lib.versionAtLeast version "1.10.0" then "3" else "2";
|
2021-12-19 01:06:50 +00:00
|
|
|
minimalOCamlVersion = "4.06";
|
2021-03-23 19:22:30 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
buildInputs =
|
|
|
|
if lib.versionAtLeast version "1.7.0" then
|
|
|
|
[ ]
|
|
|
|
else
|
|
|
|
[ yojson stdlib-shims ocaml-syntax-shims ];
|
2021-04-12 18:23:04 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
propagatedBuildInputs =
|
|
|
|
if lib.versionAtLeast version "1.7.0" then
|
|
|
|
[ ]
|
|
|
|
else
|
|
|
|
[ ppx_yojson_conv_lib result ];
|
2021-03-23 19:22:30 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Jsonrpc protocol implementation in OCaml";
|
|
|
|
license = licenses.isc;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ symphorien marsam ];
|
|
|
|
};
|
|
|
|
}
|