diff --git a/pkgs/development/ocaml-modules/ocaml-lsp/default.nix b/pkgs/development/ocaml-modules/ocaml-lsp/default.nix index a8178c6ef717..9e512e35f304 100644 --- a/pkgs/development/ocaml-modules/ocaml-lsp/default.nix +++ b/pkgs/development/ocaml-modules/ocaml-lsp/default.nix @@ -1,4 +1,5 @@ { lib +, ocaml , buildDunePackage , lsp , xdg @@ -11,18 +12,30 @@ , merlin-lib , astring , camlp-streams +, base }: +# Freeze ocaml-lsp-version at 1.17.0 for OCaml 5.0 +# for which merlin 4.16 is not available +let lsp_v = + if lib.versions.majorMinor ocaml.version == "5.0" + then lsp.override { version = "1.17.0"; } + else lsp +; in + +let lsp = lsp_v; in + buildDunePackage rec { pname = "ocaml-lsp-server"; inherit (lsp) version src preBuild; - duneVersion = "3"; buildInputs = lsp.buildInputs ++ [ lsp re ] ++ lib.optional (lib.versionAtLeast version "1.9") spawn ++ lib.optionals (lib.versionAtLeast version "1.10") [ fiber xdg ] ++ lib.optional (lib.versionAtLeast version "1.14.2") ocamlc-loc - ++ lib.optionals (lib.versionAtLeast version "1.17.0") [ astring camlp-streams merlin-lib ]; + ++ lib.optionals (lib.versionAtLeast version "1.17.0") [ astring camlp-streams merlin-lib ] + ++ lib.optional (lib.versionAtLeast version "1.18.0") base + ; nativeBuildInputs = [ makeWrapper ]; diff --git a/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix b/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix index aee22a26bd18..f2b650137e79 100644 --- a/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix +++ b/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix @@ -9,7 +9,7 @@ , ocaml , version ? if lib.versionAtLeast ocaml.version "4.14" then - "1.17.0" + "1.18.0" else if lib.versionAtLeast ocaml.version "4.13" then "1.10.5" else if lib.versionAtLeast ocaml.version "4.12" then @@ -19,6 +19,11 @@ }: let params = { + "1.18.0" = { + name = "lsp"; + minimalOCamlVersion = "4.14"; + sha256 = "sha256-tZ2kPM/S/9J3yeX2laDjnHLA144b8svy9iwae32nXwM="; + }; "1.17.0" = { name = "lsp"; minimalOCamlVersion = "4.14"; @@ -54,7 +59,6 @@ buildDunePackage rec { inherit (params) sha256; }; - duneVersion = "3"; inherit (params) minimalOCamlVersion; buildInputs = diff --git a/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix b/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix index f06c425c4362..c77d1ed40453 100644 --- a/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix +++ b/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix @@ -23,7 +23,7 @@ , ocaml , version ? if lib.versionAtLeast ocaml.version "4.14" then - "1.17.0" + "1.18.0" else if lib.versionAtLeast ocaml.version "4.13" then "1.10.5" else if lib.versionAtLeast ocaml.version "4.12" then @@ -38,7 +38,6 @@ let jsonrpc_v = jsonrpc.override { buildDunePackage rec { pname = "lsp"; inherit (jsonrpc_v) version src; - duneVersion = "3"; minimalOCamlVersion = if lib.versionAtLeast version "1.7.0" then "4.12"