25 if lib.versionAtLeast ocaml.version "5.02" then
27 else if lib.versionAtLeast ocaml.version "4.14" then
29 else if lib.versionAtLeast ocaml.version "4.13" then
31 else if lib.versionAtLeast ocaml.version "4.12" then
37 let jsonrpc_v = jsonrpc.override {
40 buildDunePackage rec {
42 inherit (jsonrpc_v) version src;
44 if lib.versionAtLeast version "1.7.0" then
49 # unvendor some (not all) dependencies.
50 # They are vendored by upstream only because it is then easier to install
51 # ocaml-lsp without messing with your opam switch, but nix should prevent
52 # this type of problems without resorting to vendoring.
53 preBuild = lib.optionalString (lib.versionOlder version "1.10.4") ''
54 rm -r ocaml-lsp-server/vendor/{octavius,uutf,omd,cmdliner}
58 if lib.versionAtLeast version "1.12.0" then
73 else if lib.versionAtLeast version "1.10.0" then
87 else if lib.versionAtLeast version "1.7.0" then
88 [ re octavius dune-build-info omd cmdliner ocamlformat-rpc-lib ]
99 nativeBuildInputs = lib.optional (lib.versionOlder version "1.7.0") cppo;
101 propagatedBuildInputs =
102 if lib.versionAtLeast version "1.14.0" then [
106 ] else if lib.versionAtLeast version "1.10.0" then [
113 ] else if lib.versionAtLeast version "1.7.0" then [
116 (pp.override { version = "1.2.0"; })
128 meta = jsonrpc.meta // {
129 description = "LSP protocol implementation in OCaml";