nixpkgs/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix
Rudi Grinberg f1132b0ff1 ocaml-lsp: 1.7.0 -> 1.8.3
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
2021-09-30 21:30:06 +02:00

59 lines
1.2 KiB
Nix

{ buildDunePackage
, lib
, cppo
, stdlib-shims
, ppx_yojson_conv_lib
, ocaml-syntax-shims
, jsonrpc
, omd
, octavius
, dune-build-info
, uutf
, re
, pp
, csexp
, cmdliner
, ocamlformat-rpc-lib
}:
buildDunePackage rec {
pname = "lsp";
inherit (jsonrpc) version src;
useDune2 = true;
minimumOCamlVersion =
if lib.versionAtLeast version "1.7.0" then
"4.12"
else
"4.06";
# 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 = ''
rm -r ocaml-lsp-server/vendor/{octavius,uutf,omd,cmdliner}
'';
buildInputs =
if lib.versionAtLeast version "1.7.0" then
[ pp re ppx_yojson_conv_lib octavius dune-build-info omd cmdliner ocamlformat-rpc-lib ]
else
[ cppo
ppx_yojson_conv_lib
ocaml-syntax-shims
octavius
dune-build-info
omd
cmdliner
];
propagatedBuildInputs = [
csexp
jsonrpc
uutf
] ++ lib.optional (lib.versionOlder version "1.7.0") stdlib-shims;
meta = jsonrpc.meta // {
description = "LSP protocol implementation in OCaml";
};
}