From 6009fd8178150f827ddef88afb6b973b1cbdff22 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 20 Apr 2023 06:41:28 +0200 Subject: [PATCH] ocamlPackages.nonstd: pin Dune version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and disable for OCaml ≥ 5.0 --- pkgs/development/ocaml-modules/nonstd/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/development/ocaml-modules/nonstd/default.nix b/pkgs/development/ocaml-modules/nonstd/default.nix index 696cdff52196..748196bf28e2 100644 --- a/pkgs/development/ocaml-modules/nonstd/default.nix +++ b/pkgs/development/ocaml-modules/nonstd/default.nix @@ -1,5 +1,8 @@ { lib, fetchzip, buildDunePackage, ocaml }: +lib.throwIf (lib.versionAtLeast ocaml.version "5.0") + "nonstd is not available for OCaml ≥ 5.0" + buildDunePackage rec { pname = "nonstd"; version = "0.0.3"; @@ -11,8 +14,8 @@ buildDunePackage rec { sha256 = "0ccjwcriwm8fv29ij1cnbc9win054kb6pfga3ygzdbjpjb778j46"; }; - useDune2 = lib.versionAtLeast ocaml.version "4.12"; - postPatch = lib.optionalString useDune2 "dune upgrade"; + duneVersion = if lib.versionAtLeast ocaml.version "4.12" then "2" else "1"; + postPatch = lib.optionalString (duneVersion != "1") "dune upgrade"; doCheck = true; meta = with lib; {