summary refs log tree commit diff
path: root/pkgs/development/tools/ocaml/ocamlformat/generic.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/ocaml/ocamlformat/generic.nix')
-rw-r--r--pkgs/development/tools/ocaml/ocamlformat/generic.nix162
1 files changed, 24 insertions, 138 deletions
diff --git a/pkgs/development/tools/ocaml/ocamlformat/generic.nix b/pkgs/development/tools/ocaml/ocamlformat/generic.nix
index 1d332a010dd..cf04df5a788 100644
--- a/pkgs/development/tools/ocaml/ocamlformat/generic.nix
+++ b/pkgs/development/tools/ocaml/ocamlformat/generic.nix
@@ -11,17 +11,6 @@ let src =
   } else fetchurl {
     url = "https://github.com/ocaml-ppx/ocamlformat/releases/download/${version}/${tarballName}";
     sha256 = {
-      "0.12" = "1zi8x597dhp2822j6j28s84yyiqppl7kykpwqqclx6ybypvlzdpj";
-      "0.13.0" = "0ki2flqi3xkhw9mfridivb6laxm7gml8rj9qz42vqmy9yx76jjxq";
-      "0.14.0" = "070c0x6z5y0lyls56zm34g8lyc093wkr0jfp50dvrkr9fk1sx2wi";
-      "0.14.1" = "03wn46xib63748157xchj7gflkw5000fcjw6n89h9g82q9slazaa";
-      "0.14.2" = "16phz1sg9b070p6fm8d42j0piizg05vghdjmw8aj7xm82b1pm7sz";
-      "0.14.3" = "13pfakdncddm41cp61p0l98scawbvhx1q4zdsglv7ph87l7zwqfl";
-      "0.15.0" = "0190vz59n6ma9ca1m3syl3mc8i1smj1m3d8x1jp21f710y4llfr6";
-      "0.15.1" = "1x6fha495sgk4z05g0p0q3zfqm5l6xzmf6vjm9g9g7c820ym2q9a";
-      "0.16.0" = "1vwjvvwha0ljc014v8jp8snki5zsqxlwd7x0dl0rg2i9kcmwc4mr";
-      "0.17.0" = "0f1lxp697yq61z8gqxjjaqd2ns8fd1vjfggn55x0gh9dx098p138";
-      "0.18.0" = "0571kzmb1h03qj74090n3mg8wfbh29qqrkdjkai6rnl5chll86lq";
       "0.19.0" = "0ihgwl7d489g938m1jvgx8azdgq9f5np5mzqwwya797hx2m4dz32";
       "0.20.0" = "sha256-JtmNCgwjbCyUE4bWqdH5Nc2YSit+rekwS43DcviIfgk=";
       "0.20.1" = "sha256-fTpRZFQW+ngoc0T6A69reEUAZ6GmHkeQvxspd5zRAjU=";
@@ -29,15 +18,8 @@ let src =
       "0.22.4" = "sha256-61TeK4GsfMLmjYGn3ICzkagbc3/Po++Wnqkb2tbJwGA=";
     }."${version}";
   };
-  ocamlPackages =
-  if lib.versionAtLeast version "0.19.0"
-  then ocaml-ng.ocamlPackages
-  else if lib.versionAtLeast version "0.17.0"
-  then ocaml-ng.ocamlPackages_4_12
-  else if lib.versionAtLeast version "0.14.3"
-  then ocaml-ng.ocamlPackages_4_10
-  else ocaml-ng.ocamlPackages_4_07
-; in
+  ocamlPackages = ocaml-ng.ocamlPackages;
+in
 
 with ocamlPackages;
 
@@ -45,10 +27,7 @@ buildDunePackage {
   pname = "ocamlformat";
   inherit src version;
 
-  minimumOCamlVersion =
-    if lib.versionAtLeast version "0.17.0"
-    then "4.08"
-    else "4.06";
+  minimumOCamlVersion = "4.08";
 
   useDune2 = true;
 
@@ -58,120 +37,27 @@ buildDunePackage {
     menhir
   ];
 
-  buildInputs =
-    if lib.versionAtLeast version "0.20.0"
-    then [
-      base
-      (if lib.versionAtLeast version "0.21.0" then cmdliner_1_1 else cmdliner_1_0)
-      dune-build-info
-      either
-      fix
-      fpath
-      menhirLib
-      menhirSdk
-      ocaml-version
-      ocp-indent
-      (if version == "0.20.0" then odoc-parser.override { version = "0.9.0"; } else odoc-parser)
-      re
-      stdio
-      uuseg
-      uutf
-    ] ++ lib.optionals (lib.versionAtLeast version "0.22.4") [ csexp ]
-    else if lib.versionAtLeast version "0.19.0"
-    then [
-      base
-      cmdliner_1_0
-      fpath
-      re
-      stdio
-      uuseg
-      uutf
-      fix
-      menhirLib
-      menhirSdk
-      ocp-indent
-      dune-build-info
-      (odoc-parser.override { version = "0.9.0"; })
-    ]
-    else if lib.versionAtLeast version "0.18.0"
-    then [
-      base
-      cmdliner_1_0
-      fpath
-      odoc
-      re
-      stdio
-      uuseg
-      uutf
-      fix
-      menhirLib
-      menhirSdk
-      dune-build-info
-      ocaml-version
-      # Changed since 0.16.0:
-      (ppxlib.override { version = "0.22.0"; })
-    ]
-    else if lib.versionAtLeast version "0.17.0"
-    then [
-      base
-      cmdliner_1_0
-      fpath
-      odoc
-      re
-      stdio
-      uuseg
-      uutf
-      fix
-      menhirLib
-      menhirSdk
-      dune-build-info
-      ocaml-version
-      # Changed since 0.16.0:
-      (ppxlib.override { version = "0.22.0"; })
-      ocaml-migrate-parsetree-2
-    ]
-    else if lib.versionAtLeast version "0.15.1"
-    then [
-      base
-      cmdliner_1_0
-      fpath
-      odoc
-      re
-      stdio
-      uuseg
-      uutf
-      fix
-      menhirLib
-      menhirSdk
-      (ppxlib.override { version = "0.18.0"; })
-      dune-build-info # lib.versionAtLeast version "0.16.0"
-      ocaml-version # lib.versionAtLeast version "0.16.0"
-    ]
-    else if lib.versionAtLeast version "0.14"
-    then [
-      base
-      cmdliner_1_0
-      fpath
-      ocaml-migrate-parsetree
-      odoc
-      re
-      stdio
-      uuseg
-      uutf
-      fix
-      menhirLib
-      menhirSdk
-    ] else [
-      base
-      cmdliner_1_0
-      fpath
-      ocaml-migrate-parsetree
-      odoc
-      re
-      stdio
-      uuseg
-      uutf
-    ];
+  buildInputs = [
+    base
+    dune-build-info
+    fix
+    fpath
+    menhirLib
+    menhirSdk
+    ocp-indent
+    re
+    stdio
+    uuseg
+    uutf
+  ]
+  ++ lib.optionals (lib.versionAtLeast version "0.20.0") [ ocaml-version either ]
+  ++ (if lib.versionAtLeast version "0.20.1"
+      then [ odoc-parser ]
+      else [ (odoc-parser.override { version = "0.9.0"; }) ])
+  ++ (if lib.versionAtLeast version "0.21.0"
+      then [ cmdliner_1_1 ]
+      else [ cmdliner_1_0 ])
+  ++ lib.optionals (lib.versionAtLeast version "0.22.4") [ csexp ];
 
   meta = {
     homepage = "https://github.com/ocaml-ppx/ocamlformat";