commit:     0c1f012fee9a0314b29b6e0ac2dccabd2947974e
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Mon Dec  2 06:25:44 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Mon Dec  2 07:22:47 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0c1f012f

dev-qt/qtwayland: add 6.8.1

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-qt/qtwayland/Manifest                          |   1 +
 .../files/qtwayland-6.8.1-tablet-crash.patch       | 201 +++++++++++++++++++++
 dev-qt/qtwayland/qtwayland-6.8.1.ebuild            |  71 ++++++++
 3 files changed, 273 insertions(+)

diff --git a/dev-qt/qtwayland/Manifest b/dev-qt/qtwayland/Manifest
index 30b1ba742292..7e7fe5cd633d 100644
--- a/dev-qt/qtwayland/Manifest
+++ b/dev-qt/qtwayland/Manifest
@@ -5,3 +5,4 @@ DIST qtwayland-everywhere-opensource-src-5.15.16.tar.xz 561148 
BLAKE2B a09505124
 DIST qtwayland-everywhere-src-6.7.2.tar.xz 1123220 BLAKE2B 
70c2d8942afc4e1629d2ef34b6c062ecb5800185bb37e150c1d66a5216606028d2f59668991bddb5036572c962e92c3658d336167a7f9ffbf3d2f4d609a771f9
 SHA512 
2cd4f45f05ae60bc7f82b94f2e9c217ee4b8322f60381e1b079b90e0687e51cfbeb10b5dd724e1cca7e422b1b101d2b91c0ee47b1a732411cef330fb052c97c2
 DIST qtwayland-everywhere-src-6.7.3.tar.xz 1123508 BLAKE2B 
39cd8c7d2486318d3eb4351dc0e4e6a2c37e0aeb9727e2715accfec7ba2710288c251fdd5d6a71ba11c065509f7312c194a8e2b757d484ec1734270044e0d7aa
 SHA512 
9e15f3798ae7738b69e367343ffd7992fcdaebeffbcb10414fe2f24be553ca63e5504ef0a8405348702d0581dabebd1c2360728f63757c7445900b04df5e9ad7
 DIST qtwayland-everywhere-src-6.8.0.tar.xz 1133584 BLAKE2B 
2889e651544846e4f854fb34c4ec7a984ab2e88037a6eca0ff5b51ca04051d4ba0176b34afd3a224199e456fa3375e1df3bebd594fd95f8f98a811b47e1183e3
 SHA512 
6b2258928481813db7037bdbc817f57e14fc7ae66d2a791e03a4f1ebc1eea6ed36782206b3edcbf17e8fa0eb9f45f4d2583865b2b764e8ac303abac40764070c
+DIST qtwayland-everywhere-src-6.8.1.tar.xz 1134428 BLAKE2B 
84ebe923a3963f47bb2abe67e942524020be4d202b441d7cca689d045b7a7ca28b433df5a189da766743c6817a327b6ba80ceb7916a99b3ba9b0508daede4147
 SHA512 
34885910532f6049cac09846aa4295e2ce82a1e6af2d3256391c835a406f0c6f679e9c94c06ca8921acf23036ccc747812631a91dc1f355ab20aafd8836e7312

