commit:     bd4281d8c205c8c426fd85433717397c4a561793
Author:     Michael Palimaka <kensington <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  9 14:03:41 2017 +0000
Commit:     Michael Palimaka <kensington <AT> gentoo <DOT> org>
CommitDate: Fri Jun  9 14:03:59 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bd4281d8

sys-apps/accountsservice: backport patch from upstream adding elogind support

Gentoo-bug: 599492
Package-Manager: Portage-2.3.5, Repoman-2.3.2

 .../accountsservice-0.6.43-r1.ebuild               |  60 +++++++++++
 .../files/accountsservice-0.6.43-elogind.patch     | 110 +++++++++++++++++++++
 sys-apps/accountsservice/metadata.xml              |   2 +
 3 files changed, 172 insertions(+)

diff --git a/sys-apps/accountsservice/accountsservice-0.6.43-r1.ebuild 
b/sys-apps/accountsservice/accountsservice-0.6.43-r1.ebuild
new file mode 100644
index 00000000000..ff329f6118c
--- /dev/null
+++ b/sys-apps/accountsservice/accountsservice-0.6.43-r1.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+GNOME2_EAUTORECONF="yes"
+inherit gnome2 systemd
+
+DESCRIPTION="D-Bus interfaces for querying and manipulating user account 
information"
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/AccountsService/";
+SRC_URI="https://www.freedesktop.org/software/${PN}/${P}.tar.xz";
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+
+IUSE="doc elogind +introspection selinux systemd"
+
+REQUIRED_USE="?? ( elogind systemd )"
+
+CDEPEND="
+       >=dev-libs/glib-2.37.3:2
+       sys-auth/polkit
+       elogind? ( >=sys-auth/elogind-229.4 )
+       introspection? ( >=dev-libs/gobject-introspection-0.9.12:= )
+       systemd? ( >=sys-apps/systemd-186:0= )
+       !systemd? ( !elogind? ( sys-auth/consolekit ) )
+"
+DEPEND="${CDEPEND}
+       dev-libs/libxslt
+       dev-util/gdbus-codegen
+       >=dev-util/gtk-doc-am-1.15
+       >=dev-util/intltool-0.40
+       sys-devel/gettext
+       virtual/pkgconfig
+       doc? (
+               app-text/docbook-xml-dtd:4.1.2
+               app-text/xmlto )
+"
+RDEPEND="${CDEPEND}
+       selinux? ( sec-policy/selinux-accountsd )
+"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-0.6.35-gentoo-system-users.patch"
+       "${FILESDIR}/${P}-elogind.patch"
+)
+
+src_configure() {
+       gnome2_src_configure \
+               --disable-static \
+               --disable-more-warnings \
+               --localstatedir="${EPREFIX}"/var \
+               --enable-admin-group="wheel" \
+               --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
+               $(use_enable doc docbook-docs) \
+               $(use_enable elogind) \
+               $(use_enable introspection) \
+               $(use_enable systemd)
+}

