Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, fetchurl, buildDunePackage, ocaml, csexp, sexplib0 }:
2
3# for compat with ocaml-lsp
4let source =
5 if lib.versionAtLeast ocaml.version "4.13"
6 then {
7 version = "0.21.0";
8 sha256 = "sha256-KhgX9rxYH/DM6fCqloe4l7AnJuKrdXSe6Y1XY3BXMy0=";
9 } else {
10 version = "0.20.0";
11 sha256 = "sha256-JtmNCgwjbCyUE4bWqdH5Nc2YSit+rekwS43DcviIfgk=";
12 };
13in
14
15buildDunePackage rec {
16 pname = "ocamlformat-rpc-lib";
17 inherit (source) version;
18
19 src = fetchurl {
20 url = "https://github.com/ocaml-ppx/ocamlformat/releases/download/${version}/ocamlformat-${version}.tbz";
21 inherit (source) sha256;
22 };
23
24 minimalOCamlVersion = "4.08";
25 duneVersion = "3";
26
27 propagatedBuildInputs = [ csexp sexplib0 ];
28
29 meta = with lib; {
30 homepage = "https://github.com/ocaml-ppx/ocamlformat";
31 description = "Auto-formatter for OCaml code (RPC mode)";
32 license = licenses.mit;
33 maintainers = with maintainers; [ Zimmi48 marsam ];
34 };
35}