Merge pull request #117133 from anmonteiro/anmonteiro/ocaml-lsp-overridable
ocaml-lsp, lsp, jsonrpc: allow overriding the source globally
This commit is contained in:
commit
7a6d0468bf
|
@ -1,78 +1,15 @@
|
||||||
{ buildDunePackage
|
{ buildDunePackage, jsonrpc, lsp }:
|
||||||
, stdlib-shims
|
|
||||||
, ppx_yojson_conv_lib
|
|
||||||
, ocaml-syntax-shims
|
|
||||||
, yojson
|
|
||||||
, result
|
|
||||||
, omd
|
|
||||||
, octavius
|
|
||||||
, dune-build-info
|
|
||||||
, uutf
|
|
||||||
, csexp
|
|
||||||
, cmdliner
|
|
||||||
, fetchzip
|
|
||||||
, lib
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
version = "1.4.1";
|
|
||||||
src = fetchzip {
|
|
||||||
url = "https://github.com/ocaml/ocaml-lsp/releases/download/${version}/jsonrpc-${version}.tbz";
|
|
||||||
sha256 = "0hzpw17qfhb0cxgwah1fv4k300r363dy1kv0977anl44dlanx1v5";
|
|
||||||
};
|
|
||||||
|
|
||||||
# unvendor some (not all) dependencies.
|
|
||||||
# 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 = ''
|
|
||||||
rm -r ocaml-lsp-server/vendor/{octavius,uutf,ocaml-syntax-shims,omd,cmdliner}
|
|
||||||
'';
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
stdlib-shims
|
|
||||||
ppx_yojson_conv_lib
|
|
||||||
ocaml-syntax-shims
|
|
||||||
octavius
|
|
||||||
uutf
|
|
||||||
csexp
|
|
||||||
dune-build-info
|
|
||||||
omd
|
|
||||||
cmdliner
|
|
||||||
jsonrpc
|
|
||||||
];
|
|
||||||
|
|
||||||
lsp = buildDunePackage {
|
|
||||||
pname = "lsp";
|
|
||||||
inherit version src;
|
|
||||||
useDune2 = true;
|
|
||||||
minimumOCamlVersion = "4.06";
|
|
||||||
|
|
||||||
inherit buildInputs preBuild;
|
|
||||||
};
|
|
||||||
|
|
||||||
jsonrpc = buildDunePackage {
|
|
||||||
pname = "jsonrpc";
|
|
||||||
inherit version src;
|
|
||||||
useDune2 = true;
|
|
||||||
minimumOCamlVersion = "4.06";
|
|
||||||
|
|
||||||
buildInputs = [ yojson stdlib-shims ocaml-syntax-shims ppx_yojson_conv_lib result ];
|
|
||||||
};
|
|
||||||
|
|
||||||
in
|
|
||||||
buildDunePackage {
|
buildDunePackage {
|
||||||
pname = "ocaml-lsp-server";
|
pname = "ocaml-lsp-server";
|
||||||
inherit version src;
|
inherit (jsonrpc) version src;
|
||||||
useDune2 = true;
|
useDune2 = true;
|
||||||
|
|
||||||
inherit preBuild;
|
inherit (lsp) preBuild;
|
||||||
|
|
||||||
buildInputs = buildInputs ++ [ lsp ];
|
buildInputs = lsp.buildInputs ++ [ lsp ];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = jsonrpc.meta // {
|
||||||
description = "OCaml Language Server Protocol implementation";
|
description = "OCaml Language Server Protocol implementation";
|
||||||
license = lib.licenses.isc;
|
|
||||||
platforms = platforms.unix;
|
|
||||||
maintainers = [ maintainers.symphorien maintainers.marsam ];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
{ buildDunePackage
|
||||||
|
, stdlib-shims
|
||||||
|
, ppx_yojson_conv_lib
|
||||||
|
, ocaml-syntax-shims
|
||||||
|
, yojson
|
||||||
|
, result
|
||||||
|
, fetchzip
|
||||||
|
, lib
|
||||||
|
}:
|
||||||
|
|
||||||
|
|
||||||
|
buildDunePackage rec {
|
||||||
|
pname = "jsonrpc";
|
||||||
|
version = "1.4.1";
|
||||||
|
src = fetchzip {
|
||||||
|
url = "https://github.com/ocaml/ocaml-lsp/releases/download/${version}/jsonrpc-${version}.tbz";
|
||||||
|
sha256 = "0hzpw17qfhb0cxgwah1fv4k300r363dy1kv0977anl44dlanx1v5";
|
||||||
|
};
|
||||||
|
|
||||||
|
useDune2 = true;
|
||||||
|
minimumOCamlVersion = "4.06";
|
||||||
|
|
||||||
|
buildInputs = [ yojson stdlib-shims ocaml-syntax-shims ppx_yojson_conv_lib result ];
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "Jsonrpc protocol implementation in OCaml";
|
||||||
|
license = licenses.isc;
|
||||||
|
platforms = platforms.unix;
|
||||||
|
maintainers = with maintainers; [ symphorien marsam ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
{ buildDunePackage
|
||||||
|
, stdlib-shims
|
||||||
|
, ppx_yojson_conv_lib
|
||||||
|
, ocaml-syntax-shims
|
||||||
|
, jsonrpc
|
||||||
|
, omd
|
||||||
|
, octavius
|
||||||
|
, dune-build-info
|
||||||
|
, uutf
|
||||||
|
, csexp
|
||||||
|
, cmdliner
|
||||||
|
}:
|
||||||
|
|
||||||
|
buildDunePackage {
|
||||||
|
pname = "lsp";
|
||||||
|
inherit (jsonrpc) version src;
|
||||||
|
useDune2 = true;
|
||||||
|
minimumOCamlVersion = "4.06";
|
||||||
|
|
||||||
|
# unvendor some (not all) dependencies.
|
||||||
|
# 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 = ''
|
||||||
|
rm -r ocaml-lsp-server/vendor/{octavius,uutf,ocaml-syntax-shims,omd,cmdliner}
|
||||||
|
'';
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
stdlib-shims
|
||||||
|
ppx_yojson_conv_lib
|
||||||
|
ocaml-syntax-shims
|
||||||
|
octavius
|
||||||
|
uutf
|
||||||
|
csexp
|
||||||
|
dune-build-info
|
||||||
|
omd
|
||||||
|
cmdliner
|
||||||
|
jsonrpc
|
||||||
|
];
|
||||||
|
|
||||||
|
meta = jsonrpc.meta // {
|
||||||
|
description = "LSP protocol implementation in OCaml";
|
||||||
|
};
|
||||||
|
}
|
|
@ -781,6 +781,8 @@ let
|
||||||
|
|
||||||
ocamlify = callPackage ../development/tools/ocaml/ocamlify { };
|
ocamlify = callPackage ../development/tools/ocaml/ocamlify { };
|
||||||
|
|
||||||
|
jsonrpc = callPackage ../development/ocaml-modules/ocaml-lsp/jsonrpc.nix { };
|
||||||
|
lsp = callPackage ../development/ocaml-modules/ocaml-lsp/lsp.nix { };
|
||||||
ocaml-lsp = callPackage ../development/ocaml-modules/ocaml-lsp { };
|
ocaml-lsp = callPackage ../development/ocaml-modules/ocaml-lsp { };
|
||||||
|
|
||||||
ocaml-migrate-parsetree = ocaml-migrate-parsetree-1-8;
|
ocaml-migrate-parsetree = ocaml-migrate-parsetree-1-8;
|
||||||
|
|
Loading…
Reference in New Issue