about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/ocaml-modules/ocaml-lsp/default.nix
blob: 602f5eb77fe7ef167df409812c8fa6b6afee30c8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{ lib, buildDunePackage, jsonrpc, lsp, re, makeWrapper, dot-merlin-reader, spawn }:

buildDunePackage {
  pname = "ocaml-lsp-server";
  inherit (jsonrpc) version src;
  useDune2 = true;

  inherit (lsp) preBuild;

  buildInputs = lsp.buildInputs ++ [ lsp re ]
  ++ lib.optional (lib.versionAtLeast jsonrpc.version "1.9") spawn;

  nativeBuildInputs = [ makeWrapper ];

  postInstall = ''
    wrapProgram $out/bin/ocamllsp --prefix PATH : ${dot-merlin-reader}/bin
  '';

  meta = jsonrpc.meta // {
    description = "OCaml Language Server Protocol implementation";
  };
}