diff --git 
a/sys-apps/accountsservice/files/accountsservice-0.6.43-elogind.patch 
b/sys-apps/accountsservice/files/accountsservice-0.6.43-elogind.patch
new file mode 100644
index 00000000000..cd3510eab86
--- /dev/null
+++ b/sys-apps/accountsservice/files/accountsservice-0.6.43-elogind.patch
@@ -0,0 +1,110 @@
+From 9fdd1d95ec094a0df6d8d3dd9c8f04fa8499b845 Mon Sep 17 00:00:00 2001
+From: Sven Eden <[email protected]>
+Date: Tue, 6 Jun 2017 10:17:33 -0400
+Subject: configure: elogind on non-systemd systems
+
+This commit adds some configure goo to make accountsservice use
+elogind if explicitly requested for systems that don't have
+systemd.
+
+diff --git a/configure.ac b/configure.ac
+index b255e72..4b21477 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -264,22 +264,24 @@ dnl Check for xsltproc
+ dnl 
---------------------------------------------------------------------------
+ AC_PATH_PROG([XSLTPROC], [xsltproc])
+ 
+-# systemd
++# systemd or elogind
++
++have_systemd=no
++
++AC_MSG_CHECKING([whether to use systemd])
+ 
+ AC_ARG_ENABLE([systemd],
+               AS_HELP_STRING([--enable-systemd], [Use systemd]),
+               [enable_systemd=$enableval],
+               [enable_systemd=auto])
+ 
++AC_MSG_RESULT($enable_systemd)
++
+ if test x$enable_systemd != xno; then
+-   PKG_CHECK_MODULES(SYSTEMD, [libsystemd >= 186],
+-                                           [have_systemd=yes], 
[have_systemd=no])
+-else
+-   have_systemd=no
++        PKG_CHECK_MODULES(SYSTEMD, [libsystemd >= 186],
++                                   [have_systemd=yes])
+ fi
+ 
+-AC_MSG_CHECKING([whether to use systemd])
+-
+ if test x$enable_systemd = xauto ; then
+         if test x$have_systemd = xno ; then
+                 enable_systemd=no
+@@ -288,21 +290,54 @@ if test x$enable_systemd = xauto ; then
+         fi
+ fi
+ 
+-AC_MSG_RESULT($enable_systemd)
++have_elogind=no
++
++AC_MSG_CHECKING([whether to use elogind])
++
++AC_ARG_ENABLE([elogind],
++              AS_HELP_STRING([--enable-elogind], [Use elogind]),
++              [enable_elogind=$enableval],
++              [enable_elogind=no])
++
++AC_MSG_RESULT($enable_elogind)
+ 
+ if test x$enable_systemd = xyes; then
+         if test x$have_systemd = xno; then
+-                AC_MSG_ERROR([Systemd support explicitly required, but 
systemd not found])
++                AC_MSG_ERROR([Systemd support explicitly requested, but 
libsystemd not found])
++        fi
++
++        dnl Requesting to use the elogind session tracker makes no sense where
++        dnl systemd-login is (or might be) running.
++        if test x$enable_elogind = xyes; then
++                AC_MSG_WARN([elogind support requested, but systemd was 
found.])
++                AC_MSG_ERROR([Disable either elogind or systemd support.])
+         fi
++
++        AC_SUBST(SYSTEMD_CFLAGS)
++        AC_SUBST(SYSTEMD_LIBS)
++
++        LIBACCOUNTSSERVICE_LIBS="$LIBACCOUNTSSERVICE_LIBS $SYSTEMD_LIBS"
++        LIBACCOUNTSSERVICE_CFLAGS="$LIBACCOUNTSSERVICE_CFLAGS $SYSTEMD_CFLAGS"
++
+         AC_DEFINE(HAVE_SYSTEMD, 1, [Define if systemd is used])
+ fi
+-AC_SUBST(SYSTEMD_CFLAGS)
+-AC_SUBST(SYSTEMD_LIBS)
+ 
+-LIBACCOUNTSSERVICE_LIBS="$LIBACCOUNTSSERVICE_LIBS $SYSTEMD_LIBS"
+-LIBACCOUNTSSERVICE_CFLAGS="$LIBACCOUNTSSERVICE_CFLAGS $SYSTEMD_CFLAGS"
++if test "x$enable_elogind" != "xno"; then
++        PKG_CHECK_MODULES(ELOGIND, [libelogind >= 229.4],
++                                   [have_elogind=yes])
++
++        if test "x$have_elogind" != "xyes"; then
++                AC_MSG_ERROR([elogind support requested, but libelogind not 
found])
++        else
++                AC_SUBST(ELOGIND_CFLAGS)
++                AC_SUBST(ELOGIND_LIBS)
++
++                LIBACCOUNTSSERVICE_LIBS="$LIBACCOUNTSSERVICE_LIBS 
$ELOGIND_LIBS"
++                LIBACCOUNTSSERVICE_CFLAGS="$LIBACCOUNTSSERVICE_CFLAGS 
$ELOGIND_CFLAGS"
++        fi
++fi
+ 
+-if test "x$have_systemd" != "xno" ; then
++if test "x${have_systemd}" != "xno" -o "x${have_elogind}" != "xno" ; then
+         AC_DEFINE(WITH_SYSTEMD, 1, [Define to enable systemd support])
+ fi
+ 
+-- 
+cgit v0.10.2
+

diff --git a/sys-apps/accountsservice/metadata.xml 
b/sys-apps/accountsservice/metadata.xml
index df1259a78b2..69657d082ae 100644
--- a/sys-apps/accountsservice/metadata.xml
+++ b/sys-apps/accountsservice/metadata.xml
@@ -6,6 +6,8 @@
                <name>Gentoo GNOME Desktop</name>
        </maintainer>
        <use>
+               <flag name="elogind">Use <pkg>sys-auth/elogind</pkg> instead of
+                       <pkg>sys-auth/consolekit</pkg> for session 
tracking</flag>
                <flag name="systemd">Use <pkg>sys-apps/systemd</pkg> instead of
                        <pkg>sys-auth/consolekit</pkg> for session 
tracking</flag>
        </use>

Reply via email to