From 3080ccb11a82776982368fb221428e039ed82ac6 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 30 Aug 2021 01:05:16 -0700 Subject: ocamlPackages.jsonrpc: drop unnecesary dependencies for 1.7.0 The latest version of jsonrpc does not require any dependencies apart from dune or ocaml Signed-off-by: Rudi Grinberg --- pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'pkgs/development/ocaml-modules') diff --git a/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix b/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix index a1d457f8775f..a6867aac63ad 100644 --- a/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix +++ b/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix @@ -31,9 +31,17 @@ buildDunePackage rec { useDune2 = true; minimumOCamlVersion = "4.06"; - buildInputs = [ yojson stdlib-shims ocaml-syntax-shims ]; + buildInputs = + if lib.versionAtLeast version "1.7.0" then + [ ] + else + [ yojson stdlib-shims ocaml-syntax-shims ]; - propagatedBuildInputs = [ ppx_yojson_conv_lib result ]; + propagatedBuildInputs = + if lib.versionAtLeast version "1.7.0" then + [ ] + else + [ ppx_yojson_conv_lib result ]; meta = with lib; { description = "Jsonrpc protocol implementation in OCaml"; -- cgit 1.4.1 From af82bb0abf2b16f6b077bc48633e6daf68414c31 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 30 Aug 2021 01:28:10 -0700 Subject: ocamlPackages.ocaml-lsp: fix minimum ocaml version ocaml-lsp 1.7.0 is only available for OCaml 4.12 and above. For previous version of OCaml, an old version must be used. 1.7.0 only supports 4.12 Signed-off-by: Rudi Grinberg --- pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'pkgs/development/ocaml-modules') diff --git a/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix b/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix index f81def4a7b40..fb38dea3d4cf 100644 --- a/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix +++ b/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix @@ -14,11 +14,15 @@ , cmdliner }: -buildDunePackage { +buildDunePackage rec { pname = "lsp"; inherit (jsonrpc) version src; useDune2 = true; - minimumOCamlVersion = "4.06"; + minimumOCamlVersion = + 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 -- cgit 1.4.1 From 7e10715778240535cc6e4db19bcdfb7c89378b71 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 30 Aug 2021 01:36:27 -0700 Subject: ocamlPackages.ocaml-lsp: fix list of dependencies for 1.7.0 ocaml-lsp 1.7.0 depends on re which was omitted. it also does not depend on cppo, ocaml-syntax-shims, stdlib-shims. Signed-off-by: Rudi Grinberg --- pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix | 25 +++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'pkgs/development/ocaml-modules') diff --git a/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix b/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix index fb38dea3d4cf..869e9f633540 100644 --- a/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix +++ b/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix @@ -9,6 +9,7 @@ , octavius , dune-build-info , uutf +, re , pp , csexp , cmdliner @@ -32,22 +33,24 @@ buildDunePackage rec { rm -r ocaml-lsp-server/vendor/{octavius,uutf,omd,cmdliner} ''; - buildInputs = [ - cppo - ppx_yojson_conv_lib - ocaml-syntax-shims - octavius - dune-build-info - omd - cmdliner - ] ++ lib.optional (lib.versionAtLeast jsonrpc.version "1.7.0") pp; + buildInputs = + if lib.versionAtLeast version "1.7.0" then + [ pp re ppx_yojson_conv_lib octavius dune-build-info omd cmdliner ] + else + [ cppo + ppx_yojson_conv_lib + ocaml-syntax-shims + octavius + dune-build-info + omd + cmdliner + ]; propagatedBuildInputs = [ csexp jsonrpc - stdlib-shims uutf - ]; + ] ++ lib.optional (lib.versionOlder version "1.7.0") stdlib-shims; meta = jsonrpc.meta // { description = "LSP protocol implementation in OCaml"; -- cgit 1.4.1