commit:     279662795d75124e563076418e6d40fe9175c8ae
Author:     Z. Liu <zhixu.liu <AT> gmail <DOT> com>
AuthorDate: Fri Jul  4 11:22:45 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jul  4 18:35:09 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=27966279

net-misc/seafile-client: fix building with Qt 6.9

& update cmake minimum required to 3.20

Closes: https://bugs.gentoo.org/959311
Closes: https://bugs.gentoo.org/959347
Signed-off-by: Z. Liu <zhixu.liu <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/42860
Closes: https://github.com/gentoo/gentoo/pull/42860
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/seafile-client-9.0.13-CMakeLists.patch   | 13 ++++
 .../files/seafile-client-9.0.13-QJsonValue.patch   | 81 ++++++++++++++++++++++
 .../seafile-client/seafile-client-9.0.13.ebuild    |  2 +
 3 files changed, 96 insertions(+)

diff --git 
a/net-misc/seafile-client/files/seafile-client-9.0.13-CMakeLists.patch 
b/net-misc/seafile-client/files/seafile-client-9.0.13-CMakeLists.patch
new file mode 100644
index 000000000000..32ed2b55fa35
--- /dev/null
+++ b/net-misc/seafile-client/files/seafile-client-9.0.13-CMakeLists.patch
@@ -0,0 +1,13 @@
+https://github.com/haiwen/seafile-client/issues/1615
+
+upstream won't change the minimum version soon
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3bb58761..58af8e15 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9)
++CMAKE_MINIMUM_REQUIRED(VERSION 3.20)
+ 
+ PROJECT(seafile-client)
+ SET(SEAFILE_CLIENT_VERSION_MAJOR 9)

