2020-10-25 18:27:09 +00:00
|
|
|
{ buildDunePackage
|
|
|
|
, stdlib-shims
|
|
|
|
, ppx_yojson_conv_lib
|
|
|
|
, ocaml-syntax-shims
|
2020-12-17 04:20:00 +00:00
|
|
|
, yojson
|
|
|
|
, result
|
2020-10-25 18:27:09 +00:00
|
|
|
, omd
|
|
|
|
, octavius
|
|
|
|
, dune-build-info
|
|
|
|
, uutf
|
|
|
|
, csexp
|
|
|
|
, cmdliner
|
|
|
|
, fetchzip
|
|
|
|
, lib
|
|
|
|
}:
|
|
|
|
let
|
2021-03-17 04:20:00 +00:00
|
|
|
version = "1.4.1";
|
2020-10-25 18:27:09 +00:00
|
|
|
src = fetchzip {
|
2020-12-17 04:20:00 +00:00
|
|
|
url = "https://github.com/ocaml/ocaml-lsp/releases/download/${version}/jsonrpc-${version}.tbz";
|
2021-03-17 04:20:00 +00:00
|
|
|
sha256 = "0hzpw17qfhb0cxgwah1fv4k300r363dy1kv0977anl44dlanx1v5";
|
2020-10-25 18:27:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# unvendor some (not all) dependencies.
|
|
|
|
# They are vendored by upstream only because it is then easier to install
|
|
|
|
# ocaml-lsp without messing with your opam switch, but nix should prevent
|
|
|
|
# this type of problems without resorting to vendoring.
|
|
|
|
preBuild = ''
|
2020-12-17 04:20:00 +00:00
|
|
|
rm -r ocaml-lsp-server/vendor/{octavius,uutf,ocaml-syntax-shims,omd,cmdliner}
|
2020-10-25 18:27:09 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
stdlib-shims
|
|
|
|
ppx_yojson_conv_lib
|
|
|
|
ocaml-syntax-shims
|
|
|
|
octavius
|
|
|
|
uutf
|
|
|
|
csexp
|
|
|
|
dune-build-info
|
|
|
|
omd
|
|
|
|
cmdliner
|
2020-12-17 04:20:00 +00:00
|
|
|
jsonrpc
|
2020-10-25 18:27:09 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
lsp = buildDunePackage {
|
|
|
|
pname = "lsp";
|
|
|
|
inherit version src;
|
|
|
|
useDune2 = true;
|
|
|
|
minimumOCamlVersion = "4.06";
|
|
|
|
|
|
|
|
inherit buildInputs preBuild;
|
|
|
|
};
|
|
|
|
|
2020-12-17 04:20:00 +00:00
|
|
|
jsonrpc = buildDunePackage {
|
|
|
|
pname = "jsonrpc";
|
|
|
|
inherit version src;
|
|
|
|
useDune2 = true;
|
|
|
|
minimumOCamlVersion = "4.06";
|
|
|
|
|
|
|
|
buildInputs = [ yojson stdlib-shims ocaml-syntax-shims ppx_yojson_conv_lib result ];
|
|
|
|
};
|
|
|
|
|
2020-10-25 18:27:09 +00:00
|
|
|
in
|
|
|
|
buildDunePackage {
|
|
|
|
pname = "ocaml-lsp-server";
|
|
|
|
inherit version src;
|
|
|
|
useDune2 = true;
|
|
|
|
|
|
|
|
inherit preBuild;
|
|
|
|
|
|
|
|
buildInputs = buildInputs ++ [ lsp ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "OCaml Language Server Protocol implementation";
|
|
|
|
license = lib.licenses.isc;
|
|
|
|
platforms = platforms.unix;
|
2021-03-17 04:20:00 +00:00
|
|
|
maintainers = [ maintainers.symphorien maintainers.marsam ];
|
2020-10-25 18:27:09 +00:00
|
|
|
};
|
|
|
|
}
|