2021-03-21 19:04:26 +01:00
|
|
|
{ buildDunePackage
|
2021-08-07 14:00:00 +02:00
|
|
|
, lib
|
2021-07-21 10:11:00 +02:00
|
|
|
, cppo
|
2021-03-21 19:04:26 +01:00
|
|
|
, stdlib-shims
|
|
|
|
, ppx_yojson_conv_lib
|
|
|
|
, ocaml-syntax-shims
|
|
|
|
, jsonrpc
|
|
|
|
, omd
|
|
|
|
, octavius
|
|
|
|
, dune-build-info
|
2022-04-24 14:00:00 +02:00
|
|
|
, dune-rpc
|
2021-03-21 19:04:26 +01:00
|
|
|
, uutf
|
2022-04-24 14:00:00 +02:00
|
|
|
, dyn
|
2021-08-30 10:36:27 +02:00
|
|
|
, re
|
2022-04-24 14:00:00 +02:00
|
|
|
, stdune
|
|
|
|
, dune_3
|
2021-03-21 19:04:26 +01:00
|
|
|
, csexp
|
2022-04-24 14:00:00 +02:00
|
|
|
, pp
|
2021-03-21 19:04:26 +01:00
|
|
|
, cmdliner
|
2022-04-24 14:00:00 +02:00
|
|
|
, ordering
|
2021-09-29 17:44:25 +02:00
|
|
|
, ocamlformat-rpc-lib
|
2021-03-21 19:04:26 +01:00
|
|
|
}:
|
|
|
|
|
2021-08-30 10:28:10 +02:00
|
|
|
buildDunePackage rec {
|
2021-03-21 19:04:26 +01:00
|
|
|
pname = "lsp";
|
|
|
|
inherit (jsonrpc) version src;
|
2022-04-24 14:00:00 +02:00
|
|
|
duneVersion = if lib.versionAtLeast version "1.10.0" then "3" else "2";
|
2021-08-30 10:28:10 +02:00
|
|
|
minimumOCamlVersion =
|
|
|
|
if lib.versionAtLeast version "1.7.0" then
|
|
|
|
"4.12"
|
|
|
|
else
|
|
|
|
"4.06";
|
2021-03-21 19:04:26 +01: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.
|
2022-04-24 14:00:00 +02:00
|
|
|
preBuild = lib.optionalString (lib.versionOlder version "1.10.4") ''
|
2021-08-07 14:00:00 +02:00
|
|
|
rm -r ocaml-lsp-server/vendor/{octavius,uutf,omd,cmdliner}
|
2021-03-21 19:04:26 +01:00
|
|
|
'';
|
|
|
|
|
2021-08-30 10:36:27 +02:00
|
|
|
buildInputs =
|
2022-04-24 14:00:00 +02:00
|
|
|
if lib.versionAtLeast version "1.10.0" then
|
|
|
|
[
|
|
|
|
pp
|
|
|
|
re
|
|
|
|
ppx_yojson_conv_lib
|
|
|
|
octavius
|
|
|
|
dune-build-info
|
|
|
|
dune-rpc
|
|
|
|
omd
|
|
|
|
cmdliner
|
|
|
|
ocamlformat-rpc-lib
|
|
|
|
dyn
|
|
|
|
stdune
|
|
|
|
]
|
|
|
|
else if lib.versionAtLeast version "1.7.0" then
|
2021-09-29 17:44:25 +02:00
|
|
|
[ pp re ppx_yojson_conv_lib octavius dune-build-info omd cmdliner ocamlformat-rpc-lib ]
|
2021-08-30 10:36:27 +02:00
|
|
|
else
|
2022-04-24 14:00:00 +02:00
|
|
|
[
|
|
|
|
cppo
|
2021-08-30 10:36:27 +02:00
|
|
|
ppx_yojson_conv_lib
|
|
|
|
ocaml-syntax-shims
|
|
|
|
octavius
|
|
|
|
dune-build-info
|
|
|
|
omd
|
|
|
|
cmdliner
|
|
|
|
];
|
2021-07-21 10:11:00 +02:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
csexp
|
2021-03-21 19:04:26 +01:00
|
|
|
jsonrpc
|
2021-07-21 10:11:00 +02:00
|
|
|
uutf
|
2021-08-30 10:36:27 +02:00
|
|
|
] ++ lib.optional (lib.versionOlder version "1.7.0") stdlib-shims;
|
2021-03-21 19:04:26 +01:00
|
|
|
|
|
|
|
meta = jsonrpc.meta // {
|
|
|
|
description = "LSP protocol implementation in OCaml";
|
|
|
|
};
|
|
|
|
}
|