aboutsummaryrefslogtreecommitdiff
path: root/common/hooks
diff options
context:
space:
mode:
authorÉrico Rolim <erico.erc@gmail.com>2021-01-19 14:25:39 +0000
committerÉrico Nogueira Rolim <34201958+ericonr@users.noreply.github.com>2021-01-24 21:08:27 +0000
commit4a41da04268b35cef3faf258083182ba8040e5bd (patch)
treec6b1d0bed5bfac7ca76472f16391917104fd954e /common/hooks
parent930e5841e91e5a7bf7c84c8aba28fc024e46e1c0 (diff)
downloadvoid-packages-4a41da04268b35cef3faf258083182ba8040e5bd.tar
void-packages-4a41da04268b35cef3faf258083182ba8040e5bd.tar.gz
void-packages-4a41da04268b35cef3faf258083182ba8040e5bd.tar.bz2
void-packages-4a41da04268b35cef3faf258083182ba8040e5bd.tar.lz
void-packages-4a41da04268b35cef3faf258083182ba8040e5bd.tar.xz
void-packages-4a41da04268b35cef3faf258083182ba8040e5bd.tar.zst
void-packages-4a41da04268b35cef3faf258083182ba8040e5bd.zip
hooks/{pre,post}-install: fix 98-fixup-gir-path.
The libdir changes to use /usr/lib{32,64} instead of /usr/lib broke cross builds for some packages that use gir, due to issues with copying over symlinks. Since we haven't managed to track down the root cause for the installation path, a symlink is a clean enough temporary fix. This follows the style of the 00-libdir hooks. Since pre-install runs for the main package and then each subpackage, it should use PKGDESTDIR (not DESTDIR), which also enables a subpackage that installs files during pkg_install to work cleanly. As far as I can see, the previous hook was quite flawed. Since it was a pre-install hook, the check for a directory would happen *before* package installation (so nothing would happen). The only reason it did anything was because it also ran as a step before a subpackage's pkg_install (most GIR packages have a -devel subpackage), but used DESTDIR instead of PKGDESTDIR, so it checked and affected the contents of the main package. Then when the subpackage's pkg_install ran, the files would have already been copied to the correct folders. Closes #27437
Diffstat (limited to 'common/hooks')
-rw-r--r--common/hooks/post-install/00-fixup-gir-path.sh11
-rw-r--r--common/hooks/pre-install/98-fixup-gir-path.sh6
2 files changed, 13 insertions, 4 deletions
diff --git a/common/hooks/post-install/00-fixup-gir-path.sh b/common/hooks/post-install/00-fixup-gir-path.sh
new file mode 100644
index 00000000000..6fdb111fa0b
--- /dev/null
+++ b/common/hooks/post-install/00-fixup-gir-path.sh
@@ -0,0 +1,11 @@
+# This hook removes the symlink necessary to fix the wrong install path of
+# 'gir' files when cross building packages (see pre-install hook). It's a
+# workaround and not a proper fix. Remove it once the root cause of the problem
+# is fixed.
+
+# Has to be a low number so it runs before remove-empty-dirs
+
+hook() {
+ [ -z "$CROSS_BUILD" ] && return
+ rm -f "${PKGDESTDIR}/usr/${XBPS_CROSS_TRIPLET}/usr"
+}
diff --git a/common/hooks/pre-install/98-fixup-gir-path.sh b/common/hooks/pre-install/98-fixup-gir-path.sh
index c81c8257294..64fd1405c4c 100644
--- a/common/hooks/pre-install/98-fixup-gir-path.sh
+++ b/common/hooks/pre-install/98-fixup-gir-path.sh
@@ -5,8 +5,6 @@
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
- fi
+ vmkdir usr/${XBPS_CROSS_TRIPLET}
+ ln -sf ".." "${PKGDESTDIR}/usr/${XBPS_CROSS_TRIPLET}/usr"
}