+++ /dev/null
-From de2b70bc7d0ca092659a0b5a4719e41444660b14 Mon Sep 17 00:00:00 2001
-From: Marcin Sucharski <marcin.sucharski@protonmail.com>
-Date: Sun, 24 Feb 2019 00:28:10 +0100
-Subject: [PATCH] Add elogind support
-
----
- data/meson.build | 27 ++++++++++++++++-----------
- meson.build | 6 ++++++
- meson_options.txt | 1 +
- src/fu-util-common.c | 4 ++--
- 4 files changed, 25 insertions(+), 13 deletions(-)
-
-diff --git a/data/meson.build b/data/meson.build
-index 2d7fb632a..f9377c803 100644
---- a/data/meson.build
-+++ b/data/meson.build
-@@ -63,17 +63,6 @@ if get_option('systemd')
- endif
- con2.set('dynamic_options', '\n'.join(dynamic_options))
-
-- # replace @libexecdir@
-- configure_file(
-- input : 'org.freedesktop.fwupd.service.in',
-- output : 'org.freedesktop.fwupd.service',
-- configuration : con2,
-- install: true,
-- install_dir: join_paths(datadir,
-- 'dbus-1',
-- 'system-services'),
-- )
--
- # replace @bindir@
- configure_file(
- input : 'fwupd-offline-update.service.in',
-@@ -92,3 +81,19 @@ if get_option('systemd')
- install_dir: systemdunitdir,
- )
- endif
-+
-+if get_option('systemd') or get_option('elogind')
-+ con2 = configuration_data()
-+ con2.set('libexecdir', libexecdir)
-+
-+ # replace @libexecdir@
-+ configure_file(
-+ input : 'org.freedesktop.fwupd.service.in',
-+ output : 'org.freedesktop.fwupd.service',
-+ configuration : con2,
-+ install: true,
-+ install_dir: join_paths(datadir,
-+ 'dbus-1',
-+ 'system-services'),
-+ )
-+endif
-diff --git a/meson.build b/meson.build
-index f4f0af192..d645db2ae 100644
---- a/meson.build
-+++ b/meson.build
-@@ -270,6 +270,12 @@ endif
- if get_option('systemd')
- systemd = dependency('systemd', version : '>= 211')
- conf.set('HAVE_SYSTEMD' , '1')
-+ conf.set('HAVE_LOGIND' , '1')
-+endif
-+
-+if get_option('elogind')
-+ elogind = dependency('libelogind', version : '>= 211')
-+ conf.set('HAVE_LOGIND' , '1')
- endif
-
- if get_option('consolekit')
-diff --git a/meson_options.txt b/meson_options.txt
-index c9b7ba675..6b0902225 100644
---- a/meson_options.txt
-+++ b/meson_options.txt
-@@ -18,6 +18,7 @@ option('plugin_uefi', type : 'boolean', value : true, description : 'enable UEFI
- option('plugin_nvme', type : 'boolean', value : true, description : 'enable NVMe support')
- option('systemd', type : 'boolean', value : true, description : 'enable systemd support')
- option('systemdunitdir', type: 'string', value: '', description: 'Directory for systemd units')
-+option('elogind', type : 'boolean', value : false, description : 'enable elogind support')
- option('tests', type : 'boolean', value : true, description : 'enable tests')
- option('udevdir', type: 'string', value: '', description: 'Directory for udev rules')
- option('efi-cc', type : 'string', value : 'gcc', description : 'the compiler to use for EFI modules')
-diff --git a/src/fu-util-common.c b/src/fu-util-common.c
-index cdeb2ff6b..667c142fb 100644
---- a/src/fu-util-common.c
-+++ b/src/fu-util-common.c
-@@ -184,7 +184,7 @@ fu_util_update_shutdown (GError **error)
- if (connection == NULL)
- return FALSE;
-
--#ifdef HAVE_SYSTEMD
-+#ifdef HAVE_LOGIND
- /* shutdown using logind */
- val = g_dbus_connection_call_sync (connection,
- "org.freedesktop.login1",
-@@ -229,7 +229,7 @@ fu_util_update_reboot (GError **error)
- if (connection == NULL)
- return FALSE;
-
--#ifdef HAVE_SYSTEMD
-+#ifdef HAVE_LOGIND
- /* reboot using logind */
- val = g_dbus_connection_call_sync (connection,
- "org.freedesktop.login1",
+++ /dev/null
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{4,5,6,7} )
-
-inherit meson python-single-r1 vala xdg-utils
-
-DESCRIPTION="Aims to make updating firmware on Linux automatic, safe and reliable"
-HOMEPAGE="https://fwupd.org"
-SRC_URI="https://github.com/hughsie/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="LGPL-2.1+"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="colorhug dell doc elogind +gpg +man nvme pkcs7 redfish systemd test thunderbolt uefi"
-
-REQUIRED_USE="${PYTHON_REQUIRED_USE}
- ?? ( elogind systemd )
- dell? ( uefi )
-"
-
-RDEPEND="${PYTHON_DEPS}
- app-arch/gcab
- app-arch/libarchive:=
- dev-db/sqlite
- >=dev-libs/glib-2.45.8:2
- dev-libs/json-glib
- dev-libs/libgpg-error
- dev-libs/libgudev:=
- >=dev-libs/libgusb-0.2.9[introspection]
- >=dev-libs/libxmlb-0.1.5
- dev-python/pillow[${PYTHON_USEDEP}]
- dev-python/pycairo[${PYTHON_USEDEP}]
- dev-python/pygobject:3[cairo,${PYTHON_USEDEP}]
- >=net-libs/libsoup-2.51.92:2.4[introspection]
- >=sys-auth/polkit-0.103
- virtual/libelf:0=
- colorhug? ( >=x11-misc/colord-1.2.12:0= )
- dell? (
- sys-libs/efivar
- >=sys-libs/libsmbios-2.4.0
- )
- gpg? (
- app-crypt/gpgme
- dev-libs/libgpg-error
- )
- nvme? ( sys-libs/efivar )
- pkcs7? ( >=net-libs/gnutls-3.4.4.1:= )
- redfish? ( sys-libs/efivar )
- !systemd? (
- !elogind? ( >=sys-auth/consolekit-1.0.0 )
- elogind? ( sys-auth/elogind )
- )
- systemd? ( >=sys-apps/systemd-211 )
- thunderbolt? ( sys-apps/thunderbolt-software-user-space )
- uefi? (
- media-libs/fontconfig
- media-libs/freetype
- sys-boot/gnu-efi
- >=sys-libs/efivar-33
- x11-libs/cairo
- )
-"
-DEPEND="${RDEPEND}
- $(vala_depend)
- x11-libs/pango[introspection]
- nvme? ( >=sys-kernel/linux-headers-4.4 )
- test? ( net-libs/gnutls[tools] )
-"
-BDEPEND="
- >=dev-util/meson-0.47.0
- virtual/pkgconfig
- doc? ( dev-util/gtk-doc )
- man? ( app-text/docbook-sgml-utils )
-"
-
-# required for fwupd daemon to run.
-# NOT a build time dependency. The build system does not check for dbus.
-PDEPEND="sys-apps/dbus"
-
-PATCHES=( "${FILESDIR}/${P}-elogind.patch" ) # bug 668522
-
-src_prepare() {
- default
- sed -e "s/'--create'/'--absolute-name', '--create'/" \
- -i data/tests/builder/meson.build || die
- sed -e "/'-Werror',/d" \
- -i plugins/uefi/efi/meson.build || die
- vala_src_prepare
-}
-
-src_configure() {
- xdg_environment_reset
- local emesonargs=(
- --localstatedir "${EPREFIX}"/var
- -Dgtkdoc="$(usex doc true false)"
- -Delogind="$(usex elogind true false)"
- -Dgpg="$(usex gpg true false)"
- -Dman="$(usex man true false)"
- -Dpkcs7="$(usex pkcs7 true false)"
- -Dplugin_dell="$(usex dell true false)"
- -Dplugin_nvme="$(usex nvme true false)"
- -Dplugin_redfish="$(usex redfish true false)"
- -Dplugin_synaptics="$(usex dell true false)"
- -Dplugin_thunderbolt="$(usex thunderbolt true false)"
- -Dplugin_uefi="$(usex uefi true false)"
- -Dsystemd="$(usex systemd true false)"
- -Dtests="$(usex test true false)"
- )
- use elogind || use systemd || emesonargs+=( -Dconsolekit=true )
- meson_src_configure
-}
-
-src_install() {
- meson_src_install
- doinitd "${FILESDIR}"/${PN}
-
- if ! use systemd && ! use elogind ; then
- # Don't timeout when fwupd is running (#673140)
- sed '/^IdleTimeout=/s@=[[:digit:]]\+@=0@' \
- -i "${ED}"/etc/${PN}/daemon.conf || die
- fi
-}
-
-pkg_postinst() {
- elog "In case you are using openrc as init system"
- elog "and you're upgrading from <fwupd-1.1.0, you"
- elog "need to start the fwupd daemon via the openrc"
- elog "init script that comes with this package."
-}