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