1 |
commit: 9cce54b509898e120239847fb54850a05f75f5ae |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 20 12:07:31 2022 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 20 13:24:19 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9cce54b5 |
7 |
|
8 |
kde-frameworks/solid: Properly round up battery's capacity |
9 |
|
10 |
Upstream commit 2f305a7134f27489203c3fd2e9ca81790f35ac3b |
11 |
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=448372 |
12 |
|
13 |
Package-Manager: Portage-3.0.30, Repoman-3.0.3 |
14 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
15 |
|
16 |
...id-5.90.0-properly-round-battery-capacity.patch | 31 ++++++++++++ |
17 |
kde-frameworks/solid/solid-5.90.0-r1.ebuild | 55 ++++++++++++++++++++++ |
18 |
2 files changed, 86 insertions(+) |
19 |
|
20 |
diff --git a/kde-frameworks/solid/files/solid-5.90.0-properly-round-battery-capacity.patch b/kde-frameworks/solid/files/solid-5.90.0-properly-round-battery-capacity.patch |
21 |
new file mode 100644 |
22 |
index 000000000000..77296074bfa7 |
23 |
--- /dev/null |
24 |
+++ b/kde-frameworks/solid/files/solid-5.90.0-properly-round-battery-capacity.patch |
25 |
@@ -0,0 +1,31 @@ |
26 |
+From 2f305a7134f27489203c3fd2e9ca81790f35ac3b Mon Sep 17 00:00:00 2001 |
27 |
+From: ivan tkachenko <me@×××××××.tk> |
28 |
+Date: Mon, 17 Jan 2022 02:24:44 +0300 |
29 |
+Subject: [PATCH] [upower] Properly round up battery's capacity |
30 |
+ |
31 |
+The same rounding is already used for charge percent just few lines |
32 |
+above. Without it, for example, values that are close to 100% |
33 |
+(e.g. 99.9825%) were rounded down to 99% instead of up to 100%. |
34 |
+ |
35 |
+BUG: 448372 |
36 |
+FIXED-IN: 5.91 |
37 |
+--- |
38 |
+ src/solid/devices/backends/upower/upowerbattery.cpp | 2 +- |
39 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
40 |
+ |
41 |
+diff --git a/src/solid/devices/backends/upower/upowerbattery.cpp b/src/solid/devices/backends/upower/upowerbattery.cpp |
42 |
+index 22b25d9..055856b 100644 |
43 |
+--- a/src/solid/devices/backends/upower/upowerbattery.cpp |
44 |
++++ b/src/solid/devices/backends/upower/upowerbattery.cpp |
45 |
+@@ -84,7 +84,7 @@ int Battery::chargePercent() const |
46 |
+ |
47 |
+ int Battery::capacity() const |
48 |
+ { |
49 |
+- return m_device.data()->prop("Capacity").toDouble(); |
50 |
++ return qRound(m_device.data()->prop("Capacity").toDouble()); |
51 |
+ } |
52 |
+ |
53 |
+ bool Battery::isRechargeable() const |
54 |
+-- |
55 |
+GitLab |
56 |
+ |
57 |
|
58 |
diff --git a/kde-frameworks/solid/solid-5.90.0-r1.ebuild b/kde-frameworks/solid/solid-5.90.0-r1.ebuild |
59 |
new file mode 100644 |
60 |
index 000000000000..4848819bb62a |
61 |
--- /dev/null |
62 |
+++ b/kde-frameworks/solid/solid-5.90.0-r1.ebuild |
63 |
@@ -0,0 +1,55 @@ |
64 |
+# Copyright 1999-2022 Gentoo Authors |
65 |
+# Distributed under the terms of the GNU General Public License v2 |
66 |
+ |
67 |
+EAPI=8 |
68 |
+ |
69 |
+QTMIN=5.15.2 |
70 |
+VIRTUALX_REQUIRED="test" |
71 |
+inherit ecm kde.org optfeature |
72 |
+ |
73 |
+DESCRIPTION="Provider for platform independent hardware discovery, abstraction and management" |
74 |
+ |
75 |
+LICENSE="LGPL-2.1+" |
76 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86" |
77 |
+IUSE="ios nls" |
78 |
+ |
79 |
+RDEPEND=" |
80 |
+ >=dev-qt/qtdbus-${QTMIN}:5 |
81 |
+ >=dev-qt/qtdeclarative-${QTMIN}:5 |
82 |
+ >=dev-qt/qtgui-${QTMIN}:5 |
83 |
+ >=dev-qt/qtxml-${QTMIN}:5 |
84 |
+ sys-apps/util-linux |
85 |
+ sys-fs/udisks:2 |
86 |
+ virtual/libudev:= |
87 |
+ ios? ( |
88 |
+ app-pda/libimobiledevice:= |
89 |
+ app-pda/libplist:= |
90 |
+ ) |
91 |
+" |
92 |
+DEPEND="${RDEPEND} |
93 |
+ test? ( >=dev-qt/qtconcurrent-${QTMIN}:5 ) |
94 |
+" |
95 |
+BDEPEND=" |
96 |
+ sys-devel/bison |
97 |
+ sys-devel/flex |
98 |
+ nls? ( >=dev-qt/linguist-tools-${QTMIN}:5 ) |
99 |
+" |
100 |
+ |
101 |
+PATCHES=( |
102 |
+ "${FILESDIR}/${P}-properly-round-battery-capacity.patch" # KDE-bug 448372 |
103 |
+) |
104 |
+ |
105 |
+src_configure() { |
106 |
+ local mycmakeargs=( |
107 |
+ $(cmake_use_find_package ios IMobileDevice) |
108 |
+ $(cmake_use_find_package ios PList) |
109 |
+ ) |
110 |
+ ecm_src_configure |
111 |
+} |
112 |
+ |
113 |
+pkg_postinst() { |
114 |
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then |
115 |
+ optfeature "media player devices support" app-misc/media-player-info |
116 |
+ fi |
117 |
+ ecm_pkg_postinst |
118 |
+} |