2022-04-27 09:35:20 +00:00
|
|
|
{ lib, buildDunePackage, lsp, xdg, re, fiber, makeWrapper, dot-merlin-reader, spawn }:
|
2020-11-09 15:59:12 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
buildDunePackage rec {
|
2020-11-09 15:59:12 +00:00
|
|
|
pname = "ocaml-lsp-server";
|
2022-04-27 09:35:20 +00:00
|
|
|
inherit (lsp) version src preBuild;
|
|
|
|
duneVersion = if lib.versionAtLeast version "1.10.0" then "3" else "2";
|
2020-11-09 15:59:12 +00:00
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
buildInputs = lsp.buildInputs ++ [ lsp re ]
|
2022-04-27 09:35:20 +00:00
|
|
|
++ lib.optional (lib.versionAtLeast version "1.9") spawn
|
|
|
|
++ lib.optionals (lib.versionAtLeast version "1.10") [ fiber xdg ];
|
2021-03-23 19:22:30 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/ocamllsp --prefix PATH : ${dot-merlin-reader}/bin
|
|
|
|
'';
|
2020-11-09 15:59:12 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
meta = lsp.meta // {
|
2020-11-09 15:59:12 +00:00
|
|
|
description = "OCaml Language Server Protocol implementation";
|
2022-05-18 14:49:53 +00:00
|
|
|
mainProgram = "ocamllsp";
|
2020-11-09 15:59:12 +00:00
|
|
|
};
|
|
|
|
}
|