diff options
author | Jules Aguillon <jules@j3s.fr> | 2023-07-05 17:21:04 +0200 |
---|---|---|
committer | Jules Aguillon <jules@j3s.fr> | 2023-07-05 17:21:04 +0200 |
commit | fb98ebb9a05fefa25585ef78000b40744e8d4d17 (patch) | |
tree | 9faabf43a7841383cf9ecab3a90e319bd93462bd /pkgs/development/ocaml-modules | |
parent | a5ca6a0f2ee8b2c8aa2cca64a06bd5652ad28a4b (diff) |
ocamlPackages.ocamlformat: Move into 'ocamlPackages'
Move the definitions of OCamlformat packages into ocamlPackages. This moves the package containing the tool closer to the definition of the library. It's now possible to build OCamlformat using a different version of OCaml than the default. `ocamlformat`, `ocamlPackages.ocamlformat` and `ocaml-ng.ocamlPackages_<lastest>.ocamlformat` are all aliases.
Diffstat (limited to 'pkgs/development/ocaml-modules')
-rw-r--r-- | pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix b/pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix new file mode 100644 index 0000000000000..30a0b01e5af46 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix @@ -0,0 +1,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; + }; +} |