summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2023-08-14 15:53:41 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2023-08-14 15:56:11 +0200
commit04932d9fd380df7153152c2041b02a9f4b8ba2fc (patch)
tree9f780ecbca2346066b5b7c2c56a6ed5bc82c640c /kde-plasma/libksysguard
parentnet-misc/ena-driver: add 2.8.9 (diff)
downloadgentoo-04932d9fd380df7153152c2041b02a9f4b8ba2fc.tar.gz
gentoo-04932d9fd380df7153152c2041b02a9f4b8ba2fc.tar.bz2
gentoo-04932d9fd380df7153152c2041b02a9f4b8ba2fc.zip
kde-plasma/libksysguard: sensors: Correctly handle the return value
...of QCollator::compare Fixes: sensor list in system monitor are changed every time and not correct with C locale KDE-bug: https://bugs.kde.org/show_bug.cgi?id=461070 Bug: https://bugs.gentoo.org/911788 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'kde-plasma/libksysguard')
-rw-r--r--kde-plasma/libksysguard/files/libksysguard-5.27.7-sensors-correctly-handle-return-val.patch36
-rw-r--r--kde-plasma/libksysguard/libksysguard-5.27.7-r1.ebuild79
2 files changed, 115 insertions, 0 deletions
diff --git a/kde-plasma/libksysguard/files/libksysguard-5.27.7-sensors-correctly-handle-return-val.patch b/kde-plasma/libksysguard/files/libksysguard-5.27.7-sensors-correctly-handle-return-val.patch
new file mode 100644
index 000000000000..599648228272
--- /dev/null
+++ b/kde-plasma/libksysguard/files/libksysguard-5.27.7-sensors-correctly-handle-return-val.patch
@@ -0,0 +1,36 @@
+From bf2685a3628f213e930743676a6d713e630c6a59 Mon Sep 17 00:00:00 2001
+From: Maciej Stanczew <maciej.stanczew@gmail.com>
+Date: Sun, 6 Aug 2023 20:23:01 +0200
+Subject: [PATCH] sensors: Correctly handle the return value of
+ QCollator::compare
+
+QCollator::compare() can return any integer, not just [-1, 0, 1].
+Comparing the result with -1 happened to work with most locales,
+but it broke with the C locale. As a result, when sensors were put
+into std::map, they were sometimes erroneously treated as duplicates,
+leading to a randomly incomplete and garbled sensor list.
+
+BUG: 461070
+
+
+(cherry picked from commit 0a7efca4b331eb9619a2a88fe9093cbbbd351b6e)
+---
+ sensors/SensorTreeModel.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sensors/SensorTreeModel.cpp b/sensors/SensorTreeModel.cpp
+index 6f318035..8487730b 100644
+--- a/sensors/SensorTreeModel.cpp
++++ b/sensors/SensorTreeModel.cpp
+@@ -44,7 +44,7 @@ struct Compare {
+ collator->setCaseSensitivity(Qt::CaseInsensitive);
+ }
+
+- return collator->compare(first, second) == -1;
++ return collator->compare(first, second) < 0;
+ }
+
+ // This uses thread-local storage because QCollator may not be thread safe.
+--
+GitLab
+
diff --git a/kde-plasma/libksysguard/libksysguard-5.27.7-r1.ebuild b/kde-plasma/libksysguard/libksysguard-5.27.7-r1.ebuild
new file mode 100644
index 000000000000..7d102918a2db
--- /dev/null
+++ b/kde-plasma/libksysguard/libksysguard-5.27.7-r1.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ECM_DESIGNERPLUGIN="true"
+ECM_TEST="true"
+KFMIN=5.106.0
+QTMIN=5.15.9
+inherit ecm plasma.kde.org
+
+DESCRIPTION="Task management and system monitoring library"
+
+LICENSE="LGPL-2+"
+SLOT="5/9"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
+IUSE="webengine"
+
+# kde-frameworks/kwindowsystem[X]: Unconditional use of KX11Extras
+COMMON_DEPEND="
+ dev-libs/libnl:3
+ >=dev-qt/qtdbus-${QTMIN}:5
+ >=dev-qt/qtdeclarative-${QTMIN}:5
+ >=dev-qt/qtgui-${QTMIN}:5
+ >=dev-qt/qtnetwork-${QTMIN}:5
+ >=dev-qt/qtwidgets-${QTMIN}:5
+ >=dev-qt/qtx11extras-${QTMIN}:5
+ >=kde-frameworks/kauth-${KFMIN}:5
+ >=kde-frameworks/kcompletion-${KFMIN}:5
+ >=kde-frameworks/kconfig-${KFMIN}:5[qml]
+ >=kde-frameworks/kconfigwidgets-${KFMIN}:5
+ >=kde-frameworks/kcoreaddons-${KFMIN}:5
+ >=kde-frameworks/ki18n-${KFMIN}:5
+ >=kde-frameworks/kjobwidgets-${KFMIN}:5
+ >=kde-frameworks/knewstuff-${KFMIN}:5
+ >=kde-frameworks/kpackage-${KFMIN}:5
+ >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
+ >=kde-frameworks/kwindowsystem-${KFMIN}:5[X]
+ net-libs/libpcap
+ sys-apps/lm-sensors:=
+ sys-libs/libcap
+ sys-libs/zlib
+ x11-libs/libX11
+ x11-libs/libXres
+ webengine? (
+ >=dev-qt/qtwebchannel-${QTMIN}:5
+ >=dev-qt/qtwebengine-${QTMIN}:5
+ )
+"
+DEPEND="${COMMON_DEPEND}
+ >=kde-frameworks/kiconthemes-${KFMIN}:5
+ x11-base/xorg-proto
+"
+RDEPEND="${COMMON_DEPEND}
+ !<kde-plasma/ksysguard-5.21.90:5
+"
+
+PATCHES=(
+ # downstream patch
+ "${FILESDIR}/${PN}-5.22.80-no-detailed-mem-message.patch"
+ "${FILESDIR}/${P}-sensors-correctly-handle-return-val.patch" # KDE-bug 461070, 5.27.8
+)
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake_use_find_package webengine Qt5WebChannel)
+ $(cmake_use_find_package webengine Qt5WebEngineWidgets)
+ )
+
+ ecm_src_configure
+}
+
+src_test() {
+ # bugs 797898, 889942: flaky test
+ local myctestargs=(
+ -E "(sensortreemodeltest)"
+ )
+ LC_NUMERIC="C" ecm_src_test # bug 695514
+}