Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] hooks/post-install: check for -private-devel if PRIVATE_API is used
@ 2024-06-25 13:53 sgn
  2024-06-26  1:34 ` [PR PATCH] [Updated] " sgn
  2024-06-26  1:36 ` sgn
  0 siblings, 2 replies; 3+ messages in thread
From: sgn @ 2024-06-25 13:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1305 bytes --]

There is a new 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: 2492 bytes --]

From 532f66b689a7c6b775aa86b4c358d1a2a8f4bc57 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..41ff748abbfe06
--- /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/{s/.*\(Qt_[0-9]*_PRIVATE_API\).*/\1 /;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
+}

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PR PATCH] [Updated] hooks/post-install: check for -private-devel if PRIVATE_API is used
  2024-06-25 13:53 [PR PATCH] hooks/post-install: check for -private-devel if PRIVATE_API is used sgn
@ 2024-06-26  1:34 ` sgn
  2024-06-26  1:36 ` sgn
  1 sibling, 0 replies; 3+ messages in thread
From: sgn @ 2024-06-26  1:34 UTC (permalink / raw)
  To: ml

[-- 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
+}

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PR PATCH] [Updated] hooks/post-install: check for -private-devel if PRIVATE_API is used
  2024-06-25 13:53 [PR PATCH] hooks/post-install: check for -private-devel if PRIVATE_API is used sgn
  2024-06-26  1:34 ` [PR PATCH] [Updated] " sgn
@ 2024-06-26  1:36 ` sgn
  1 sibling, 0 replies; 3+ messages in thread
From: sgn @ 2024-06-26  1:36 UTC (permalink / raw)
  To: ml

[-- 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: 2467 bytes --]

From 3343f0e197beebe7c8999c72797f12b2c327d90a 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..18f3576e7037b8
--- /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
+}

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-26  1:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-25 13:53 [PR PATCH] hooks/post-install: check for -private-devel if PRIVATE_API is used sgn
2024-06-26  1:34 ` [PR PATCH] [Updated] " sgn
2024-06-26  1:36 ` sgn

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).