2023-08-22 20:05:09 +00:00
|
|
|
{ lib
|
|
|
|
, buildDunePackage
|
|
|
|
, lsp
|
|
|
|
, xdg
|
|
|
|
, re
|
|
|
|
, fiber
|
|
|
|
, makeWrapper
|
|
|
|
, dot-merlin-reader
|
|
|
|
, spawn
|
|
|
|
, ocamlc-loc
|
|
|
|
, odoc-parser
|
|
|
|
, merlin-lib
|
|
|
|
}:
|
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;
|
2023-05-24 13:37:59 +00:00
|
|
|
duneVersion = "3";
|
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
|
2022-11-21 17:40:18 +00:00
|
|
|
++ lib.optionals (lib.versionAtLeast version "1.10") [ fiber xdg ]
|
2023-08-22 20:05:09 +00:00
|
|
|
++ lib.optional (lib.versionAtLeast version "1.14.2") ocamlc-loc
|
|
|
|
++ lib.optional (lib.versionAtLeast version "1.16.2") [ odoc-parser merlin-lib ];
|
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
|
|
|
};
|
|
|
|
}
|