about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/ocaml/ocamlformat/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/tools/ocaml/ocamlformat/default.nix')
-rw-r--r--nixpkgs/pkgs/development/tools/ocaml/ocamlformat/default.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/ocaml/ocamlformat/default.nix b/nixpkgs/pkgs/development/tools/ocaml/ocamlformat/default.nix
new file mode 100644
index 000000000000..694f4b6e89a0
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/ocaml/ocamlformat/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchFromGitHub, ocamlPackages }:
+
+with ocamlPackages; buildDunePackage rec {
+  pname = "ocamlformat";
+  version = "0.8";
+
+  minimumOCamlVersion = "4.05";
+
+  src = fetchFromGitHub {
+    owner = "ocaml-ppx";
+    repo = pname;
+    rev = version;
+    sha256 = "1i7rsbs00p43362yv7z7dw0qsnv7vjf630qk676qvfg7kg422w6j";
+  };
+
+  buildInputs = [
+    base
+    cmdliner
+    fpath
+    ocaml-migrate-parsetree
+    stdio
+  ];
+
+  configurePhase = ''
+    patchShebangs tools/gen_version.sh
+    tools/gen_version.sh src/Version.ml version
+  '';
+
+  meta = {
+    inherit (src.meta) homepage;
+    description = "Auto-formatter for OCaml code";
+    maintainers = [ stdenv.lib.maintainers.Zimmi48 ];
+    license = stdenv.lib.licenses.mit;
+  };
+}