From 48728f5ca4b90407bc83fd02ab5ca7f6ed9d9d93 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Tue, 6 Sep 2022 21:44:39 +0200 Subject: [PATCH] mupdf: fix finding pkg-config under cross-compilation --- pkgs/applications/misc/mupdf/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/mupdf/default.nix b/pkgs/applications/misc/mupdf/default.nix index 88f804ccf81f..2010268eade1 100644 --- a/pkgs/applications/misc/mupdf/default.nix +++ b/pkgs/applications/misc/mupdf/default.nix @@ -5,6 +5,7 @@ , copyDesktopItems , makeDesktopItem , desktopToDarwinBundle +, buildPackages , pkg-config , freetype , harfbuzz @@ -49,13 +50,17 @@ stdenv.mkDerivation rec { postPatch = '' sed -i "s/__OPENJPEG__VERSION__/${openJpegVersion}/" source/fitz/load-jpx.c + substituteInPlace Makerules --replace "(shell pkg-config" "(shell $PKG_CONFIG" ''; # Use shared libraries to decrease size buildFlags = [ "shared" ]; - makeFlags = [ "prefix=$(out)" "USE_SYSTEM_LIBS=yes" ] - ++ lib.optionals (!enableX11) [ "HAVE_X11=no" ] + makeFlags = [ + "prefix=$(out)" + "USE_SYSTEM_LIBS=yes" + "PKG_CONFIG=${buildPackages.pkg-config}/bin/${buildPackages.pkg-config.targetPrefix}pkg-config" + ] ++ lib.optionals (!enableX11) [ "HAVE_X11=no" ] ++ lib.optionals (!enableGL) [ "HAVE_GLUT=no" ]; nativeBuildInputs = [ pkg-config ]