ocamlPackages.ocamlformat: disable old versions for OCaml ≥ 5.0

This commit is contained in:
Vincent Laporte 2023-08-17 21:06:19 +02:00
parent 428862de06
commit 778e5e8802
No known key found for this signature in database
GPG key ID: EBD582ADDDB1F81F

View file

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