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
|
2023-05-24 13:37:59 +00:00
|
|
|
, result
|
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;
|
2023-05-24 13:37:59 +00:00
|
|
|
duneVersion = "3";
|
2023-02-16 17:41:37 +00:00
|
|
|
minimalOCamlVersion =
|
2021-09-18 10:52:07 +00:00
|
|
|
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
|
|
|
[
|
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
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
nativeBuildInputs = lib.optional (lib.versionOlder version "1.7.0") cppo;
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
propagatedBuildInputs =
|
|
|
|
if lib.versionAtLeast version "1.14.0" then [
|
|
|
|
jsonrpc
|
|
|
|
ppx_yojson_conv_lib
|
|
|
|
uutf
|
|
|
|
] else if lib.versionAtLeast version "1.10.0" then [
|
|
|
|
dyn
|
|
|
|
jsonrpc
|
|
|
|
ordering
|
|
|
|
ppx_yojson_conv_lib
|
|
|
|
stdune
|
|
|
|
uutf
|
|
|
|
] else if lib.versionAtLeast version "1.7.0" then [
|
|
|
|
csexp
|
|
|
|
jsonrpc
|
|
|
|
pp
|
|
|
|
ppx_yojson_conv_lib
|
|
|
|
result
|
|
|
|
uutf
|
|
|
|
] else [
|
|
|
|
csexp
|
|
|
|
jsonrpc
|
|
|
|
ppx_yojson_conv_lib
|
|
|
|
stdlib-shims
|
|
|
|
uutf
|
|
|
|
];
|
2021-03-23 19:22:30 +00:00
|
|
|
|
|
|
|
meta = jsonrpc.meta // {
|
|
|
|
description = "LSP protocol implementation in OCaml";
|
|
|
|
};
|
|
|
|
}
|