summary refs log tree commit diff
path: root/pkgs/development/tools/ocaml/ocamlformat/generic.nix
blob: 0d38d2e0ac02068292d9be3234e3057d3b647546 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ lib, callPackage, ocaml-ng, version ? "0.25.1" }:

with ocaml-ng.ocamlPackages;

let
  inherit (callPackage ../../../ocaml-modules/ocamlformat/generic.nix {
    inherit version;
  })
    src library_deps;

in buildDunePackage {
  pname = "ocamlformat";
  inherit src version;

  minimalOCamlVersion = "4.08";
  duneVersion = "3";

  nativeBuildInputs =
    if lib.versionAtLeast version "0.25.1" then [ ] else [ menhir ];

  buildInputs = [ re ] ++ library_deps
    ++ lib.optionals (lib.versionAtLeast version "0.25.1")
    [ (ocamlformat-lib.override { inherit version; }) ];

  meta = {
    homepage = "https://github.com/ocaml-ppx/ocamlformat";
    description = "Auto-formatter for OCaml code";
    maintainers = [ lib.maintainers.Zimmi48 lib.maintainers.marsam ];
    license = lib.licenses.mit;
  };
}