Gentoo Archives: gentoo-commits

From: Jauhien Piatlicki <jauhien@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: x11-misc/sddm/files/, profiles/, x11-misc/sddm/
Date: Fri, 28 Aug 2015 20:22:35
Message-Id: 1440621636.4954cf13bb528ea0674fbef91cb203119d18f0c8.jauhien@gentoo
1 commit: 4954cf13bb528ea0674fbef91cb203119d18f0c8
2 Author: Andreas Sturmlechner <andreas.sturmlechner <AT> gmail <DOT> com>
3 AuthorDate: Sun Aug 16 22:33:39 2015 +0000
4 Commit: Jauhien Piatlicki <jauhien <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 26 20:40:36 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4954cf13
7
8 x11-misc/sddm: Add upstream patch for consolekit2 support
9
10 USE=consolekit now means real consolekit2 support instead of a postinst message
11 profiles: Add =x11-misc/sddm-0.11.0-r2 to package.mask
12 RDEPENDs on also masked >=sys-auth/consolekit-0.9.2
13
14 Package-Manager: portage-2.2.20.1
15
16 profiles/package.mask | 4 +
17 x11-misc/sddm/files/sddm-0.11.0-consolekit2.patch | 91 +++++++++++++++++++++++
18 x11-misc/sddm/files/sddm-0.11.0-upower.patch | 11 +++
19 x11-misc/sddm/sddm-0.11.0-r2.ebuild | 76 +++++++++++++++++++
20 4 files changed, 182 insertions(+)
21
22 diff --git a/profiles/package.mask b/profiles/package.mask
23 index 38bfd12..a5a02e8 100644
24 --- a/profiles/package.mask
25 +++ b/profiles/package.mask
26 @@ -51,6 +51,10 @@ sys-devel/dragonegg
27 =sys-devel/llvm-3.7.0*
28 =sys-devel/clang-3.7.0*
29
30 +# Andreas Sturmlechner <andreas.sturmlechner@×××××.com> (24 Aug 2015)
31 +# Masked until >=sys-auth/consolekit-0.9.2 gets unmasked
32 +=x11-misc/sddm-0.11.0-r2
33 +
34 # Matt Turner <mattst88@g.o> (22 Aug 2015)
35 # nouveau has been in the kernel since 2.6.33
36 # Masked for removal in 30 days.
37
38 diff --git a/x11-misc/sddm/files/sddm-0.11.0-consolekit2.patch b/x11-misc/sddm/files/sddm-0.11.0-consolekit2.patch
39 new file mode 100644
40 index 0000000..7f6f3f7
41 --- /dev/null
42 +++ b/x11-misc/sddm/files/sddm-0.11.0-consolekit2.patch
43 @@ -0,0 +1,91 @@
44 +From 7a8024639ee3ae7e128a9dc3efce90a07b4d316c Mon Sep 17 00:00:00 2001
45 +From: Eric Koegel <eric.koegel@×××××.com>
46 +Date: Mon, 6 Jul 2015 11:16:38 +0300
47 +Subject: [PATCH] ConsoleKit2 support for system actions
48 +
49 +This adds support for calling ConsoleKit2's DBUS API for shutdown,
50 +reboot, suspend, and hibernate. It does so by using the exact same
51 +interface as login1, making it a shared seat manager backend.
52 +---
53 + INSTALL | 4 ++--
54 + src/daemon/PowerManager.cpp | 26 +++++++++++++++++---------
55 + 2 files changed, 19 insertions(+), 11 deletions(-)
56 +
57 +diff --git a/INSTALL b/INSTALL
58 +index 77b6a8b..5d16710 100644
59 +--- a/INSTALL
60 ++++ b/INSTALL
61 +@@ -30,8 +30,8 @@ its home set to `/var/lib/sddm` by default.
62 + SDDM depends on PAM for authorization and XCB to communicate with the X server.
63 + Apart from other things, it also depends on Qt for the user interface and event
64 + loop management.
65 +-SDDM can optionally make use of logind (the systemd login manager API) or
66 +-upower to enable support for suspend, hibernate etc.
67 ++SDDM can optionally make use of logind (the systemd login manager API), or
68 ++ConsoleKit2, or upower to enable support for suspend, hibernate etc.
69 + In order to build the man pages, you will need `rst2man` installed. It is
70 + provided by the python `docutils` package
71 +
72 +diff --git a/src/daemon/PowerManager.cpp b/src/daemon/PowerManager.cpp
73 +index 3a4d25d..6329032 100644
74 +--- a/src/daemon/PowerManager.cpp
75 ++++ b/src/daemon/PowerManager.cpp
76 +@@ -59,8 +59,8 @@ namespace SDDM {
77 +
78 + class UPowerBackend : public PowerManagerBackend {
79 + public:
80 +- UPowerBackend() {
81 +- m_interface = new QDBusInterface(UPOWER_SERVICE, UPOWER_PATH, UPOWER_OBJECT, QDBusConnection::systemBus());
82 ++ UPowerBackend(const QString & service, const QString & path, const QString & interface) {
83 ++ m_interface = new QDBusInterface(service, path, interface, QDBusConnection::systemBus());
84 + }
85 +
86 + ~UPowerBackend() {
87 +@@ -110,20 +110,24 @@ namespace SDDM {
88 + };
89 +
90 + /**********************************************/
91 +- /* LOGIN1 BACKEND */
92 ++ /* LOGIN1 && ConsoleKit2 BACKEND */
93 + /**********************************************/
94 +
95 + #define LOGIN1_SERVICE QStringLiteral("org.freedesktop.login1")
96 + #define LOGIN1_PATH QStringLiteral("/org/freedesktop/login1")
97 + #define LOGIN1_OBJECT QStringLiteral("org.freedesktop.login1.Manager")
98 +
99 +- class Login1Backend : public PowerManagerBackend {
100 ++#define CK2_SERVICE QStringLiteral("org.freedesktop.ConsoleKit")
101 ++#define CK2_PATH QStringLiteral("/org/freedesktop/ConsoleKit/Manager")
102 ++#define CK2_OBJECT QStringLiteral("org.freedesktop.ConsoleKit.Manager")
103 ++
104 ++ class SeatManagerBackend : public PowerManagerBackend {
105 + public:
106 +- Login1Backend() {
107 +- m_interface = new QDBusInterface(LOGIN1_SERVICE, LOGIN1_PATH, LOGIN1_OBJECT, QDBusConnection::systemBus());
108 ++ SeatManagerBackend(const QString & service, const QString & path, const QString & interface) {
109 ++ m_interface = new QDBusInterface(service, path, interface, QDBusConnection::systemBus());
110 + }
111 +
112 +- ~Login1Backend() {
113 ++ ~SeatManagerBackend() {
114 + delete m_interface;
115 + }
116 +
117 +@@ -194,11 +198,15 @@ namespace SDDM {
118 +
119 + // check if login1 interface exists
120 + if (interface->isServiceRegistered(LOGIN1_SERVICE))
121 +- m_backends << new Login1Backend();
122 ++ m_backends << new SeatManagerBackend(LOGIN1_SERVICE, LOGIN1_PATH, LOGIN1_OBJECT);
123 ++
124 ++ // check if ConsoleKit2 interface exists
125 ++ if (interface->isServiceRegistered(CK2_SERVICE))
126 ++ m_backends << new SeatManagerBackend(CK2_SERVICE, CK2_PATH, CK2_OBJECT);
127 +
128 + // check if upower interface exists
129 + if (interface->isServiceRegistered(UPOWER_SERVICE))
130 +- m_backends << new UPowerBackend();
131 ++ m_backends << new UPowerBackend(UPOWER_SERVICE, UPOWER_PATH, UPOWER_OBJECT);
132 + }
133 +
134 + PowerManager::~PowerManager() {
135
136 diff --git a/x11-misc/sddm/files/sddm-0.11.0-upower.patch b/x11-misc/sddm/files/sddm-0.11.0-upower.patch
137 new file mode 100644
138 index 0000000..387f106
139 --- /dev/null
140 +++ b/x11-misc/sddm/files/sddm-0.11.0-upower.patch
141 @@ -0,0 +1,11 @@
142 +--- a/src/daemon/PowerManager.cpp 2015-08-17 00:52:12.786176023 +0200
143 ++++ b/src/daemon/PowerManager.cpp 2015-08-17 00:53:30.259207476 +0200
144 +@@ -209,7 +209,7 @@
145 + #endif // HAVE_CONSOLEKIT2
146 +
147 + // check if upower interface exists
148 +- if (interface->isServiceRegistered(UPOWER_SERVICE))
149 ++// if (interface->isServiceRegistered(UPOWER_SERVICE))
150 + m_backends << new UPowerBackend(UPOWER_SERVICE, UPOWER_PATH, UPOWER_OBJECT);
151 + }
152 +
153
154 diff --git a/x11-misc/sddm/sddm-0.11.0-r2.ebuild b/x11-misc/sddm/sddm-0.11.0-r2.ebuild
155 new file mode 100644
156 index 0000000..5057c94
157 --- /dev/null
158 +++ b/x11-misc/sddm/sddm-0.11.0-r2.ebuild
159 @@ -0,0 +1,76 @@
160 +# Copyright 1999-2015 Gentoo Foundation
161 +# Distributed under the terms of the GNU General Public License v2
162 +# $Id$
163 +
164 +EAPI=5
165 +inherit cmake-utils toolchain-funcs user
166 +
167 +DESCRIPTION="Simple Desktop Display Manager"
168 +HOMEPAGE="https://github.com/sddm/sddm"
169 +SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
170 +KEYWORDS="~amd64 ~arm ~x86"
171 +
172 +LICENSE="GPL-2+ MIT CC-BY-3.0 public-domain"
173 +SLOT="0"
174 +IUSE="consolekit systemd +upower"
175 +REQUIRED_USE="?? ( upower systemd )"
176 +
177 +RDEPEND="
178 + dev-qt/qtcore:5
179 + dev-qt/qtdbus:5
180 + dev-qt/qtdeclarative:5
181 + dev-qt/linguist-tools:5
182 + dev-qt/qttest:5
183 + sys-libs/pam
184 + >=x11-base/xorg-server-1.15.1
185 + x11-libs/libxcb[xkb(-)]
186 + consolekit? ( >=sys-auth/consolekit-0.9.4 )
187 + systemd? ( sys-apps/systemd:= )
188 + upower? ( || ( sys-power/upower sys-power/upower-pm-utils ) )"
189 +DEPEND="${RDEPEND}
190 + >=sys-devel/gcc-4.7.0
191 + virtual/pkgconfig"
192 +
193 +PATCHES=(
194 + "${FILESDIR}/${P}-consolekit2.patch"
195 + "${FILESDIR}/${P}-dbus-config.patch"
196 +)
197 +
198 +pkg_pretend() {
199 + if [[ ${MERGE_TYPE} != binary && $(tc-getCC) == *gcc* ]]; then
200 + if [[ $(gcc-major-version) -lt 4 || $(gcc-major-version) == 4 && $(gcc-minor-version) -lt 7 ]] ; then
201 + die 'The active compiler needs to be gcc 4.7 (or newer)'
202 + fi
203 + fi
204 +}
205 +
206 +pkg_setup() {
207 + enewgroup ${PN}
208 + enewuser ${PN} -1 -1 /var/lib/sddm ${PN}
209 +}
210 +
211 +src_prepare() {
212 + cmake-utils_src_prepare
213 +
214 + use consolekit && epatch "${FILESDIR}/${PN}-0.10.0-consolekit.patch"
215 + use upower && epatch "${FILESDIR}/${P}-upower.patch"
216 +
217 + # respect user's cflags
218 + sed -e 's|-Wall -march=native||' \
219 + -e 's|-O2||' \
220 + -i CMakeLists.txt || die 'sed failed'
221 +}
222 +
223 +src_configure() {
224 + local mycmakeargs=(
225 + $(cmake-utils_use_no systemd SYSTEMD)
226 + -DDBUS_CONFIG_FILENAME:STRING="org.freedesktop.sddm.conf"
227 + )
228 + cmake-utils_src_configure
229 +}
230 +
231 +pkg_postinst() {
232 + ewarn "Add the sddm user manually to the video group"
233 + ewarn "if you experience flickering or other rendering issues of sddm-greeter"
234 + ewarn "see https://github.com/gentoo/qt/pull/52"
235 +}