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 ];