Skip to content

Commit

Permalink
ocamlPackages.ocaml-lsp: init at 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
symphorien authored and vbgl committed Nov 8, 2020
1 parent 83401d1 commit b393908
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
66 changes: 66 additions & 0 deletions pkgs/development/ocaml-modules/ocaml-lsp/default.nix
@@ -0,0 +1,66 @@
{ buildDunePackage
, stdlib-shims
, ppx_yojson_conv_lib
, ocaml-syntax-shims
, omd
, octavius
, dune-build-info
, uutf
, csexp
, cmdliner
, fetchzip
, lib
}:
let
version = "1.1.0";
src = fetchzip {
url = "https://github.com/ocaml/ocaml-lsp/releases/download/${version}/ocaml-lsp-server-${version}.tbz";
sha256 = "0al89waw43jl80k9z06kh44byhjhwb5hmzx07sddwi1kr1vc6jrb";
};

# 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 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
];

lsp = buildDunePackage {
pname = "lsp";
inherit version src;
useDune2 = true;
minimumOCamlVersion = "4.06";

inherit buildInputs preBuild;
};

in
buildDunePackage {
pname = "ocaml-lsp-server";
inherit version src;
useDune2 = true;

inherit preBuild;

buildInputs = buildInputs ++ [ lsp ];

meta = with lib; {
description = "OCaml Language Server Protocol implementation";
license = lib.licenses.isc;
platforms = platforms.unix;
maintainers = [ maintainers.symphorien ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/ocaml-packages.nix
Expand Up @@ -654,6 +654,8 @@ let

ocamlify = callPackage ../development/tools/ocaml/ocamlify { };

ocaml-lsp = callPackage ../development/ocaml-modules/ocaml-lsp { };

ocaml-migrate-parsetree = callPackage ../development/ocaml-modules/ocaml-migrate-parsetree { };

ocamlmod = callPackage ../development/tools/ocaml/ocamlmod { };
Expand Down

0 comments on commit b393908

Please sign in to comment.