summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix')
-rw-r--r--pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix27
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 00000000000..30a0b01e5af
--- /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;
+  };
+}