diff --git a/pkgs/development/ocaml-modules/ocplib-endian/default.nix b/pkgs/development/ocaml-modules/ocplib-endian/default.nix index 1e657fce8dd..285e8de84b3 100644 --- a/pkgs/development/ocaml-modules/ocplib-endian/default.nix +++ b/pkgs/development/ocaml-modules/ocplib-endian/default.nix @@ -1,4 +1,4 @@ -{ lib, buildDunePackage, fetchFromGitHub, cppo }: +{ lib, buildDunePackage, fetchFromGitHub, ocaml, cppo }: buildDunePackage rec { version = "1.2"; @@ -11,6 +11,11 @@ buildDunePackage rec { sha256 = "sha256-THTlhOfXAPaqTt1qBkht+D67bw6M175QLvXoUMgjks4="; }; + postPatch = lib.optionalString (lib.versionAtLeast ocaml.version "5.0") '' + substituteInPlace src/dune \ + --replace "libraries ocplib_endian bigarray" "libraries ocplib_endian" + ''; + minimalOCamlVersion = "4.03"; nativeBuildInputs = [ cppo ];