Merge pull request #170142 from symphorien/ocaml-lsp-update-2

ocaml-lsp update
This commit is contained in:
Guillaume Girol 2022-05-01 16:54:33 +00:00 committed by GitHub
commit 0e6265e8f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 146 additions and 22 deletions

View file

@ -10,6 +10,10 @@ buildDunePackage rec {
propagatedBuildInputs = [ dune-glob dune-private-libs ]; propagatedBuildInputs = [ dune-glob dune-private-libs ];
preBuild = ''
rm -r vendor/csexp
'';
meta = with lib; { meta = with lib; {
inherit (dune_3.meta) homepage; inherit (dune_3.meta) homepage;
description = "API for writing dynamic Dune actions"; description = "API for writing dynamic Dune actions";

View file

@ -10,6 +10,10 @@ buildDunePackage rec {
propagatedBuildInputs = [ dune-private-libs ]; propagatedBuildInputs = [ dune-private-libs ];
preBuild = ''
rm -r vendor/csexp
'';
meta = with lib; { meta = with lib; {
inherit (dune_3.meta) homepage; inherit (dune_3.meta) homepage;
description = "Glob string matching language supported by dune"; description = "Glob string matching language supported by dune";

View file

@ -13,6 +13,10 @@ buildDunePackage rec {
propagatedBuildInputs = [ stdune ]; propagatedBuildInputs = [ stdune ];
preBuild = ''
rm -r vendor/csexp
'';
meta = with lib; { meta = with lib; {
description = "Private libraries of Dune"; description = "Private libraries of Dune";
maintainers = [ maintainers.marsam ]; maintainers = [ maintainers.marsam ];

View file

@ -0,0 +1,23 @@
{ lib, buildDunePackage, dune_3, stdune, ordering, pp, xdg, dyn }:
buildDunePackage rec {
pname = "dune-rpc";
inherit (dune_3) src version;
duneVersion = "3";
dontAddPrefix = true;
buildInputs = [ stdune ordering pp xdg dyn ];
preBuild = ''
rm -r vendor/csexp
'';
meta = with lib; {
description = "Library to connect and control a running dune instance";
inherit (dune_3.meta) homepage;
maintainers = with lib.maintainers; [ ];
license = licenses.mit;
};
}

View file

@ -10,6 +10,10 @@ buildDunePackage rec {
propagatedBuildInputs = [ dune-private-libs ]; propagatedBuildInputs = [ dune-private-libs ];
preBuild = ''
rm -r vendor/csexp
'';
meta = with lib; { meta = with lib; {
description = "A library for embedding location information inside executable and libraries"; description = "A library for embedding location information inside executable and libraries";
inherit (dune_3.meta) homepage; inherit (dune_3.meta) homepage;

View file

@ -0,0 +1,23 @@
{ lib, buildDunePackage, dune_3, stdune, dyn }:
buildDunePackage rec {
pname = "fiber";
inherit (dune_3) src version;
duneVersion = "3";
dontAddPrefix = true;
buildInputs = [ stdune dyn ];
preBuild = ''
rm -r vendor/csexp
'';
meta = with lib; {
description = "Structured concurrency library";
inherit (dune_3.meta) homepage;
maintainers = with lib.maintainers; [ ];
license = licenses.mit;
};
}

View file

@ -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"; pname = "ocaml-lsp-server";
inherit (jsonrpc) version src; inherit (lsp) version src preBuild;
useDune2 = true; duneVersion = if lib.versionAtLeast version "1.10.0" then "3" else "2";
inherit (lsp) preBuild;
buildInputs = lsp.buildInputs ++ [ lsp re ] 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 ]; nativeBuildInputs = [ makeWrapper ];
@ -16,7 +15,7 @@ buildDunePackage {
wrapProgram $out/bin/ocamllsp --prefix PATH : ${dot-merlin-reader}/bin wrapProgram $out/bin/ocamllsp --prefix PATH : ${dot-merlin-reader}/bin
''; '';
meta = jsonrpc.meta // { meta = lsp.meta // {
description = "OCaml Language Server Protocol implementation"; description = "OCaml Language Server Protocol implementation";
}; };
} }

View file

@ -10,10 +10,14 @@
}: }:
let params = let params =
if lib.versionAtLeast ocaml.version "4.13" if lib.versionAtLeast ocaml.version "4.14"
then { then {
version = "1.10.3"; version = "1.11.3";
sha256 = "sha256-o6wQc7Byi5T0vbARF3LAq69/9wMkOZRQ6rcVa/rBUfE="; 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" } else if lib.versionAtLeast ocaml.version "4.12"
then { then {
version = "1.9.0"; version = "1.9.0";
@ -32,7 +36,7 @@ buildDunePackage rec {
inherit (params) sha256; inherit (params) sha256;
}; };
useDune2 = true; duneVersion = if lib.versionAtLeast version "1.10.0" then "3" else "2";
minimalOCamlVersion = "4.06"; minimalOCamlVersion = "4.06";
buildInputs = buildInputs =

View file

@ -8,18 +8,23 @@
, omd , omd
, octavius , octavius
, dune-build-info , dune-build-info
, dune-rpc
, uutf , uutf
, dyn
, re , re
, pp , stdune
, dune_3
, csexp , csexp
, pp
, cmdliner , cmdliner
, ordering
, ocamlformat-rpc-lib , ocamlformat-rpc-lib
}: }:
buildDunePackage rec { buildDunePackage rec {
pname = "lsp"; pname = "lsp";
inherit (jsonrpc) version src; inherit (jsonrpc) version src;
useDune2 = true; duneVersion = if lib.versionAtLeast version "1.10.0" then "3" else "2";
minimumOCamlVersion = minimumOCamlVersion =
if lib.versionAtLeast version "1.7.0" then if lib.versionAtLeast version "1.7.0" then
"4.12" "4.12"
@ -30,15 +35,30 @@ buildDunePackage rec {
# They are vendored by upstream only because it is then easier to install # 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 # ocaml-lsp without messing with your opam switch, but nix should prevent
# this type of problems without resorting to vendoring. # 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} rm -r ocaml-lsp-server/vendor/{octavius,uutf,omd,cmdliner}
''; '';
buildInputs = 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 ] [ pp re ppx_yojson_conv_lib octavius dune-build-info omd cmdliner ocamlformat-rpc-lib ]
else else
[ cppo [
cppo
ppx_yojson_conv_lib ppx_yojson_conv_lib
ocaml-syntax-shims ocaml-syntax-shims
octavius octavius

View file

@ -1,12 +1,24 @@
{ lib, fetchurl, buildDunePackage, csexp, sexplib0 }: { lib, fetchurl, buildDunePackage, ocaml, csexp, sexplib0 }:
# for compat with ocaml-lsp
let source =
if lib.versionAtLeast ocaml.version "4.13"
then {
version = "0.21.0";
sha256 = "sha256-KhgX9rxYH/DM6fCqloe4l7AnJuKrdXSe6Y1XY3BXMy0=";
} else {
version = "0.20.0";
sha256 = "sha256-JtmNCgwjbCyUE4bWqdH5Nc2YSit+rekwS43DcviIfgk=";
};
in
buildDunePackage rec { buildDunePackage rec {
pname = "ocamlformat-rpc-lib"; pname = "ocamlformat-rpc-lib";
version = "0.19.0"; inherit (source) version;
src = fetchurl { src = fetchurl {
url = "https://github.com/ocaml-ppx/ocamlformat/releases/download/${version}/ocamlformat-${version}.tbz"; url = "https://github.com/ocaml-ppx/ocamlformat/releases/download/${version}/ocamlformat-${version}.tbz";
sha256 = "sha256-YvxGqujwpKM85/jXcm1xCb/2Fepvy1DRSC8h0g7lD0Y="; inherit (source) sha256;
}; };
minimumOCamlVersion = "4.08"; minimumOCamlVersion = "4.08";

View file

@ -1,4 +1,4 @@
{ lib, buildDunePackage, dune_3, dyn, ordering }: { lib, buildDunePackage, dune_3, dyn, ordering, csexp }:
buildDunePackage { buildDunePackage {
pname = "stdune"; pname = "stdune";
@ -7,7 +7,11 @@ buildDunePackage {
dontAddPrefix = true; dontAddPrefix = true;
propagatedBuildInputs = [ dyn ordering ]; propagatedBuildInputs = [ dyn ordering csexp ];
preBuild = ''
rm -r vendor/csexp
'';
meta = dune_3.meta // { meta = dune_3.meta // {
description = "Dune's unstable standard library"; description = "Dune's unstable standard library";

View file

@ -0,0 +1,17 @@
{ lib, buildDunePackage, dune_3 }:
buildDunePackage rec {
pname = "xdg";
inherit (dune_3) src version;
duneVersion = "3";
dontAddPrefix = true;
meta = with lib; {
description = "XDG Base Directory Specification";
inherit (dune_3.meta) homepage;
maintainers = with lib.maintainers; [ ];
license = licenses.mit;
};
}

View file

@ -336,6 +336,8 @@ let
inherit (pkgs) opam git mercurial coreutils gnutar bzip2; inherit (pkgs) opam git mercurial coreutils gnutar bzip2;
}; };
dune-rpc = callPackage ../development/ocaml-modules/dune-rpc { };
dune-site = callPackage ../development/ocaml-modules/dune-site { }; dune-site = callPackage ../development/ocaml-modules/dune-site { };
duration = callPackage ../development/ocaml-modules/duration { }; duration = callPackage ../development/ocaml-modules/duration { };
@ -423,6 +425,8 @@ let
inherit (pkgs) ffmpeg; inherit (pkgs) ffmpeg;
}; };
fiber = callPackage ../development/ocaml-modules/fiber { };
fileutils = callPackage ../development/ocaml-modules/fileutils { }; fileutils = callPackage ../development/ocaml-modules/fileutils { };
findlib = callPackage ../development/tools/ocaml/findlib { }; findlib = callPackage ../development/tools/ocaml/findlib { };
@ -1418,6 +1422,8 @@ let
x509 = callPackage ../development/ocaml-modules/x509 { }; x509 = callPackage ../development/ocaml-modules/x509 { };
xdg = callPackage ../development/ocaml-modules/xdg { };
xenstore = callPackage ../development/ocaml-modules/xenstore { }; xenstore = callPackage ../development/ocaml-modules/xenstore { };
xenstore_transport = callPackage ../development/ocaml-modules/xenstore_transport { }; xenstore_transport = callPackage ../development/ocaml-modules/xenstore_transport { };