Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

147 lines
2.9 KiB
Nix

{
buildDunePackage,
lib,
cppo,
stdlib-shims,
ppx_yojson_conv_lib,
ocaml-syntax-shims,
jsonrpc,
omd,
octavius,
dune-build-info,
dune-rpc,
uutf,
dyn,
re,
stdune,
chrome-trace,
csexp,
result,
pp,
cmdliner,
ordering,
ocamlformat-rpc-lib,
ocaml,
version ?
if lib.versionAtLeast ocaml.version "5.3" then
"1.23.1"
else if lib.versionAtLeast ocaml.version "5.2" then
"1.21.0"
else if lib.versionAtLeast ocaml.version "4.14" then
"1.18.0"
else if lib.versionAtLeast ocaml.version "4.13" then
"1.10.5"
else if lib.versionAtLeast ocaml.version "4.12" then
"1.9.0"
else
"1.4.1",
}:
let
jsonrpc_v = jsonrpc.override {
inherit version;
};
in
buildDunePackage rec {
pname = "lsp";
inherit (jsonrpc_v) version src;
minimalOCamlVersion = 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 = lib.optionalString (lib.versionOlder version "1.10.4") ''
rm -r ocaml-lsp-server/vendor/{octavius,uutf,omd,cmdliner}
'';
buildInputs =
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
[
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
[
re
octavius
dune-build-info
omd
cmdliner
ocamlformat-rpc-lib
]
else
[
ppx_yojson_conv_lib
ocaml-syntax-shims
octavius
dune-build-info
omd
cmdliner
];
nativeBuildInputs = lib.optional (lib.versionOlder version "1.7.0") cppo;
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.override { version = "1.2.0"; })
ppx_yojson_conv_lib
result
uutf
]
else
[
csexp
jsonrpc
ppx_yojson_conv_lib
stdlib-shims
uutf
];
meta = jsonrpc.meta // {
description = "LSP protocol implementation in OCaml";
};
}