diff --git a/dev-qt/qtwayland/files/qtwayland-6.8.1-tablet-crash.patch 
b/dev-qt/qtwayland/files/qtwayland-6.8.1-tablet-crash.patch
new file mode 100644
index 000000000000..8d2a5c89dd4c
--- /dev/null
+++ b/dev-qt/qtwayland/files/qtwayland-6.8.1-tablet-crash.patch
@@ -0,0 +1,201 @@
+Recommended backport of [1] by the kde community[2] to avoid several crashes
+when unplugging a tablet (missed the 6.8.1 window, will be in 6.8.2).
+
+[1] 
https://github.com/qt/qtwayland/commit/24002ac6cbd01dbde4944b63c1f7c87ed2bd72b5
+[2] https://mail.kde.org/pipermail/distributions/2024-November/001550.html
+--- a/src/client/qwaylandtabletv2.cpp
++++ b/src/client/qwaylandtabletv2.cpp
+@@ -188,10 +188,4 @@
+ QWaylandTabletSeatV2::~QWaylandTabletSeatV2()
+ {
+-    for (auto *tablet : m_tablets)
+-        tablet->destroy();
+-    for (auto *tool : m_tools)
+-        tool->destroy();
+-    for (auto *pad : m_pads)
+-        pad->destroy();
+     qDeleteAll(m_tablets);
+     qDeleteAll(m_tools);
+@@ -255,4 +249,9 @@
+ }
+ 
++QWaylandTabletV2::~QWaylandTabletV2()
++{
++    destroy();
++}
++
+ void QWaylandTabletV2::zwp_tablet_v2_name(const QString &name)
+ {
+@@ -293,5 +292,4 @@
+ void QWaylandTabletV2::zwp_tablet_v2_removed()
+ {
+-    destroy();
+     deleteLater();
+ }
+@@ -317,5 +315,8 @@
+ }
+ 
+-QWaylandTabletToolV2::~QWaylandTabletToolV2() = default;
++QWaylandTabletToolV2::~QWaylandTabletToolV2()
++{
++    destroy();
++}
+ 
+ void QWaylandTabletToolV2::zwp_tablet_tool_v2_type(uint32_t tool_type)
+@@ -411,5 +412,4 @@
+ void QWaylandTabletToolV2::zwp_tablet_tool_v2_removed()
+ {
+-    destroy();
+     m_tabletSeat->toolRemoved(this);
+ }
+@@ -603,4 +603,9 @@
+ }
+ 
++QWaylandTabletPadV2::~QWaylandTabletPadV2()
++{
++    destroy();
++}
++
+ void QWaylandTabletPadV2::zwp_tablet_pad_v2_path(const QString &path)
+ {
+@@ -622,5 +627,4 @@
+ void QWaylandTabletPadV2::zwp_tablet_pad_v2_removed()
+ {
+-    destroy();
+     delete this;
+ }
+--- a/src/client/qwaylandtabletv2_p.h
++++ b/src/client/qwaylandtabletv2_p.h
+@@ -84,4 +84,5 @@
+ public:
+     explicit QWaylandTabletV2(::zwp_tablet_v2 *tablet, const QString 
&seatName);
++    ~QWaylandTabletV2();
+ 
+ protected:
+@@ -99,5 +100,5 @@
+ public:
+     QWaylandTabletToolV2(QWaylandTabletSeatV2 *tabletSeat, 
::zwp_tablet_tool_v2 *tool);
+-    ~QWaylandTabletToolV2() override;
++    ~QWaylandTabletToolV2();
+ 
+     void updateCursor();
+@@ -182,4 +183,5 @@
+ public:
+     explicit QWaylandTabletPadV2(::zwp_tablet_pad_v2 *pad);
++    ~QWaylandTabletPadV2();
+ 
+ protected:
+--- a/tests/auto/client/tabletv2/tst_tabletv2.cpp
++++ b/tests/auto/client/tabletv2/tst_tabletv2.cpp
+@@ -187,7 +187,7 @@
+     QList<TabletV2 *> m_tabletsWaitingForDestroy;
+     QList<TabletToolV2 *> m_tools;
+-    QList<TabletToolV2 *> m_toolsWaitingForDestroy;
++    QList<TabletToolV2::Resource *> m_toolsWaitingForDestroy;
+     QList<TabletPadV2 *> m_pads;
+-    QList<TabletPadV2 *> m_padsWaitingForDestroy;
++    QList<TabletPadV2::Resource *> m_padsWaitingForDestroy;
+ 
+ protected:
+@@ -275,9 +275,10 @@
+ void TabletToolV2::sendRemoved()
+ {
+-    for (auto *resource : resourceMap())
++    for (auto *resource : resourceMap()) {
+         zwp_tablet_tool_v2_send_removed(resource->handle);
++        m_tabletSeat->m_toolsWaitingForDestroy.append(resource);
++    }
+     bool removed = m_tabletSeat->m_tools.removeOne(this);
+     QVERIFY(removed);
+-    m_tabletSeat->m_toolsWaitingForDestroy.append(this);
+ }
+ 
+@@ -334,6 +335,5 @@
+ {
+     if (m_tabletSeat) {
+-        bool removed = m_tabletSeat->m_toolsWaitingForDestroy.removeOne(this);
+-        QVERIFY(removed);
++        m_tabletSeat->m_toolsWaitingForDestroy.removeOne(resource);
+     }
+     wl_resource_destroy(resource->handle);
+@@ -342,9 +342,10 @@
+ void TabletPadV2::sendRemoved()
+ {
+-    for (auto *resource : resourceMap())
++    for (auto *resource : resourceMap()) {
+         zwp_tablet_pad_v2_send_removed(resource->handle);
++        m_tabletSeat->m_padsWaitingForDestroy.append(resource);
++    }
+     bool removed = m_tabletSeat->m_pads.removeOne(this);
+     QVERIFY(removed);
+-    m_tabletSeat->m_padsWaitingForDestroy.append(this);
+ }
+ 
+@@ -352,6 +353,5 @@
+ {
+     if (m_tabletSeat) {
+-        bool removed = m_tabletSeat->m_padsWaitingForDestroy.removeOne(this);
+-        QVERIFY(removed);
++        m_tabletSeat->m_padsWaitingForDestroy.removeOne(resource);
+     }
+     wl_resource_destroy(resource->handle);
+@@ -406,4 +406,6 @@
+     void destroysTool();
+     void destroysPad();
++    void removeTabletBeforeTool();
++    void removeTabletBeforePad();
+     void proximityEvents();
+     void moveEvent();
+@@ -503,4 +505,5 @@
+     QCOMPOSITOR_TRY_VERIFY(tabletSeat());
+     exec([&] {
++        tabletSeat()->addTablet();
+         tabletSeat()->addTool();
+     });
+@@ -509,4 +512,5 @@
+     exec([&] {
+         tabletTool()->sendRemoved();
++        tablet()->sendRemoved();
+     });
+ 
+@@ -529,4 +533,40 @@
+     QCOMPOSITOR_TRY_VERIFY(!tabletPad());
+     QCOMPOSITOR_TRY_VERIFY(tabletSeat()->m_padsWaitingForDestroy.empty());
++}
++
++void tst_tabletv2::removeTabletBeforeTool()
++{
++    QCOMPOSITOR_TRY_VERIFY(tabletSeat());
++    exec([&] {
++        tabletSeat()->addTablet();
++        tabletSeat()->addTool();
++    });
++    QCOMPOSITOR_TRY_VERIFY(tablet());
++    QCOMPOSITOR_TRY_VERIFY(tabletTool());
++
++    exec([&] { tablet()->sendRemoved(); });
++    QCOMPOSITOR_TRY_VERIFY(tabletSeat()->m_tabletsWaitingForDestroy.empty());
++
++    exec([&] { tabletTool()->sendRemoved(); });
++    QCOMPOSITOR_TRY_VERIFY(!tabletTool());
++    QCOMPOSITOR_TRY_VERIFY(tabletSeat()->m_toolsWaitingForDestroy.empty());
++}
++
++void tst_tabletv2::removeTabletBeforePad()
++{
++    QCOMPOSITOR_TRY_VERIFY(tabletSeat());
++    exec([&] {
++        tabletSeat()->addTablet();
++        tabletSeat()->addPad();
++    });
++    QCOMPOSITOR_TRY_VERIFY(tablet());
++    QCOMPOSITOR_TRY_VERIFY(tabletPad());
++
++    exec([&] { tablet()->sendRemoved(); });
++    QCOMPOSITOR_TRY_VERIFY(tabletSeat()->m_tabletsWaitingForDestroy.empty());
++
++    exec([&] { tabletPad()->sendRemoved(); });
++    QCOMPOSITOR_TRY_VERIFY(!tabletPad());
++    QCOMPOSITOR_TRY_VERIFY(tabletSeat()->m_padsWaitingForDestroy.empty());
+ }
+ 

diff --git a/dev-qt/qtwayland/qtwayland-6.8.1.ebuild 
b/dev-qt/qtwayland/qtwayland-6.8.1.ebuild
new file mode 100644
index 000000000000..1bfb6f2909f1
--- /dev/null
+++ b/dev-qt/qtwayland/qtwayland-6.8.1.ebuild
@@ -0,0 +1,71 @@
+# Copyright 2021-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit qt6-build
+
+DESCRIPTION="Wayland platform plugin for Qt"
+
+if [[ ${QT6_BUILD_TYPE} == release ]]; then
+       KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
+fi
+
+IUSE="accessibility compositor gnome qml vulkan"
+
+RDEPEND="
+       dev-libs/wayland
+       ~dev-qt/qtbase-${PV}:6[accessibility=,gui,opengl,vulkan=,wayland]
+       media-libs/libglvnd
+       x11-libs/libxkbcommon
+       compositor? (
+               qml? ( ~dev-qt/qtdeclarative-${PV}:6 )
+       )
+       gnome? (
+               ~dev-qt/qtbase-${PV}:6[dbus]
+               ~dev-qt/qtsvg-${PV}:6
+       )
+"
+DEPEND="
+       ${RDEPEND}
+       vulkan? ( dev-util/vulkan-headers )
+"
+BDEPEND="dev-util/wayland-scanner"
+
+CMAKE_SKIP_TESTS=(
+       # segfaults for not-looked-into reasons, but not considered
+       # an issue given >=seatv5 exists since wayland-1.10 (2016)
+       tst_seatv4
+       # needs a compositor/opengl, skip the extra trouble
+       tst_surface
+       tst_xdgdecorationv1
+       # known failing with wayland-1.23.0 (or at least with offscreen), not
+       # believed to result in critical runtime issues so skip until this is
+       # looked at upstream (https://bugreports.qt.io/browse/QTBUG-126379)
+       tst_client
+       tst_compositor
+       tst_scaling
+)
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-6.8.0-wayland.xml-1.23.0.patch
+       "${FILESDIR}"/${PN}-6.8.1-tablet-crash.patch
+)
+
+src_configure() {
+       local mycmakeargs=(
+               $(cmake_use_find_package qml Qt6Quick)
+               $(qt_feature compositor wayland_server)
+               $(qt_feature gnome wayland_decoration_adwaita)
+       )
+
+       qt6-build_src_configure
+}
+
+src_test() {
+       # users' session setting may break tst_clientextension (bug #927030)
+       unset DESKTOP_SESSION XDG_CURRENT_DESKTOP
+       unset GNOME_DESKTOP_SESSION_ID KDE_FULL_SESSION
+
+       qt6-build_src_test
+}

Reply via email to