From 00d1feaed3aa199af7ed253d3f176fcb78c2e1d7 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 16 Mar 2023 10:41:44 +0000 Subject: [PATCH] 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. --- pkgs/applications/graphics/ImageMagick/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/graphics/ImageMagick/default.nix b/pkgs/applications/graphics/ImageMagick/default.nix index 387cb97a3cbc..60cba0410c49 100644 --- a/pkgs/applications/graphics/ImageMagick/default.nix +++ b/pkgs/applications/graphics/ImageMagick/default.nix @@ -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