mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-23 22:23:15 +00:00
f1132b0ff1
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
53 lines
1.1 KiB
Nix
53 lines
1.1 KiB
Nix
{ buildDunePackage
|
|
, stdlib-shims
|
|
, ppx_yojson_conv_lib
|
|
, ocaml-syntax-shims
|
|
, yojson
|
|
, result
|
|
, fetchurl
|
|
, lib
|
|
, ocaml
|
|
}:
|
|
|
|
let params =
|
|
if lib.versionAtLeast ocaml.version "4.12"
|
|
then {
|
|
version = "1.8.3";
|
|
sha256 = "sha256-WO9ap78XZxJCi04LEBX+r21nfL2UdPiCLRMrJSI7FOk=";
|
|
} else {
|
|
version = "1.4.1";
|
|
sha256 = "1ssyazc0yrdng98cypwa9m3nzfisdzpp7hqnx684rqj8f0g3gs6f";
|
|
}
|
|
; in
|
|
|
|
buildDunePackage rec {
|
|
pname = "jsonrpc";
|
|
inherit (params) version;
|
|
src = fetchurl {
|
|
url = "https://github.com/ocaml/ocaml-lsp/releases/download/${version}/jsonrpc-${version}.tbz";
|
|
inherit (params) sha256;
|
|
};
|
|
|
|
useDune2 = true;
|
|
minimumOCamlVersion = "4.06";
|
|
|
|
buildInputs =
|
|
if lib.versionAtLeast version "1.7.0" then
|
|
[ ]
|
|
else
|
|
[ yojson stdlib-shims ocaml-syntax-shims ];
|
|
|
|
propagatedBuildInputs =
|
|
if lib.versionAtLeast version "1.7.0" then
|
|
[ ]
|
|
else
|
|
[ ppx_yojson_conv_lib result ];
|
|
|
|
meta = with lib; {
|
|
description = "Jsonrpc protocol implementation in OCaml";
|
|
license = licenses.isc;
|
|
platforms = platforms.unix;
|
|
maintainers = with maintainers; [ symphorien marsam ];
|
|
};
|
|
}
|