about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules
diff options
context:
space:
mode:
authorGuillaume Girol <symphorien+git@xlumurb.eu>2022-04-24 12:00:00 +0000
committerGuillaume Girol <symphorien+git@xlumurb.eu>2022-04-26 22:01:24 +0200
commitc0b6df2b86417b8e41c533bf7a71257e95648448 (patch)
treeaf4148dc5e0df8446694113dabe9b3261de8a048 /pkgs/development/ocaml-modules
parent5063e680eb6217eb3274b76d6cefc923c5703952 (diff)
ocamlPackages.ocaml-lsp: update
4.14 version is untested as ppxlib does not compile
Diffstat (limited to 'pkgs/development/ocaml-modules')
-rw-r--r--pkgs/development/ocaml-modules/ocaml-lsp/default.nix15
-rw-r--r--pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix12
-rw-r--r--pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix30
3 files changed, 40 insertions, 17 deletions
diff --git a/pkgs/development/ocaml-modules/ocaml-lsp/default.nix b/pkgs/development/ocaml-modules/ocaml-lsp/default.nix
index 602f5eb77fe7e..c1831e660f423 100644
--- a/pkgs/development/ocaml-modules/ocaml-lsp/default.nix
+++ b/pkgs/development/ocaml-modules/ocaml-lsp/default.nix
@@ -1,14 +1,13 @@
-{ lib, buildDunePackage, jsonrpc, lsp, re, makeWrapper, dot-merlin-reader, spawn }:
+{ lib, buildDunePackage, lsp, xdg, re, fiber, makeWrapper, dot-merlin-reader, spawn }:
 
-buildDunePackage {
+buildDunePackage rec {
   pname = "ocaml-lsp-server";
-  inherit (jsonrpc) version src;
-  useDune2 = true;
-
-  inherit (lsp) preBuild;
+  inherit (lsp) version src preBuild;
+  duneVersion = if lib.versionAtLeast version "1.10.0" then "3" else "2";
 
   buildInputs = lsp.buildInputs ++ [ lsp re ]
-  ++ lib.optional (lib.versionAtLeast jsonrpc.version "1.9") spawn;
+  ++ lib.optional (lib.versionAtLeast version "1.9") spawn
+  ++ lib.optionals (lib.versionAtLeast version "1.10") [ fiber xdg ];
 
   nativeBuildInputs = [ makeWrapper ];
 
@@ -16,7 +15,7 @@ buildDunePackage {
     wrapProgram $out/bin/ocamllsp --prefix PATH : ${dot-merlin-reader}/bin
   '';
 
-  meta = jsonrpc.meta // {
+  meta = lsp.meta // {
     description = "OCaml Language Server Protocol implementation";
   };
 }
diff --git a/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix b/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix
index 4f192fe20ecb4..2e6802a504266 100644
--- a/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix
+++ b/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix
@@ -10,10 +10,14 @@
 }:
 
 let params =
-  if lib.versionAtLeast ocaml.version "4.13"
+  if lib.versionAtLeast ocaml.version "4.14"
   then {
-    version = "1.10.3";
-    sha256 = "sha256-o6wQc7Byi5T0vbARF3LAq69/9wMkOZRQ6rcVa/rBUfE=";
+    version = "1.11.3";
+    sha256 = "sha256-KlMFh05O04I0Xil2B+nL2hUxZw0jaDMUnI23oUwGyhs=";
+  } else if lib.versionAtLeast ocaml.version "4.13"
+  then {
+    version = "1.10.5";
+    sha256 = "sha256-TeJS6t1ruWhWPvWNatrnSUWI6T17XKiosHLYizBDDcw=";
   } else if lib.versionAtLeast ocaml.version "4.12"
   then {
     version = "1.9.0";
@@ -32,7 +36,7 @@ buildDunePackage rec {
     inherit (params) sha256;
   };
 
-  useDune2 = true;
+  duneVersion = if lib.versionAtLeast version "1.10.0" then "3" else "2";
   minimalOCamlVersion = "4.06";
 
   buildInputs =
diff --git a/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix b/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix
index cd01116b82096..faa1495190770 100644
--- a/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix
+++ b/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix
@@ -8,18 +8,23 @@
 , omd
 , octavius
 , dune-build-info
+, dune-rpc
 , uutf
+, dyn
 , re
-, pp
+, stdune
+, dune_3
 , csexp
+, pp
 , cmdliner
+, ordering
 , ocamlformat-rpc-lib
 }:
 
 buildDunePackage rec {
   pname = "lsp";
   inherit (jsonrpc) version src;
-  useDune2 = true;
+  duneVersion = if lib.versionAtLeast version "1.10.0" then "3" else "2";
   minimumOCamlVersion =
     if lib.versionAtLeast version "1.7.0" then
       "4.12"
@@ -30,15 +35,30 @@ buildDunePackage rec {
   # 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 = ''
+  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.7.0" then
+    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
       [ pp re ppx_yojson_conv_lib octavius dune-build-info omd cmdliner ocamlformat-rpc-lib ]
     else
-      [ cppo
+      [
+        cppo
         ppx_yojson_conv_lib
         ocaml-syntax-shims
         octavius