From 778e5e88025101ab1f9835555d927de3960abe44 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 17 Aug 2023 21:06:19 +0200 Subject: [PATCH] =?UTF-8?q?ocamlPackages.ocamlformat:=20disable=20old=20ve?= =?UTF-8?q?rsions=20for=20OCaml=20=E2=89=A5=205.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../development/ocaml-modules/ocamlformat/ocamlformat.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix b/pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix index 3ebc179f8601..a2456dbef3b9 100644 --- a/pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix +++ b/pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix @@ -1,6 +1,7 @@ { lib , callPackage , buildDunePackage +, ocaml , re , ocamlformat-lib , menhir @@ -8,13 +9,16 @@ }: let inherit (callPackage ./generic.nix { inherit version; }) src library_deps; +in -in buildDunePackage { +lib.throwIf (lib.versionAtLeast ocaml.version "5.0" && !lib.versionAtLeast version "0.23") + "ocamlformat ${version} is not available for OCaml ${ocaml.version}" + +buildDunePackage { pname = "ocamlformat"; inherit src version; minimalOCamlVersion = "4.08"; - duneVersion = "3"; nativeBuildInputs = if lib.versionAtLeast version "0.25.1" then [ ] else [ menhir ];