about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix
blob: 30a0b01e5af463b670f3e34970cc019d4a5418ab (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
{ lib, callPackage, ocaml-ng, version ? "0.25.1" }:

with ocaml-ng.ocamlPackages;

let inherit (callPackage ./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 = with lib.maintainers; [ Zimmi48 marsam Julow ];
    license = lib.licenses.mit;
  };
}