1 |
commit: bf627d629f87b6bb450c3d435b10176f3a653126 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Feb 25 10:57:21 2019 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Feb 25 12:01:18 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf627d62 |
7 |
|
8 |
sys-apps/fwupd: Add USE elogind |
9 |
|
10 |
Closes: https://bugs.gentoo.org/668522 |
11 |
Package-Manager: Portage-2.3.62, Repoman-2.3.12 |
12 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
13 |
|
14 |
sys-apps/fwupd/files/fwupd-1.2.4-elogind.patch | 105 ++++++++++++++++++++ |
15 |
sys-apps/fwupd/fwupd-1.2.4-r2.ebuild | 132 +++++++++++++++++++++++++ |
16 |
sys-apps/fwupd/metadata.xml | 3 +- |
17 |
3 files changed, 239 insertions(+), 1 deletion(-) |
18 |
|
19 |
diff --git a/sys-apps/fwupd/files/fwupd-1.2.4-elogind.patch b/sys-apps/fwupd/files/fwupd-1.2.4-elogind.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..1a8b7760001 |
22 |
--- /dev/null |
23 |
+++ b/sys-apps/fwupd/files/fwupd-1.2.4-elogind.patch |
24 |
@@ -0,0 +1,105 @@ |
25 |
+From de2b70bc7d0ca092659a0b5a4719e41444660b14 Mon Sep 17 00:00:00 2001 |
26 |
+From: Marcin Sucharski <marcin.sucharski@××××××××××.com> |
27 |
+Date: Sun, 24 Feb 2019 00:28:10 +0100 |
28 |
+Subject: [PATCH] Add elogind support |
29 |
+ |
30 |
+--- |
31 |
+ data/meson.build | 27 ++++++++++++++++----------- |
32 |
+ meson.build | 6 ++++++ |
33 |
+ meson_options.txt | 1 + |
34 |
+ src/fu-util-common.c | 4 ++-- |
35 |
+ 4 files changed, 25 insertions(+), 13 deletions(-) |
36 |
+ |
37 |
+diff --git a/data/meson.build b/data/meson.build |
38 |
+index 2d7fb632a..f9377c803 100644 |
39 |
+--- a/data/meson.build |
40 |
++++ b/data/meson.build |
41 |
+@@ -63,17 +63,6 @@ if get_option('systemd') |
42 |
+ endif |
43 |
+ con2.set('dynamic_options', '\n'.join(dynamic_options)) |
44 |
+ |
45 |
+- # replace @libexecdir@ |
46 |
+- configure_file( |
47 |
+- input : 'org.freedesktop.fwupd.service.in', |
48 |
+- output : 'org.freedesktop.fwupd.service', |
49 |
+- configuration : con2, |
50 |
+- install: true, |
51 |
+- install_dir: join_paths(datadir, |
52 |
+- 'dbus-1', |
53 |
+- 'system-services'), |
54 |
+- ) |
55 |
+- |
56 |
+ # replace @bindir@ |
57 |
+ configure_file( |
58 |
+ input : 'fwupd-offline-update.service.in', |
59 |
+@@ -92,3 +81,19 @@ if get_option('systemd') |
60 |
+ install_dir: systemdunitdir, |
61 |
+ ) |
62 |
+ endif |
63 |
++ |
64 |
++if get_option('systemd') or get_option('elogind') |
65 |
++ con2 = configuration_data() |
66 |
++ con2.set('libexecdir', libexecdir) |
67 |
++ |
68 |
++ # replace @libexecdir@ |
69 |
++ configure_file( |
70 |
++ input : 'org.freedesktop.fwupd.service.in', |
71 |
++ output : 'org.freedesktop.fwupd.service', |
72 |
++ configuration : con2, |
73 |
++ install: true, |
74 |
++ install_dir: join_paths(datadir, |
75 |
++ 'dbus-1', |
76 |
++ 'system-services'), |
77 |
++ ) |
78 |
++endif |
79 |
+diff --git a/meson.build b/meson.build |
80 |
+index f4f0af192..d645db2ae 100644 |
81 |
+--- a/meson.build |
82 |
++++ b/meson.build |
83 |
+@@ -270,6 +270,12 @@ endif |
84 |
+ if get_option('systemd') |
85 |
+ systemd = dependency('systemd', version : '>= 211') |
86 |
+ conf.set('HAVE_SYSTEMD' , '1') |
87 |
++ conf.set('HAVE_LOGIND' , '1') |
88 |
++endif |
89 |
++ |
90 |
++if get_option('elogind') |
91 |
++ elogind = dependency('libelogind', version : '>= 211') |
92 |
++ conf.set('HAVE_LOGIND' , '1') |
93 |
+ endif |
94 |
+ |
95 |
+ if get_option('consolekit') |
96 |
+diff --git a/meson_options.txt b/meson_options.txt |
97 |
+index c9b7ba675..6b0902225 100644 |
98 |
+--- a/meson_options.txt |
99 |
++++ b/meson_options.txt |
100 |
+@@ -18,6 +18,7 @@ option('plugin_uefi', type : 'boolean', value : true, description : 'enable UEFI |
101 |
+ option('plugin_nvme', type : 'boolean', value : true, description : 'enable NVMe support') |
102 |
+ option('systemd', type : 'boolean', value : true, description : 'enable systemd support') |
103 |
+ option('systemdunitdir', type: 'string', value: '', description: 'Directory for systemd units') |
104 |
++option('elogind', type : 'boolean', value : false, description : 'enable elogind support') |
105 |
+ option('tests', type : 'boolean', value : true, description : 'enable tests') |
106 |
+ option('udevdir', type: 'string', value: '', description: 'Directory for udev rules') |
107 |
+ option('efi-cc', type : 'string', value : 'gcc', description : 'the compiler to use for EFI modules') |
108 |
+diff --git a/src/fu-util-common.c b/src/fu-util-common.c |
109 |
+index cdeb2ff6b..667c142fb 100644 |
110 |
+--- a/src/fu-util-common.c |
111 |
++++ b/src/fu-util-common.c |
112 |
+@@ -184,7 +184,7 @@ fu_util_update_shutdown (GError **error) |
113 |
+ if (connection == NULL) |
114 |
+ return FALSE; |
115 |
+ |
116 |
+-#ifdef HAVE_SYSTEMD |
117 |
++#ifdef HAVE_LOGIND |
118 |
+ /* shutdown using logind */ |
119 |
+ val = g_dbus_connection_call_sync (connection, |
120 |
+ "org.freedesktop.login1", |
121 |
+@@ -229,7 +229,7 @@ fu_util_update_reboot (GError **error) |
122 |
+ if (connection == NULL) |
123 |
+ return FALSE; |
124 |
+ |
125 |
+-#ifdef HAVE_SYSTEMD |
126 |
++#ifdef HAVE_LOGIND |
127 |
+ /* reboot using logind */ |
128 |
+ val = g_dbus_connection_call_sync (connection, |
129 |
+ "org.freedesktop.login1", |
130 |
|
131 |
diff --git a/sys-apps/fwupd/fwupd-1.2.4-r2.ebuild b/sys-apps/fwupd/fwupd-1.2.4-r2.ebuild |
132 |
new file mode 100644 |
133 |
index 00000000000..43db76e1c25 |
134 |
--- /dev/null |
135 |
+++ b/sys-apps/fwupd/fwupd-1.2.4-r2.ebuild |
136 |
@@ -0,0 +1,132 @@ |
137 |
+# Copyright 1999-2019 Gentoo Authors |
138 |
+# Distributed under the terms of the GNU General Public License v2 |
139 |
+ |
140 |
+EAPI=7 |
141 |
+ |
142 |
+PYTHON_COMPAT=( python3_{4,5,6,7} ) |
143 |
+ |
144 |
+inherit meson python-single-r1 vala xdg-utils |
145 |
+ |
146 |
+DESCRIPTION="Aims to make updating firmware on Linux automatic, safe and reliable" |
147 |
+HOMEPAGE="https://fwupd.org" |
148 |
+SRC_URI="https://github.com/hughsie/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" |
149 |
+ |
150 |
+LICENSE="LGPL-2.1+" |
151 |
+SLOT="0" |
152 |
+KEYWORDS="~amd64 ~x86" |
153 |
+IUSE="colorhug dell doc elogind +gpg +man nvme pkcs7 redfish systemd test thunderbolt uefi" |
154 |
+ |
155 |
+REQUIRED_USE="${PYTHON_REQUIRED_USE} |
156 |
+ ?? ( elogind systemd ) |
157 |
+ dell? ( uefi ) |
158 |
+" |
159 |
+ |
160 |
+RDEPEND="${PYTHON_DEPS} |
161 |
+ app-arch/gcab |
162 |
+ app-arch/libarchive:= |
163 |
+ dev-db/sqlite |
164 |
+ >=dev-libs/glib-2.45.8:2 |
165 |
+ dev-libs/json-glib |
166 |
+ dev-libs/libgpg-error |
167 |
+ dev-libs/libgudev:= |
168 |
+ >=dev-libs/libgusb-0.2.9[introspection] |
169 |
+ >=dev-libs/libxmlb-0.1.5 |
170 |
+ dev-python/pillow[${PYTHON_USEDEP}] |
171 |
+ dev-python/pycairo[${PYTHON_USEDEP}] |
172 |
+ dev-python/pygobject:3[cairo,${PYTHON_USEDEP}] |
173 |
+ >=net-libs/libsoup-2.51.92:2.4[introspection] |
174 |
+ >=sys-auth/polkit-0.103 |
175 |
+ virtual/libelf:0= |
176 |
+ colorhug? ( >=x11-misc/colord-1.2.12:0= ) |
177 |
+ dell? ( |
178 |
+ sys-libs/efivar |
179 |
+ >=sys-libs/libsmbios-2.4.0 |
180 |
+ ) |
181 |
+ gpg? ( |
182 |
+ app-crypt/gpgme |
183 |
+ dev-libs/libgpg-error |
184 |
+ ) |
185 |
+ nvme? ( sys-libs/efivar ) |
186 |
+ pkcs7? ( >=net-libs/gnutls-3.4.4.1:= ) |
187 |
+ redfish? ( sys-libs/efivar ) |
188 |
+ !systemd? ( |
189 |
+ !elogind? ( >=sys-auth/consolekit-1.0.0 ) |
190 |
+ elogind? ( sys-auth/elogind ) |
191 |
+ ) |
192 |
+ systemd? ( >=sys-apps/systemd-211 ) |
193 |
+ thunderbolt? ( sys-apps/thunderbolt-software-user-space ) |
194 |
+ uefi? ( |
195 |
+ media-libs/fontconfig |
196 |
+ media-libs/freetype |
197 |
+ sys-boot/gnu-efi |
198 |
+ >=sys-libs/efivar-33 |
199 |
+ x11-libs/cairo |
200 |
+ ) |
201 |
+" |
202 |
+DEPEND="${RDEPEND} |
203 |
+ $(vala_depend) |
204 |
+ x11-libs/pango[introspection] |
205 |
+ nvme? ( >=sys-kernel/linux-headers-4.4 ) |
206 |
+ test? ( net-libs/gnutls[tools] ) |
207 |
+" |
208 |
+BDEPEND=" |
209 |
+ >=dev-util/meson-0.47.0 |
210 |
+ virtual/pkgconfig |
211 |
+ doc? ( dev-util/gtk-doc ) |
212 |
+ man? ( app-text/docbook-sgml-utils ) |
213 |
+" |
214 |
+ |
215 |
+# required for fwupd daemon to run. |
216 |
+# NOT a build time dependency. The build system does not check for dbus. |
217 |
+PDEPEND="sys-apps/dbus" |
218 |
+ |
219 |
+PATCHES=( "${FILESDIR}/${P}-elogind.patch" ) # bug 668522 |
220 |
+ |
221 |
+src_prepare() { |
222 |
+ default |
223 |
+ sed -e "s/'--create'/'--absolute-name', '--create'/" \ |
224 |
+ -i data/tests/builder/meson.build || die |
225 |
+ sed -e "/'-Werror',/d" \ |
226 |
+ -i plugins/uefi/efi/meson.build || die |
227 |
+ vala_src_prepare |
228 |
+} |
229 |
+ |
230 |
+src_configure() { |
231 |
+ xdg_environment_reset |
232 |
+ local emesonargs=( |
233 |
+ --localstatedir "${EPREFIX}"/var |
234 |
+ -Dgtkdoc="$(usex doc true false)" |
235 |
+ -Delogind="$(usex elogind true false)" |
236 |
+ -Dgpg="$(usex gpg true false)" |
237 |
+ -Dman="$(usex man true false)" |
238 |
+ -Dpkcs7="$(usex pkcs7 true false)" |
239 |
+ -Dplugin_dell="$(usex dell true false)" |
240 |
+ -Dplugin_nvme="$(usex nvme true false)" |
241 |
+ -Dplugin_redfish="$(usex redfish true false)" |
242 |
+ -Dplugin_synaptics="$(usex dell true false)" |
243 |
+ -Dplugin_thunderbolt="$(usex thunderbolt true false)" |
244 |
+ -Dplugin_uefi="$(usex uefi true false)" |
245 |
+ -Dsystemd="$(usex systemd true false)" |
246 |
+ -Dtests="$(usex test true false)" |
247 |
+ ) |
248 |
+ use elogind || use systemd || emesonargs+=( -Dconsolekit=true ) |
249 |
+ meson_src_configure |
250 |
+} |
251 |
+ |
252 |
+src_install() { |
253 |
+ meson_src_install |
254 |
+ doinitd "${FILESDIR}"/${PN} |
255 |
+ |
256 |
+ if ! use systemd && ! use elogind ; then |
257 |
+ # Don't timeout when fwupd is running (#673140) |
258 |
+ sed '/^IdleTimeout=/s@=[[:digit:]]\+@=0@' \ |
259 |
+ -i "${ED}"/etc/${PN}/daemon.conf || die |
260 |
+ fi |
261 |
+} |
262 |
+ |
263 |
+pkg_postinst() { |
264 |
+ elog "In case you are using openrc as init system" |
265 |
+ elog "and you're upgrading from <fwupd-1.1.0, you" |
266 |
+ elog "need to start the fwupd daemon via the openrc" |
267 |
+ elog "init script that comes with this package." |
268 |
+} |
269 |
|
270 |
diff --git a/sys-apps/fwupd/metadata.xml b/sys-apps/fwupd/metadata.xml |
271 |
index 702c657eeb2..d6ab1d6e8c6 100644 |
272 |
--- a/sys-apps/fwupd/metadata.xml |
273 |
+++ b/sys-apps/fwupd/metadata.xml |
274 |
@@ -9,10 +9,11 @@ |
275 |
<flag name="colorhug">Enable ColorHug support through |
276 |
<pkg>x11-misc/colord</pkg> package.</flag> |
277 |
<flag name="dell">Enable Dell-specific support.</flag> |
278 |
+ <flag name="elogind">Use <pkg>sys-auth/elogind</pkg> instead of <pkg>sys-auth/consolekit</pkg> for session tracking</flag> |
279 |
<flag name="gpg">Enable GPG support.</flag> |
280 |
<flag name="man">Build and install man pages</flag> |
281 |
<flag name="nvme">Build and install nvme plugin</flag> |
282 |
- <flag name="pkcs7">Enable PKCS7 verification support via <pkg>net-libs/gnutls</pkg>.</flag> |
283 |
+ <flag name="pkcs7">Enable PKCS7 verification support via <pkg>net-libs/gnutls</pkg></flag> |
284 |
<flag name="redfish">Install redfish plugin</flag> |
285 |
<flag name="thunderbolt">Install thunderbolt plugin</flag> |
286 |
<flag name="uefi">Enable UEFI support</flag> |