nixpkgs/pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
1005 B
Nix
Raw Normal View History

# Version can be selected with the 'version' argument, see generic.nix.
2023-08-07 15:08:52 +00:00
{ lib
, callPackage
, buildDunePackage
, ocaml
2023-08-07 15:08:52 +00:00
, re
, ocamlformat-lib
, menhir
, ...
}@args:
let inherit (callPackage ./generic.nix args) src version library_deps;
in
2020-10-14 14:19:25 +00:00
lib.throwIf (lib.versionAtLeast ocaml.version "5.0" && !lib.versionAtLeast version "0.23")
"ocamlformat ${version} is not available for OCaml ${ocaml.version}"
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";
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; }) ];
2020-10-14 14:19:25 +00:00
meta = {
homepage = "https://github.com/ocaml-ppx/ocamlformat";
description = "Auto-formatter for OCaml code";
2024-04-24 04:20:00 +00:00
maintainers = with lib.maintainers; [ Zimmi48 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
};
}