Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: x11-misc/sddm/, x11-misc/sddm/files/
Date: Thu, 24 Nov 2022 21:05:19
Message-Id: 1669323900.c6d2f39f1e75acd270d6213e7f52c0383647718e.asturm@gentoo
1 commit: c6d2f39f1e75acd270d6213e7f52c0383647718e
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Thu Nov 24 20:41:18 2022 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Thu Nov 24 21:05:00 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c6d2f39f
7
8 x11-misc/sddm: Backport several 0.19.0 and master branch fixes
9
10 - Nvidia VT switching glitch
11 - Crash w/ Qt 5.15.7 (KDE QtPatchCollection)
12 - Prevent duplicate (Wayland) session suffix
13
14 Alex (1):
15 Prevent duplicate session name.
16
17 David Edmundson (1):
18 Enable QSurfaceFormat::ResetNotification on new Qt
19
20 Harald Sitter (1):
21 disable automatic portal launching
22
23 KDE-bug: https://bugs.kde.org/show_bug.cgi?id=458865
24
25 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
26
27 .../files/sddm-0.18.1-drop-wayland-suffix.patch | 28 +++++
28 .../sddm/files/sddm-0.18.1-fix-qt-5.15.7.patch | 33 ++++++
29 .../sddm-0.18.1-nvidia-glitches-vt-switch.patch | 46 +++++++
30 x11-misc/sddm/sddm-0.18.1-r7.ebuild | 132 +++++++++++++++++++++
31 4 files changed, 239 insertions(+)
32
33 diff --git a/x11-misc/sddm/files/sddm-0.18.1-drop-wayland-suffix.patch b/x11-misc/sddm/files/sddm-0.18.1-drop-wayland-suffix.patch
34 new file mode 100644
35 index 000000000000..70efa284803f
36 --- /dev/null
37 +++ b/x11-misc/sddm/files/sddm-0.18.1-drop-wayland-suffix.patch
38 @@ -0,0 +1,28 @@
39 +From 9a440ba5917ff93c6a78726380c6267d91c13f19 Mon Sep 17 00:00:00 2001
40 +From: Alex <alex.shaw.as@×××××.com>
41 +Date: Mon, 30 Sep 2019 16:50:16 -0400
42 +Subject: [PATCH] Prevent duplicate session name.
43 +
44 +Several desktop sessions (e.g. KDE Plasma) already include the string " (Wayland)" in the session name. When this happens, the session name displayed to the user is "Plasma (Wayland) (Wayland)". This change makes it so that only "Plasma (Wayland)" will be displayed.
45 +
46 +(cherry picked from commit f9a0648ff3f841b68a07c139c3540b9e75bfd279)
47 +---
48 + src/common/Session.cpp | 2 +-
49 + 1 file changed, 1 insertion(+), 1 deletion(-)
50 +
51 +diff --git a/src/common/Session.cpp b/src/common/Session.cpp
52 +index aa4dad3..923ecd4 100644
53 +--- a/src/common/Session.cpp
54 ++++ b/src/common/Session.cpp
55 +@@ -169,7 +169,7 @@ namespace SDDM {
56 +
57 + if (line.startsWith(QLatin1String("Name="))) {
58 + if (type == WaylandSession)
59 +- m_displayName = QObject::tr("%1 (Wayland)").arg(line.mid(5));
60 ++ m_displayName = QObject::tr("%1").arg(line.mid(5));
61 + else
62 + m_displayName = line.mid(5);
63 + }
64 +--
65 +2.38.1
66 +
67
68 diff --git a/x11-misc/sddm/files/sddm-0.18.1-fix-qt-5.15.7.patch b/x11-misc/sddm/files/sddm-0.18.1-fix-qt-5.15.7.patch
69 new file mode 100644
70 index 000000000000..65e9b8573356
71 --- /dev/null
72 +++ b/x11-misc/sddm/files/sddm-0.18.1-fix-qt-5.15.7.patch
73 @@ -0,0 +1,33 @@
74 +From 5fe712d0e73c6263647bf306f40fbac94a52f4a6 Mon Sep 17 00:00:00 2001
75 +From: Harald Sitter <sitter@×××.org>
76 +Date: Mon, 24 Oct 2022 13:15:48 +0200
77 +Subject: disable automatic portal launching
78 +
79 +in Qt6 (and the KDE patch collection for Qt 5) genericunixservices will
80 +internally attempt to probe the portal tech early on in the app life
81 +cycle. this causes the protal system to launch app and then crash
82 +because we aren't actually providing a fully functional session. instead
83 +opt out of this altogether
84 +
85 +(cherry picked from commit fc24321541f6f65b7d1aac89cd82336ffd53e1a0)
86 +---
87 + src/greeter/GreeterApp.cpp | 3 +++
88 + 1 file changed, 3 insertions(+)
89 +
90 +diff --git a/src/greeter/GreeterApp.cpp b/src/greeter/GreeterApp.cpp
91 +index 4e117a7..a491f4d 100644
92 +--- a/src/greeter/GreeterApp.cpp
93 ++++ b/src/greeter/GreeterApp.cpp
94 +@@ -318,6 +318,9 @@ int main(int argc, char **argv)
95 + QSurfaceFormat::setDefaultFormat(format);
96 + }
97 +
98 ++ // Qt internally may load the xdg portal system early on, prevent this, we do not have a functional session running.
99 ++ qputenv("QT_NO_XDG_DESKTOP_PORTAL", "1");
100 ++
101 + QGuiApplication app(argc, argv);
102 +
103 + QCommandLineParser parser;
104 +--
105 +2.38.1
106 +
107
108 diff --git a/x11-misc/sddm/files/sddm-0.18.1-nvidia-glitches-vt-switch.patch b/x11-misc/sddm/files/sddm-0.18.1-nvidia-glitches-vt-switch.patch
109 new file mode 100644
110 index 000000000000..ab2fc18cbcbf
111 --- /dev/null
112 +++ b/x11-misc/sddm/files/sddm-0.18.1-nvidia-glitches-vt-switch.patch
113 @@ -0,0 +1,46 @@
114 +From 76c11653522453efcf86f6f2f53bca1a497ea350 Mon Sep 17 00:00:00 2001
115 +From: David Edmundson <kde@×××××××××××××××××.uk>
116 +Date: Thu, 28 Mar 2019 11:43:37 +0000
117 +Subject: Enable QSurfaceFormat::ResetNotification on new Qt
118 +
119 +This fixes graphical glitches on nvidia after VT switching.
120 +
121 +It's opt-in as it requires code paths to handle glGetError differently.
122 +The version comparison is because my early implementations missed a code
123 +path. This was fixed in 5.12.2, but we may as well play safe
124 +
125 +(cherry picked from commit cd4e1fa21e1ab7178fa5d2ef858f3271575fd315)
126 +---
127 + src/greeter/GreeterApp.cpp | 9 +++++++++
128 + 1 file changed, 9 insertions(+)
129 +
130 +diff --git a/src/greeter/GreeterApp.cpp b/src/greeter/GreeterApp.cpp
131 +index d47998e..4e117a7 100644
132 +--- a/src/greeter/GreeterApp.cpp
133 ++++ b/src/greeter/GreeterApp.cpp
134 +@@ -40,6 +40,9 @@
135 + #include <QDebug>
136 + #include <QTimer>
137 + #include <QTranslator>
138 ++#include <QLibraryInfo>
139 ++#include <QVersionNumber>
140 ++#include <QSurfaceFormat>
141 +
142 + #include <iostream>
143 +
144 +@@ -309,6 +312,12 @@ int main(int argc, char **argv)
145 + qDebug() << "High-DPI autoscaling not Enabled";
146 + }
147 +
148 ++ if (QLibraryInfo::version() >= QVersionNumber(5, 13, 0)) {
149 ++ auto format(QSurfaceFormat::defaultFormat());
150 ++ format.setOption(QSurfaceFormat::ResetNotification);
151 ++ QSurfaceFormat::setDefaultFormat(format);
152 ++ }
153 ++
154 + QGuiApplication app(argc, argv);
155 +
156 + QCommandLineParser parser;
157 +--
158 +2.38.1
159 +
160
161 diff --git a/x11-misc/sddm/sddm-0.18.1-r7.ebuild b/x11-misc/sddm/sddm-0.18.1-r7.ebuild
162 new file mode 100644
163 index 000000000000..a7e8f1c35a3e
164 --- /dev/null
165 +++ b/x11-misc/sddm/sddm-0.18.1-r7.ebuild
166 @@ -0,0 +1,132 @@
167 +# Copyright 1999-2022 Gentoo Authors
168 +# Distributed under the terms of the GNU General Public License v2
169 +
170 +EAPI=8
171 +
172 +inherit cmake linux-info systemd tmpfiles
173 +
174 +DESCRIPTION="Simple Desktop Display Manager"
175 +HOMEPAGE="https://github.com/sddm/sddm"
176 +SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.xz"
177 +
178 +LICENSE="GPL-2+ MIT CC-BY-3.0 CC-BY-SA-3.0 public-domain"
179 +SLOT="0"
180 +KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
181 +IUSE="+elogind +pam systemd test"
182 +
183 +REQUIRED_USE="?? ( elogind systemd )"
184 +RESTRICT="!test? ( test )"
185 +
186 +COMMON_DEPEND="
187 + acct-group/sddm
188 + acct-user/sddm
189 + dev-qt/qtcore:5
190 + dev-qt/qtdbus:5
191 + dev-qt/qtdeclarative:5
192 + dev-qt/qtgui:5
193 + dev-qt/qtnetwork:5
194 + x11-base/xorg-server
195 + x11-libs/libxcb[xkb]
196 + elogind? ( sys-auth/elogind )
197 + pam? ( sys-libs/pam )
198 + !pam? ( virtual/libcrypt:= )
199 + systemd? ( sys-apps/systemd:= )
200 + !systemd? ( sys-power/upower )
201 +"
202 +DEPEND="${COMMON_DEPEND}
203 + test? ( dev-qt/qttest:5 )
204 +"
205 +RDEPEND="${COMMON_DEPEND}
206 + !systemd? ( gui-libs/display-manager-init )
207 +"
208 +BDEPEND="
209 + dev-python/docutils
210 + dev-qt/linguist-tools:5
211 + kde-frameworks/extra-cmake-modules:5
212 + virtual/pkgconfig
213 +"
214 +
215 +PATCHES=(
216 + "${FILESDIR}/${P}-respect-user-flags.patch"
217 + "${FILESDIR}/${P}-Xsession.patch" # bug 611210
218 + "${FILESDIR}/${PN}-0.18.0-sddmconfdir.patch"
219 + # fix for groups: https://github.com/sddm/sddm/issues/1159
220 + "${FILESDIR}/${P}-revert-honor-PAM-supplemental-groups.patch"
221 + "${FILESDIR}/${P}-honor-PAM-supplemental-groups-v2.patch"
222 + # fix for ReuseSession=true
223 + "${FILESDIR}/${P}-only-reuse-online-sessions.patch"
224 + # TODO: fix properly
225 + "${FILESDIR}/pam-1.4-substack.patch"
226 + # upstream git develop branch:
227 + "${FILESDIR}/${P}-qt-5.15.2.patch"
228 + "${FILESDIR}/${P}-cve-2020-28049.patch" # bug 753104
229 + "${FILESDIR}/${P}-nvidia-glitches-vt-switch.patch"
230 + "${FILESDIR}/${P}-drop-wayland-suffix.patch"
231 + "${FILESDIR}/${P}-fix-qt-5.15.7.patch" # KDE-bug 458865
232 +)
233 +
234 +pkg_setup() {
235 + local CONFIG_CHECK="~DRM"
236 + use kernel_linux && linux-info_pkg_setup
237 +}
238 +
239 +src_prepare() {
240 + cmake_src_prepare
241 +
242 + if ! use test; then
243 + sed -e "/^find_package/s/ Test//" -i CMakeLists.txt || die
244 + cmake_comment_add_subdirectory test
245 + fi
246 +}
247 +
248 +src_configure() {
249 + local mycmakeargs=(
250 + -DENABLE_PAM=$(usex pam)
251 + -DNO_SYSTEMD=$(usex '!systemd')
252 + -DUSE_ELOGIND=$(usex 'elogind')
253 + -DBUILD_MAN_PAGES=ON
254 + -DDBUS_CONFIG_FILENAME="org.freedesktop.sddm.conf"
255 + )
256 + cmake_src_configure
257 +}
258 +
259 +src_install() {
260 + cmake_src_install
261 +
262 + newtmpfiles "${FILESDIR}/${PN}.tmpfiles" "${PN}.conf"
263 +
264 + # Create a default.conf as upstream dropped /etc/sddm.conf w/o replacement
265 + local confd="/usr/share/sddm/sddm.conf.d"
266 + dodir ${confd}
267 + "${D}"/usr/bin/sddm --example-config > "${D}/${confd}"/00default.conf \
268 + || die "Failed to create 00default.conf"
269 +
270 + sed -e "/^InputMethod/s/qtvirtualkeyboard//" \
271 + -e "/^ReuseSession/s/false/true/" \
272 + -e "/^EnableHiDPI/s/false/true/" \
273 + -i "${D}/${confd}"/00default.conf || die
274 +}
275 +
276 +pkg_postinst() {
277 + tmpfiles_process "${PN}.conf"
278 +
279 + elog "Starting with 0.18.0, SDDM no longer installs /etc/sddm.conf"
280 + elog "Use it to override specific options. SDDM defaults are now"
281 + elog "found in: /usr/share/sddm/sddm.conf.d/00default.conf"
282 + elog
283 + elog "NOTE: If SDDM startup appears to hang then entropy pool is too low."
284 + elog "This can be fixed by configuring one of the following:"
285 + elog " - Enable CONFIG_RANDOM_TRUST_CPU in linux kernel"
286 + elog " - # emerge sys-apps/haveged && rc-update add haveged boot"
287 + elog " - # emerge sys-apps/rng-tools && rc-update add rngd boot"
288 + elog
289 + elog "For more information on how to configure SDDM, please visit the wiki:"
290 + elog " https://wiki.gentoo.org/wiki/SDDM"
291 + if has_version x11-drivers/nvidia-drivers; then
292 + elog
293 + elog " Nvidia GPU owners in particular should pay attention"
294 + elog " to the troubleshooting section."
295 + fi
296 +
297 + systemd_reenable sddm.service
298 +}