From eef02a2b8417c51f3aa8714c8c8d3daf595d0720 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Wed, 20 May 2020 07:07:07 +0700 Subject: [PATCH] post-install: clean reference to $XBPS_CROSS_BASE in pkgconfig --- ...13-pkg-config-clean-xbps-cross-base-ref.sh | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 common/hooks/post-install/13-pkg-config-clean-xbps-cross-base-ref.sh diff --git a/common/hooks/post-install/13-pkg-config-clean-xbps-cross-base-ref.sh b/common/hooks/post-install/13-pkg-config-clean-xbps-cross-base-ref.sh new file mode 100644 index 00000000000..5cdfb0e9bfd --- /dev/null +++ b/common/hooks/post-install/13-pkg-config-clean-xbps-cross-base-ref.sh @@ -0,0 +1,22 @@ +# This hook removes reference to $XBPS_CROSS_BASE in +# /usr/{lib,share}/pkgconfig/*.pc +# +# We don't touch /usr/bin/*-config since there're other information that +# references $XBPS_CROSS_BASE + +hook() { + if [ -z "$CROSS_BUILD" ]; then + return 0 + fi + for f in "$PKGDESTDIR"/usr/lib/pkgconfig/*.pc \ + "$PKGDESTDIR"/usr/share/pkgconfig/*.pc + do + if [ -f "$f" ]; then + # Sample sed script + # s,/usr/armv7l-linux-musleabihf/usr,/usr,g + # trailing /usr to avoid clashing with + # other $XBPS_CROSS_BASE and $XBPS_CROSS_TRIPLET. + sed -i -e "s,$XBPS_CROSS_BASE/usr,/usr,g" "$f" + fi + done +}