diff --git 
a/net-misc/seafile-client/files/seafile-client-9.0.13-QJsonValue.patch 
b/net-misc/seafile-client/files/seafile-client-9.0.13-QJsonValue.patch
new file mode 100644
index 000000000000..ddd709a0d01b
--- /dev/null
+++ b/net-misc/seafile-client/files/seafile-client-9.0.13-QJsonValue.patch
@@ -0,0 +1,81 @@
+https://github.com/haiwen/seafile-client/pull/1634
+
+From 2d98f6b91b50f12e7908623cbb0ddc0c76022655 Mon Sep 17 00:00:00 2001
+From: "Z. Liu" <[email protected]>
+Date: Thu, 3 Jul 2025 23:29:00 +0800
+Subject: [PATCH] QJsonValue is required since Qt 6.9
+
+otherwise, build will fail with:
+
+src/message-poller.cpp:247:28: error: variable has incomplete type 
'QRegularExpression'
+  247 |         QRegularExpression re("Deleted \"(.+)\" and (.+) more files.");
+      |                            ^
+/usr/include/qt6/QtCore/qstringfwd.h:44:7: note: forward declaration of 
'QRegularExpression'
+   44 | class QRegularExpression;
+      |       ^
+src/message-poller.cpp:248:34: error: calling 'operator[]' with incomplete 
return type 'const QJsonValue'
+  248 |         auto match = 
re.match(doc["delete_files"].toString().trimmed());
+      |                               ~~~^~~~~~~~~~~~~~~~
+/usr/include/qt6/QtCore/qjsondocument.h:89:22: note: 'operator[]' declared here
+   89 |     const QJsonValue operator[](const QString &key) const;
+      |                      ^
+/usr/include/qt6/QtCore/qmetatype.h:1544:1: note: forward declaration of 
'QJsonValue'
+ 1544 | QT_FOR_EACH_STATIC_CORE_CLASS(QT_FORWARD_DECLARE_STATIC_TYPES_ITER)
+      | ^
+/usr/include/qt6/QtCore/qmetatype.h:126:23: note: expanded from macro 
'QT_FOR_EACH_STATIC_CORE_CLASS'
+  126 |     F(QJsonValue, 45, QJsonValue) \
+      |                       ^
+src/message-poller.cpp:255:35: error: calling 'operator[]' with incomplete 
return type 'const QJsonValue'
+  255 |                           .arg(doc["repo_name"].toString().trimmed());
+      |                                ~~~^~~~~~~~~~~~~
+/usr/include/qt6/QtCore/qjsondocument.h:89:22: note: 'operator[]' declared here
+   89 |     const QJsonValue operator[](const QString &key) const;
+      |                      ^
+/usr/include/qt6/QtCore/qmetatype.h:1544:1: note: forward declaration of 
'QJsonValue'
+ 1544 | QT_FOR_EACH_STATIC_CORE_CLASS(QT_FORWARD_DECLARE_STATIC_TYPES_ITER)
+      | ^
+/usr/include/qt6/QtCore/qmetatype.h:126:23: note: expanded from macro 
'QT_FOR_EACH_STATIC_CORE_CLASS'
+  126 |     F(QJsonValue, 45, QJsonValue) \
+      |                       ^
+src/message-poller.cpp:258:48: error: calling 'operator[]' with incomplete 
return type 'const QJsonValue'
+  258 |             
rpc_client_->addDelConfirmation(doc["confirmation_id"].toString(), false);
+      |                                             ~~~^~~~~~~~~~~~~~~~~~~
+/usr/include/qt6/QtCore/qjsondocument.h:89:22: note: 'operator[]' declared here
+   89 |     const QJsonValue operator[](const QString &key) const;
+      |                      ^
+/usr/include/qt6/QtCore/qmetatype.h:1544:1: note: forward declaration of 
'QJsonValue'
+ 1544 | QT_FOR_EACH_STATIC_CORE_CLASS(QT_FORWARD_DECLARE_STATIC_TYPES_ITER)
+      | ^
+/usr/include/qt6/QtCore/qmetatype.h:126:23: note: expanded from macro 
'QT_FOR_EACH_STATIC_CORE_CLASS'
+  126 |     F(QJsonValue, 45, QJsonValue) \
+      |                       ^
+src/message-poller.cpp:260:48: error: calling 'operator[]' with incomplete 
return type 'const QJsonValue'
+  260 |             
rpc_client_->addDelConfirmation(doc["confirmation_id"].toString(), true);
+      |                                             ~~~^~~~~~~~~~~~~~~~~~~
+/usr/include/qt6/QtCore/qjsondocument.h:89:22: note: 'operator[]' declared here
+   89 |     const QJsonValue operator[](const QString &key) const;
+      |                      ^
+/usr/include/qt6/QtCore/qmetatype.h:1544:1: note: forward declaration of 
'QJsonValue'
+ 1544 | QT_FOR_EACH_STATIC_CORE_CLASS(QT_FORWARD_DECLARE_STATIC_TYPES_ITER)
+      | ^
+/usr/include/qt6/QtCore/qmetatype.h:126:23: note: expanded from macro 
'QT_FOR_EACH_STATIC_CORE_CLASS'
+  126 |     F(QJsonValue, 45, QJsonValue) \
+      |                       ^
+
+Signed-off-by: Z. Liu <[email protected]>
+
+diff --git a/src/message-poller.cpp b/src/message-poller.cpp
+index 2ab32c50..2392bfba 100644
+--- a/src/message-poller.cpp
++++ b/src/message-poller.cpp
+@@ -1,6 +1,7 @@
+ #include <QTimer>
+ #include <QDateTime>
+ #include <QJsonDocument>
++#include <QJsonValue>
+ 
+ #include "utils/utils.h"
+ #include "utils/translate-commit-desc.h"
+-- 
+2.45.2
+

diff --git a/net-misc/seafile-client/seafile-client-9.0.13.ebuild 
b/net-misc/seafile-client/seafile-client-9.0.13.ebuild
index 39c21d632ce3..f0332eb4cea8 100644
--- a/net-misc/seafile-client/seafile-client-9.0.13.ebuild
+++ b/net-misc/seafile-client/seafile-client-9.0.13.ebuild
@@ -36,6 +36,8 @@ BDEPEND="dev-qt/qttools:6[linguist]"
 PATCHES=(
        "${FILESDIR}/${PN}-9.0.11-select-qt6.patch"
        "${FILESDIR}/${PN}-9.0.13-remove-qtwebengine.patch"
+       "${FILESDIR}/${PN}-9.0.13-QJsonValue.patch"
+       "${FILESDIR}/${PN}-9.0.13-CMakeLists.patch"
 )
 
 src_configure() {

Reply via email to