freetype: patch pkg-config in -config better

When we have build == host != target, we don't want to patch in a
prefixed pkg-config used for cross compiling. Using `pkgsHostHost`
expressses the intent.

Then again, per https://github.com/NixOS/nixpkgs/issues/51176 leaving
`buildPackages.pkg-config` is arguably also correct, if we do further
cross compilation and want to run `freetype-config`. Really, there is no
good solution.
This commit is contained in:
John Ericson 2021-02-27 18:57:20 +00:00
parent fc74ad444a
commit 739381f0c1

View file

@ -1,5 +1,5 @@
{ lib, stdenv, fetchurl
, buildPackages
, buildPackages, pkgsHostHost
, pkg-config, which, makeWrapper
, zlib, bzip2, libpng, gnumake, glib
@ -64,7 +64,7 @@ in stdenv.mkDerivation rec {
postInstall = glib.flattenInclude + ''
substituteInPlace $dev/bin/freetype-config \
--replace ${buildPackages.pkg-config} ${pkg-config}
--replace ${buildPackages.pkg-config} ${pkgsHostHost.pkg-config}
wrapProgram "$dev/bin/freetype-config" \
--set PKG_CONFIG_PATH "$PKG_CONFIG_PATH:$dev/lib/pkgconfig"