xbps-src: follow symlinks when fixing up pkg-config files

Packages (e.g., python3-pybind11) that symlink to *.pc files in
/usr/{lib,share}/pkgconfig will have those links overwritten with actual
copies of the files after the hook

    common/hooks/post-install/13-pkg-config-clean-xbps-cross-base-ref.sh

attempts to remove $XBPS_CROSS_BASE from paths. This will result in the
new copy containing corrected paths, but the original file remaining
uncorrected.

This was stolen fro @tornaria.
This commit is contained in:
Andrew J. Hesford 2023-09-23 13:49:30 -04:00 committed by Andrew J. Hesford
parent 8e9b0d8a23
commit dc44dff8d5
1 changed files with 2 additions and 1 deletions

View File

@ -16,7 +16,8 @@ hook() {
# 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"
sed -i --follow-symlinks \
-e "s,$XBPS_CROSS_BASE/usr,/usr,g" "$f"
fi
done
}