diff --git a/pkgs/development/ocaml-modules/chrome-trace/default.nix b/pkgs/development/ocaml-modules/chrome-trace/default.nix index fb6c14b3362e..9c427d343758 100644 --- a/pkgs/development/ocaml-modules/chrome-trace/default.nix +++ b/pkgs/development/ocaml-modules/chrome-trace/default.nix @@ -4,6 +4,7 @@ buildDunePackage rec { pname = "chrome-trace"; inherit (dune_3) src version; + minimalOCamlVersion = "4.08"; duneVersion = "3"; dontAddPrefix = true; diff --git a/pkgs/development/ocaml-modules/ordering/default.nix b/pkgs/development/ocaml-modules/ordering/default.nix index c3bffc013f95..8613ccf9ae08 100644 --- a/pkgs/development/ocaml-modules/ordering/default.nix +++ b/pkgs/development/ocaml-modules/ordering/default.nix @@ -4,6 +4,7 @@ buildDunePackage { pname = "ordering"; inherit (dune_3) version src; duneVersion = "3"; + minimalOCamlVersion = "4.08"; dontAddPrefix = true; diff --git a/pkgs/development/ocaml-modules/xdg/default.nix b/pkgs/development/ocaml-modules/xdg/default.nix index 8d3810fa7e9e..52543175e07c 100644 --- a/pkgs/development/ocaml-modules/xdg/default.nix +++ b/pkgs/development/ocaml-modules/xdg/default.nix @@ -5,6 +5,7 @@ buildDunePackage rec { inherit (dune_3) src version; duneVersion = "3"; + minimalOCamlVersion = "4.08"; dontAddPrefix = true; diff --git a/pkgs/development/tools/ocaml/js_of_ocaml/compiler.nix b/pkgs/development/tools/ocaml/js_of_ocaml/compiler.nix index cec91a02f209..8533c1ac41cc 100644 --- a/pkgs/development/tools/ocaml/js_of_ocaml/compiler.nix +++ b/pkgs/development/tools/ocaml/js_of_ocaml/compiler.nix @@ -7,6 +7,7 @@ buildDunePackage rec { pname = "js_of_ocaml-compiler"; version = "4.1.0"; duneVersion = "3"; + minimalOCamlVersion = "4.08"; src = fetchurl { url = "https://github.com/ocsigen/js_of_ocaml/releases/download/${version}/js_of_ocaml-${version}.tbz"; diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 301495961e33..57759ae28eec 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 { };