From 3df03f233a46cab99e34e79f52d62495f8522bcf Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Wed, 19 Apr 2023 15:44:54 +0300 Subject: [PATCH] ocamlPackages.ocplib-endian: fix for OCaml >= 5 --- pkgs/development/ocaml-modules/ocplib-endian/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 ];