about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/ocaml-modules/nonstd/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/ocaml-modules/nonstd/default.nix')
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/nonstd/default.nix6
1 files changed, 3 insertions, 3 deletions
diff --git a/nixpkgs/pkgs/development/ocaml-modules/nonstd/default.nix b/nixpkgs/pkgs/development/ocaml-modules/nonstd/default.nix
index 82b1feed540b..696cdff52196 100644
--- a/nixpkgs/pkgs/development/ocaml-modules/nonstd/default.nix
+++ b/nixpkgs/pkgs/development/ocaml-modules/nonstd/default.nix
@@ -1,11 +1,9 @@
-{ lib, fetchzip, buildDunePackage }:
+{ lib, fetchzip, buildDunePackage, ocaml }:
 
 buildDunePackage rec {
   pname = "nonstd";
   version = "0.0.3";
 
-  useDune2 = false;
-
   minimalOCamlVersion = "4.02";
 
   src = fetchzip {
@@ -13,6 +11,8 @@ buildDunePackage rec {
     sha256 = "0ccjwcriwm8fv29ij1cnbc9win054kb6pfga3ygzdbjpjb778j46";
   };
 
+  useDune2 = lib.versionAtLeast ocaml.version "4.12";
+  postPatch = lib.optionalString useDune2 "dune upgrade";
   doCheck = true;
 
   meta = with lib; {