commit:     6f8ce597230db2ab9960c1564978faf37d17e13b
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 11 21:27:33 2026 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Jan 11 21:34:49 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6f8ce597

sci-astronomy/kstars: Fix build w/ Qt 6.10 and IUSE test

Apply upstream's "OpenSuSE" build fix.

Bug: https://bugs.gentoo.org/968565
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../kstars/files/kstars-3.8.0-qt-6.10.patch        | 83 ++++++++++++++++++++++
 sci-astronomy/kstars/kstars-3.8.0.ebuild           |  3 +-
 2 files changed, 85 insertions(+), 1 deletion(-)

diff --git a/sci-astronomy/kstars/files/kstars-3.8.0-qt-6.10.patch 
b/sci-astronomy/kstars/files/kstars-3.8.0-qt-6.10.patch
new file mode 100644
index 000000000000..5313fbe22757
--- /dev/null
+++ b/sci-astronomy/kstars/files/kstars-3.8.0-qt-6.10.patch
@@ -0,0 +1,83 @@
+From 6f343c854d9f19d9fb625456e87da01a760d80fe Mon Sep 17 00:00:00 2001
+From: Wolfgang Reissenberger <[email protected]>
+Date: Mon, 5 Jan 2026 09:53:04 +0000
+Subject: [PATCH] Bugfix for OpenSuSE build
+
+Weakness in Eigen call fixed
+---
+ Tests/kstars_ui/test_ekos_helper.h                 | 14 +++++++++++++-
+ datahandlers/ksparser.cpp                          |  4 ++--
+ .../MPI_IS_gaussian_process/src/math_tools.cpp     |  2 +-
+ 3 files changed, 16 insertions(+), 4 deletions(-)
+
+diff --git a/Tests/kstars_ui/test_ekos_helper.h 
b/Tests/kstars_ui/test_ekos_helper.h
+index 4a041ad53f..ab7d35eb2a 100644
+--- a/Tests/kstars_ui/test_ekos_helper.h
++++ b/Tests/kstars_ui/test_ekos_helper.h
+@@ -71,15 +71,27 @@ do {\
+   * @brief Subroutine version of QTRY_TIMEOUT_DEBUG_IMPL
+   * @return false if expression equals false, otherwise continuing
+   */
++#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ #define KTRY_TIMEOUT_DEBUG_IMPL_SUB(expr, timeoutValue, step)\
+     if (!(expr)) { \
+         QTRY_LOOP_IMPL((expr), (2 * timeoutValue), step);\
+         if (expr) { \
+             QString msg = QString::fromUtf8("QTestLib: This test case check 
(\"%1\") failed because the requested timeout (%2 ms) was too short, %3 ms 
would have been sufficient this time."); \
+-            msg = 
msg.arg(QString::fromUtf8(#expr)).arg(timeoutValue).arg(timeoutValue + 
qt_test_i); \
++            msg = msg.arg(QString::fromUtf8(#expr)).arg(timeoutValue + 
qt_test_i); \
+             KVERIFY2_SUB(false, qPrintable(msg)); \
+         } \
+     }
++#else
++#define KTRY_TIMEOUT_DEBUG_IMPL_SUB(expr, timeoutValue, step)\
++    if (!(expr)) { \
++        QTRY_LOOP_IMPL((expr), (2 * timeoutValue), step);\
++        if (expr) { \
++            QString msg = QString::fromUtf8("QTestLib: This test case check 
(\"%1\") failed because the requested timeout (%2 ms) was too short, %3 ms 
would have been sufficient this time."); \
++            msg = msg.arg(QString::fromUtf8(#expr)).arg(timeoutValue + 
static_cast<int>(qt_test_i.count())); \
++            KVERIFY2_SUB(false, qPrintable(msg)); \
++        } \
++    }
++#endif
+ 
+ /**
+   * @brief Subroutine version of QTRY_IMPL
+diff --git a/datahandlers/ksparser.cpp b/datahandlers/ksparser.cpp
+index 0cce622101..e44c14cb05 100644
+--- a/datahandlers/ksparser.cpp
++++ b/datahandlers/ksparser.cpp
+@@ -66,7 +66,7 @@ QHash<QString, QVariant> KSParser::ReadCSVRow()
+     while (file_reader_.hasMoreLines() && read_success == false)
+     {
+         next_line = file_reader_.readLine();
+-        if (next_line.mid(0, 1)[0] == comment_char_)
++        if (next_line.isEmpty() || next_line.mid(0, 1)[0] == comment_char_)
+             continue;
+         separated = next_line.split(delimiter_);
+         /*
+@@ -155,7 +155,7 @@ QHash<QString, QVariant> KSParser::ReadFixedWidthRow()
+          *             conversion
+         */
+         next_line = file_reader_.readLine();
+-        if (next_line.mid(0, 1)[0] == comment_char_)
++        if (next_line.isEmpty() || next_line.mid(0, 1)[0] == comment_char_)
+             continue;
+         if (next_line.length() < total_min_length)
+             continue;
+diff --git 
a/kstars/ekos/guide/internalguide/MPI_IS_gaussian_process/src/math_tools.cpp 
b/kstars/ekos/guide/internalguide/MPI_IS_gaussian_process/src/math_tools.cpp
+index 9f8b2b7be2..82cfb327ba 100644
+--- 
a/kstars/ekos/guide/internalguide/MPI_IS_gaussian_process/src/math_tools.cpp
++++ 
b/kstars/ekos/guide/internalguide/MPI_IS_gaussian_process/src/math_tools.cpp
+@@ -72,7 +72,7 @@ Eigen::MatrixXd squareDistance(const Eigen::MatrixXd &a, 
const Eigen::MatrixXd &
+     return
+         
((am.array().square().colwise().sum().transpose().rowwise().replicate(bCols).matrix()
+           + 
bm.array().square().colwise().sum().colwise().replicate(aCols).matrix())
+-         - 2 * (am.transpose()) * bm).array().max(0);
++         - 2 * (am.transpose()) * bm).array().max(0.0);
+ 
+     /* // verbose version
+     Eigen::MatrixXd a_square =
+-- 
+GitLab
+

diff --git a/sci-astronomy/kstars/kstars-3.8.0.ebuild 
b/sci-astronomy/kstars/kstars-3.8.0.ebuild
index a472eed03151..a8bd1e579144 100644
--- a/sci-astronomy/kstars/kstars-3.8.0.ebuild
+++ b/sci-astronomy/kstars/kstars-3.8.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2025 Gentoo Authors
+# Copyright 1999-2026 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -77,6 +77,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-3.7.4-cmake.patch # bug 895892, downstream patch
        "${FILESDIR}"/${P}-cmake.patch # MR #1610 pending upstream
        "${FILESDIR}"/${P}-gcc15.patch # fixed in 3.8.1
+       "${FILESDIR}"/${P}-qt-6.10.patch # fixed in 3.8.1
 )
 
 src_configure() {

Reply via email to