2023-08-07 15:08:52 +00:00
|
|
|
{ lib
|
|
|
|
, callPackage
|
|
|
|
, buildDunePackage
|
|
|
|
, re
|
|
|
|
, ocamlformat-lib
|
|
|
|
, menhir
|
|
|
|
, version ? "0.26.0"
|
|
|
|
}:
|
2020-12-08 20:50:10 +00:00
|
|
|
|
2023-07-05 15:21:04 +00:00
|
|
|
let inherit (callPackage ./generic.nix { inherit version; }) src library_deps;
|
2020-10-14 14:19:25 +00:00
|
|
|
|
2023-04-20 08:55:57 +00:00
|
|
|
in buildDunePackage {
|
2020-10-14 14:19:25 +00:00
|
|
|
pname = "ocamlformat";
|
|
|
|
inherit src version;
|
|
|
|
|
2023-03-29 04:31:56 +00:00
|
|
|
minimalOCamlVersion = "4.08";
|
|
|
|
duneVersion = "3";
|
2022-02-22 09:59:04 +00:00
|
|
|
|
2023-04-20 08:55:57 +00:00
|
|
|
nativeBuildInputs =
|
|
|
|
if lib.versionAtLeast version "0.25.1" then [ ] else [ menhir ];
|
2022-02-22 09:59:04 +00:00
|
|
|
|
2023-04-20 08:55:57 +00:00
|
|
|
buildInputs = [ re ] ++ library_deps
|
|
|
|
++ lib.optionals (lib.versionAtLeast version "0.25.1")
|
|
|
|
[ (ocamlformat-lib.override { inherit version; }) ];
|
2020-10-14 14:19:25 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/ocaml-ppx/ocamlformat";
|
|
|
|
description = "Auto-formatter for OCaml code";
|
2023-04-20 09:37:52 +00:00
|
|
|
maintainers = with lib.maintainers; [ Zimmi48 marsam Julow ];
|
2020-10-14 14:19:25 +00:00
|
|
|
license = lib.licenses.mit;
|
2023-08-07 15:08:52 +00:00
|
|
|
mainProgram = "ocamlformat";
|
2020-10-14 14:19:25 +00:00
|
|
|
};
|
|
|
|
}
|