limine: update to 8.6.0.
[void-pkg.git] / common / hooks / post-install / 15-qt-private-api.sh
blob3f445b43d52b3c0e05915bb617f476798a42ee3a
1 # vim: set ts=4 sw=4 et ft=bash :
3 # This hook execute the following tasks:
4 # - warn if packages uses private Qt API but makedepends doesn't have
5 # qt6-*-private-devel
7 # This hook only really target qt6-base-private-devel, a lot of packages
8 # linked with Qt6::CorePrivate and Qt6::GuiPrivate, yet don't need its
9 # headers.
11 get_qt_private() {
12 local _elf _fn _lf
13 find ${PKGDESTDIR} -type f |
14 while read -r _fn; do
15 trap - ERR
16 _lf=${_fn#${PKGDESTDIR}}
17 if [ "${skiprdeps/${_lf}/}" != "${skiprdeps}" ]; then
18 continue
20 read -n4 _elf < "$_fn"
21 if [ "$_elf" = $'\177ELF' ]; then
22 $OBJDUMP -p "$_fn" |
23 sed -n '
24 /required from /{s/.*required from \(.*\):/\1/;h;}
25 /Qt_[0-9]*_PRIVATE_API/{g;p;}
28 done |
29 sort -u
33 hook() {
34 local _list _shlib _version _md _v _ok
36 if [ -n "$noverifyrdeps" ]; then
37 return 0
40 _list=$(get_qt_private)
41 for _shlib in $_list; do
42 msg_normal "${pkgver}: requires PRIVATE_API from $_shlib\n"
43 done
44 _version=$(printf '%s\n' $_list |
45 sed -E '
46 s/^libQt([0-9]*)3D.*/\1/
47 s/^libQt([0-9]*).*/\1/
48 ' | grep -v '^5$' | uniq
50 for _v in $_version; do
51 _ok=
52 for _md in ${makedepends}; do
53 case "${_md}" in
54 # Anything will works, because they're updated together
55 qt${_v}-*-private-devel)
56 _ok=yes
57 break
59 esac
60 done
61 if [ -z "$_ok" ]; then
62 msg_warn "${pkgver}: using Qt${_v}_PRIVATE_API but doesn't use qt${_v}-*-private-devel\n"
64 done