imagemagick: use the right pkg-config in *-config

If we're building buildPackages.imagemagick, the imagemagick libraries
will be built for the local system, but we were previously using the
pkg-config for the cross system in the *-config scripts bundled with
ImageMagick.  I suspect the reason it wasn't noticed for a long time
was that packages that are using still old-style *-config scripts
instead of pkg-config probably don't cross compile anyway.  I noticed
because I wondered why buildPackages.imagemagick when cross-compiling
was not the same as my native imagemagick, so as a happy side effect
of this change, users won't have to rebuild imagemagick any more when
it's used as a native build input for a cross-compiled package.
This commit is contained in:
Alyssa Ross 2023-03-16 10:41:44 +00:00
parent 4121483085
commit 00d1feaed3
No known key found for this signature in database
GPG Key ID: F9DBED4859B271C0

View File

@ -115,7 +115,7 @@ stdenv.mkDerivation (finalAttrs: {
moveToOutput "lib/ImageMagick-*/config-Q16HDRI" "$dev" # includes configure params
for file in "$dev"/bin/*-config; do
substituteInPlace "$file" --replace pkg-config \
"PKG_CONFIG_PATH='$dev/lib/pkgconfig' '${pkg-config}/bin/${pkg-config.targetPrefix}pkg-config'"
"PKG_CONFIG_PATH='$dev/lib/pkgconfig' '$(command -v $PKG_CONFIG)'"
done
'' + lib.optionalString ghostscriptSupport ''
for la in $out/lib/*.la; do