summary refs log tree commit diff
path: root/pkgs/development/tools/ocaml/ocamlformat/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/ocaml/ocamlformat/default.nix')
-rw-r--r--pkgs/development/tools/ocaml/ocamlformat/default.nix77
1 files changed, 51 insertions, 26 deletions
diff --git a/pkgs/development/tools/ocaml/ocamlformat/default.nix b/pkgs/development/tools/ocaml/ocamlformat/default.nix
index 069f0471595..4c8a4b9e9d0 100644
--- a/pkgs/development/tools/ocaml/ocamlformat/default.nix
+++ b/pkgs/development/tools/ocaml/ocamlformat/default.nix
@@ -1,35 +1,60 @@
-{ lib, fetchurl, ocamlPackages }:
+{ lib, fetchurl, fetchzip, callPackage }:
 
-with ocamlPackages; buildDunePackage rec {
-  pname = "ocamlformat";
-  version = "0.15.0";
+let mkOCamlformat = callPackage ./generic.nix; in
 
-  minimumOCamlVersion = "4.06";
+# Older versions should be removed when their usage decrease
+# This script scraps Github looking for OCamlformat's options and versions usage:
+#  https://gist.github.com/Julow/110dc94308d6078225e0665e3eccd433
 
-  useDune2 = true;
+rec {
+  ocamlformat_0_11_0 = mkOCamlformat {
+    version = "0.11.0";
+  };
+
+  ocamlformat_0_12 = mkOCamlformat {
+    version = "0.12";
+  };
+
+  ocamlformat_0_13_0 = mkOCamlformat rec {
+    version = "0.13.0";
+    tarballName = "ocamlformat-${version}-2.tbz";
+  };
 
-  src = fetchurl {
-    url = "https://github.com/ocaml-ppx/ocamlformat/releases/download/${version}/ocamlformat-${version}.tbz";
-    sha256 = "0190vz59n6ma9ca1m3syl3mc8i1smj1m3d8x1jp21f710y4llfr6";
+  ocamlformat_0_14_0 = mkOCamlformat {
+    version = "0.14.0";
   };
 
-  buildInputs = [
-    cmdliner
-    fpath
-    ocaml-migrate-parsetree
-    odoc
-    re
-    stdio
-    uuseg
-    uutf
-    fix
-    menhir
-  ];
+  ocamlformat_0_14_1 = mkOCamlformat {
+    version = "0.14.1";
+  };
+
+  ocamlformat_0_14_2 = mkOCamlformat {
+    version = "0.14.2";
+  };
+
+  ocamlformat_0_14_3 = mkOCamlformat {
+    version = "0.14.3";
+  };
 
-  meta = {
-    homepage = "https://github.com/ocaml-ppx/ocamlformat";
-    description = "Auto-formatter for OCaml code";
-    maintainers = [ lib.maintainers.Zimmi48 lib.maintainers.marsam ];
-    license = lib.licenses.mit;
+  ocamlformat_0_15_0 = mkOCamlformat {
+    version = "0.15.0";
   };
+
+  ocamlformat_0_15_1 = mkOCamlformat {
+    version = "0.15.1";
+  };
+
+  ocamlformat_0_16_0 = mkOCamlformat {
+    version = "0.16.0";
+  };
+
+  ocamlformat_0_17_0 = mkOCamlformat {
+    version = "0.17.0";
+  };
+
+  ocamlformat_0_18_0 = mkOCamlformat {
+    version = "0.18.0";
+  };
+
+  ocamlformat = ocamlformat_0_18_0;
 }