commit:     b1822ea2cd608bd8daecd07a3eb145aeffa031d0
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  7 04:58:39 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jun  7 04:58:39 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b1822ea2

app-text/calibre: fix build w/ qt-6.9

I'm leaving the PR to bump calibe to Eli, naturally, but doing this
now to get the build fixed (especially important to not hold up :=
builds which can be messy).

Closes: https://bugs.gentoo.org/957106
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-text/calibre/calibre-7.26.0.ebuild            |  2 ++
 app-text/calibre/files/calibre-7.26.0-qt6.9.patch | 44 +++++++++++++++++++++++
 2 files changed, 46 insertions(+)

diff --git a/app-text/calibre/calibre-7.26.0.ebuild 
b/app-text/calibre/calibre-7.26.0.ebuild
index f81f2ecbe6b4..b7de420a9299 100644
--- a/app-text/calibre/calibre-7.26.0.ebuild
+++ b/app-text/calibre/calibre-7.26.0.ebuild
@@ -126,6 +126,8 @@ PATCHES=(
        # We don't (yet?) package libjxr and it seems to be dead upstream
        # (last commit in 2017)
        "${FILESDIR}/${PN}-7.0.0-jxr-test.patch"
+       # Backport to fix build w/ qt-6.9 (bug #957106)
+       "${FILESDIR}/${P}-qt6.9.patch"
 )
 
 src_prepare() {

diff --git a/app-text/calibre/files/calibre-7.26.0-qt6.9.patch 
b/app-text/calibre/files/calibre-7.26.0-qt6.9.patch
new file mode 100644
index 000000000000..ff2f94d98213
--- /dev/null
+++ b/app-text/calibre/files/calibre-7.26.0-qt6.9.patch
@@ -0,0 +1,44 @@
+https://bugs.gentoo.org/957106
+https://github.com/kovidgoyal/calibre/commit/30b66dc452d3c08c7e10cc95498e131348d7bbfb
+
+From 30b66dc452d3c08c7e10cc95498e131348d7bbfb Mon Sep 17 00:00:00 2001
+From: Kovid Goyal <[email protected]>
+Date: Sat, 5 Apr 2025 02:59:58 +0530
+Subject: [PATCH] Linux: Fix building with Qt 6.9
+
+---
+ src/calibre/headless/headless_integration.cpp | 6 ++++++
+ src/calibre/headless/headless_integration.h   | 1 -
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/src/calibre/headless/headless_integration.cpp 
b/src/calibre/headless/headless_integration.cpp
+index a5dfc869cc66..e96ddeef80fa 100644
+--- a/src/calibre/headless/headless_integration.cpp
++++ b/src/calibre/headless/headless_integration.cpp
+@@ -27,7 +27,13 @@ QT_BEGIN_NAMESPACE
+ 
+ 
+ #ifndef __APPLE__
++#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
++#include <QtGui/private/qgenericunixservices_p.h>
+ class GenericUnixServices : public QGenericUnixServices {
++#else
++#include <QtGui/private/qdesktopunixservices_p.h>
++class GenericUnixServices : public QDesktopUnixServices {
++#endif
+     /* We must return desktop environment as UNKNOWN otherwise other parts of
+      * Qt will try to query the nativeInterface() without checking if it 
exists
+      * leading to a segfault.  For example, defaultHintStyleFromMatch() 
queries
+diff --git a/src/calibre/headless/headless_integration.h 
b/src/calibre/headless/headless_integration.h
+index f8705facffe8..604669677da4 100644
+--- a/src/calibre/headless/headless_integration.h
++++ b/src/calibre/headless/headless_integration.h
+@@ -3,7 +3,6 @@
+ #include <qpa/qplatformintegration.h>
+ #include <qpa/qplatformscreen.h>
+ #include <qpa/qplatformservices.h>
+-#include <QtGui/private/qgenericunixservices_p.h>
+ #include <QScopedPointer>
+ 
+ QT_BEGIN_NAMESPACE
+

Reply via email to