From 953f4b47a9aa828cf4fccfde33c81d58a1acd4af Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Thu, 7 May 2020 19:44:59 +0200
Subject: [PATCH] xbps-src/common: add option to disable generic pkg-config
 link

closes #21728
---
 common/hooks/pre-configure/02-script-wrapper.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/common/hooks/pre-configure/02-script-wrapper.sh b/common/hooks/pre-configure/02-script-wrapper.sh
index 2b46a029223..451d7319b3c 100644
--- a/common/hooks/pre-configure/02-script-wrapper.sh
+++ b/common/hooks/pre-configure/02-script-wrapper.sh
@@ -92,7 +92,9 @@ export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/usr/lib/pkgconfig\${PKG_CONFIG_LIBDIR
 exec /usr/bin/pkg-config "\$@"
 _EOF
 	chmod 755 ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-pkg-config
-	ln -sf ${XBPS_CROSS_TRIPLET}-pkg-config ${XBPS_WRAPPERDIR}/pkg-config
+	if [ -z "$no_generic_pkgconfig_link" ]; then
+		ln -sf ${XBPS_CROSS_TRIPLET}-pkg-config ${XBPS_WRAPPERDIR}/pkg-config
+	fi
 }
 
 vapigen_wrapper() {