From 4f4ab52f4fde7d831e3dad4cd91f1da30a3d0ae8 Mon Sep 17 00:00:00 2001 From: Rick van Schijndel Date: Fri, 18 Jun 2021 00:10:40 +0200 Subject: [PATCH] freeimage: support cross-compilation Co-authored-by: Doron Behar --- pkgs/development/libraries/freeimage/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/libraries/freeimage/default.nix b/pkgs/development/libraries/freeimage/default.nix index 236305a572bf..87997cead43f 100644 --- a/pkgs/development/libraries/freeimage/default.nix +++ b/pkgs/development/libraries/freeimage/default.nix @@ -18,6 +18,14 @@ stdenv.mkDerivation { prePatch = "rm -rf Source/Lib* Source/OpenEXR Source/ZLib"; patches = [ ./unbundle.diff ]; + postPatch = '' + # To support cross compilation, use the correct `pkg-config`. + substituteInPlace Makefile.fip \ + --replace "pkg-config" "$PKG_CONFIG" + substituteInPlace Makefile.gnu \ + --replace "pkg-config" "$PKG_CONFIG" + ''; + nativeBuildInputs = [ pkg-config ] ++ lib.optionals stdenv.isDarwin [