From: sgn <sgn@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] hooks/post-install: check for -private-devel if PRIVATE_API is used
Date: Wed, 26 Jun 2024 03:34:12 +0200 [thread overview]
Message-ID: <20240626013412.9AFF726784@inbox.vuxu.org> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-50989@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 1310 bytes --]
There is an updated pull request by sgn against master on the void-packages repository
https://github.com/sgn/void-packages verify-qt6-private-dep
https://github.com/void-linux/void-packages/pull/50989
hooks/post-install: check for -private-devel if PRIVATE_API is used
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**|**briefly**|**NO**
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/50989.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-verify-qt6-private-dep-50989.patch --]
[-- Type: text/x-diff, Size: 2455 bytes --]
From aa19b5d01e7451f1b0ee5174b6e0ed239b6d6e4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
<congdanhqx@gmail.com>
Date: Tue, 25 Jun 2024 20:49:38 +0700
Subject: [PATCH] hooks/post-install: check for -private-devel if PRIVATE_API
is used
---
.../hooks/post-install/15-qt-private-api.sh | 60 +++++++++++++++++++
1 file changed, 60 insertions(+)
create mode 100644 common/hooks/post-install/15-qt-private-api.sh
diff --git a/common/hooks/post-install/15-qt-private-api.sh b/common/hooks/post-install/15-qt-private-api.sh
new file mode 100644
index 00000000000000..aa6132d2f0858e
--- /dev/null
+++ b/common/hooks/post-install/15-qt-private-api.sh
@@ -0,0 +1,60 @@
+# vim: set ts=4 sw=4 et ft=bash :
+#
+# This hook execute the following tasks:
+# - warn if packages uses private Qt API but makedepends doesn't have
+# qt6-*-private-devel
+#
+# This hook only really target qt6-base-private-devel, a lot of packages
+# linked with Qt6::CorePrivate and Qt6::GuiPrivate, yet don't need its
+# headers.
+
+get_qt_private() {
+ local _elf _fn _lf
+ find ${PKGDESTDIR} -type f |
+ while read -r _fn; do
+ trap - ERR
+ _lf=${_fn#${PKGDESTDIR}}
+ if [ "${skiprdeps/${_lf}/}" != "${skiprdeps}" ]; then
+ continue
+ fi
+ read -n4 _elf < "$_fn"
+ if [ "$_elf" = $'\177ELF' ]; then
+ $OBJDUMP -p "$_fn" |
+ sed -n '
+ /required from /{s/.*required from \(.*\):/\1/;h;}
+ /Qt_[0-9]*_PRIVATE_API/{g;p;}
+ '
+ fi
+ done |
+ sort -u
+}
+
+
+hook() {
+ local _list _shlib _version _md _v _ok
+
+ if [ -n "$noverifyrdeps" ]; then
+ return 0
+ fi
+
+ _list=$(get_qt_private)
+ for _shlib in $_list; do
+ msg_normal "${pkgver}: requires PRIVATE_API from $_shlib\n"
+ done
+ _version=$(printf '%s\n' $_list | sed 's/^libQt\([0-9]*\).*/\1/' | grep -v '^5$' | uniq)
+ for _v in $_version; do
+ _ok=
+ for _md in ${makedepends}; do
+ case "${_md}" in
+ # Anything will works, because they're updated together
+ qt${_v}-*-private-devel)
+ _ok=yes
+ break
+ ;;
+ esac
+ done
+ if [ -z "$_ok" ]; then
+ msg_warn "${pkgver}: using Qt${_v}_PRIVATE_API but doesn't use qt${_v}-*-private-devel\n"
+ fi
+ done
+}
next prev parent reply other threads:[~2024-06-26 1:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-25 13:53 [PR PATCH] " sgn
2024-06-26 1:34 ` sgn [this message]
2024-06-26 1:36 ` [PR PATCH] [Updated] " sgn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240626013412.9AFF726784@inbox.vuxu.org \
--to=sgn@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).