Skip to content

Commit

Permalink
98-fixup-gir-path: fix
Browse files Browse the repository at this point in the history
This hook is wrong in many ways and should go away ASAP.
The reason it is there is that cross builds using the 'gir' mockery
sometimes, but not always, install *.gir files in a wrong /destdir path.
wrong: /destdir/usr/aarch64-linux-musl/polkit-0.116_3/usr/aarch64-linux-musl/usr/share/gir-1.0
right: /destdir/usr/aarch64-linux-musl/polkit-0.116_3/usr/share/gir-1.0

This hook detects the extraneous usr/${XBPS_TARGET_TRIPLET}/usr/share path
and copies files to the right path using bsdtar, then removes the wrong path.
The previous hack started to fail after @q66 cleaned up the lib32 vs. lib64
handling in cross toolchains. This "fix", again, is nothing but an ugly hack.

Somewhere in the install of cross gobject-introspection there is a
place where the original ${DESTDIR} is erroneously appended again.
  • Loading branch information
pullmoll committed Dec 26, 2020
1 parent 9421add commit b52e90e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions common/hooks/pre-install/98-fixup-gir-path.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# This hook fixes the wrong install path of 'gir' files
# when cross building packages. It's a workaround and
# not a proper fix. Remove it once the root cause of the
# problem is fixed.
# XXX: This hook fixes the wrong install path of 'gir' files when cross
# building packages. It's a workaround and not a proper fix.
# Remove this hook once the root cause of the problem is fixed.

hook() {
[ -z "$CROSS_BUILD" ] && return
if [ -d "${DESTDIR}/usr/${XBPS_CROSS_TRIPLET}/usr" ]; then
cp -a "${DESTDIR}"/usr/{${XBPS_CROSS_TRIPLET}/usr/*,}
rm -rf "${DESTDIR}"/usr/${XBPS_CROSS_TRIPLET}/usr
local src="${DESTDIR}/usr/${XBPS_CROSS_TRIPLET}/usr"
local dst="${DESTDIR}/usr"
if [ -d "${src}/share" ]; then
bsdtar cf - -C "${src}" share | bsdtar xpvf - -C "${dst}"
rm -rf "${src}"
fi
}

0 comments on commit b52e90e

Please sign in to comment.