about summary refs log tree commit diff
path: root/pkgs/top-level/ocaml-packages.nix
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2023-02-01 09:20:48 +0100
committerVincent Laporte <Vincent.Laporte@gmail.com>2023-02-01 09:20:48 +0100
commit98f36b2d744c02c844200cc0624ba5bc226660e5 (patch)
tree3b05840e1f4838d01e0dfcac46b8ac28c6c2f8bd /pkgs/top-level/ocaml-packages.nix
parent6094e4cfb2c000f6f01bb5553b48ea12b2007105 (diff)
ocamlPackages.dune_3: enable for OCaml < 4.08
Diffstat (limited to 'pkgs/top-level/ocaml-packages.nix')
-rw-r--r--pkgs/top-level/ocaml-packages.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix
index 301495961e334..57759ae28eec2 100644
--- a/pkgs/top-level/ocaml-packages.nix
+++ b/pkgs/top-level/ocaml-packages.nix
@@ -357,7 +357,12 @@ let
       then pkgs.dune_2
       else throw "dune_2 is not available for OCaml ${ocaml.version}";
 
-    dune_3 = callPackage ../development/tools/ocaml/dune/3.nix { };
+    dune_3 =
+      if lib.versionAtLeast ocaml.version "4.08"
+      then callPackage ../development/tools/ocaml/dune/3.nix { }
+      else if lib.versionAtLeast ocaml.version "4.02"
+      then pkgs.dune_3
+      else throw "dune_3 is not available for OCaml ${ocaml.version}";
 
     dune-action-plugin = callPackage ../development/ocaml-modules/dune-action-plugin { };