summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2014-06-02 16:39:34 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2014-06-02 16:39:34 +0000
commitf3898c8e8558763ced81dcf14ee35aa7cb7544e9 (patch)
tree89fdc90e930a1d89899181f678409a75f079bc1a /xfce-base/xfce4-session
parentold (diff)
downloadgentoo-2-f3898c8e8558763ced81dcf14ee35aa7cb7544e9.tar.gz
gentoo-2-f3898c8e8558763ced81dcf14ee35aa7cb7544e9.tar.bz2
gentoo-2-f3898c8e8558763ced81dcf14ee35aa7cb7544e9.zip
Use Fedora patch to introduce power management support using systemd to 4.10 series. Fix missing sys-power/pm-utils dependency in 4.11 (pre-4.12) series.
(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 4868F14D)
Diffstat (limited to 'xfce-base/xfce4-session')
-rw-r--r--xfce-base/xfce4-session/ChangeLog10
-rw-r--r--xfce-base/xfce4-session/files/xfce4-session-4.10.1-systemd.patch400
-rw-r--r--xfce-base/xfce4-session/xfce4-session-4.10.1-r2.ebuild71
-rw-r--r--xfce-base/xfce4-session/xfce4-session-4.11.0-r1.ebuild3
4 files changed, 482 insertions, 2 deletions
diff --git a/xfce-base/xfce4-session/ChangeLog b/xfce-base/xfce4-session/ChangeLog
index 1c9deefa2a1d..2c449d991e19 100644
--- a/xfce-base/xfce4-session/ChangeLog
+++ b/xfce-base/xfce4-session/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for xfce-base/xfce4-session
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/xfce-base/xfce4-session/ChangeLog,v 1.208 2014/06/02 07:07:44 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/xfce-base/xfce4-session/ChangeLog,v 1.209 2014/06/02 16:39:34 ssuominen Exp $
+
+*xfce4-session-4.10.1-r2 (02 Jun 2014)
+
+ 02 Jun 2014; Samuli Suominen <ssuominen@gentoo.org>
+ +files/xfce4-session-4.10.1-systemd.patch, +xfce4-session-4.10.1-r2.ebuild,
+ xfce4-session-4.11.0-r1.ebuild:
+ Use Fedora patch to introduce power management support using systemd to 4.10
+ series. Fix missing sys-power/pm-utils dependency in 4.11 (pre-4.12) series.
02 Jun 2014; Samuli Suominen <ssuominen@gentoo.org>
xfce4-session-4.11.0-r1.ebuild:
diff --git a/xfce-base/xfce4-session/files/xfce4-session-4.10.1-systemd.patch b/xfce-base/xfce4-session/files/xfce4-session-4.10.1-systemd.patch
new file mode 100644
index 000000000000..e174e40d0355
--- /dev/null
+++ b/xfce-base/xfce4-session/files/xfce4-session-4.10.1-systemd.patch
@@ -0,0 +1,400 @@
+http://pkgs.fedoraproject.org/cgit/xfce4-session.git/commit/xfce4-session-4.10.1-systemd.patch?id=9e8af8b3ee7e8e91817d087e80de29b1af6d4943
+
+diff --git a/configure.ac b/configure.ac
+index 46ff366..8feee0b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -98,7 +98,7 @@ XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.9.0])
+
+ dnl Check for polkit / systemd integration
+ XDT_CHECK_OPTIONAL_PACKAGE([SYSTEMD], [polkit-gobject-1], [0.100],
+- [systemd], [Systemd support (through polit)])
++ [systemd], [Systemd support (through polkit)])
+
+ dnl Check for debugging support
+ XDT_FEATURE_DEBUG([xfsm_debug_default])
+@@ -202,10 +202,10 @@ echo " * Legacy session management: yes"
+ else
+ echo " * Legacy session management: no"
+ fi
+-if test x"$GNOME_KEYRING_FOUND" = x"yes"; then
+-echo " * Gnome Keyring support: yes"
++if test x"$SYSTEMD_FOUND" = x"yes"; then
++echo " * Systemd support (through polkit): yes"
+ else
+-echo " * Gnome Keyring support: no"
++echo " * Systemd support (through polkit): no"
+ fi
+
+ echo
+diff --git a/xfce4-session/Makefile.am b/xfce4-session/Makefile.am
+index 5472b33..ea706fd 100644
+--- a/xfce4-session/Makefile.am
++++ b/xfce4-session/Makefile.am
+@@ -38,6 +38,8 @@ xfce4_session_SOURCES = \
+ xfsm-compat-gnome.h \
+ xfsm-compat-kde.c \
+ xfsm-compat-kde.h \
++ xfsm-consolekit.c \
++ xfsm-consolekit.h \
+ xfsm-dns.c \
+ xfsm-dns.h \
+ xfsm-error.c \
+@@ -67,10 +69,6 @@ if HAVE_SYSTEMD
+ xfce4_session_SOURCES += \
+ xfsm-systemd.c \
+ xfsm-systemd.h
+-else
+-xfce4_session_SOURCES += \
+- xfsm-consolekit.c \
+- xfsm-consolekit.h
+ endif
+
+ xfce4_session_CFLAGS = \
+diff --git a/xfce4-session/xfsm-shutdown.c b/xfce4-session/xfsm-shutdown.c
+index 4c483a7..329c4f6 100644
+--- a/xfce4-session/xfsm-shutdown.c
++++ b/xfce4-session/xfsm-shutdown.c
+@@ -63,6 +63,7 @@
+ #include <xfce4-session/xfsm-shutdown.h>
+ #include <xfce4-session/xfsm-compat-gnome.h>
+ #include <xfce4-session/xfsm-compat-kde.h>
++#include <xfce4-session/xfsm-consolekit.h>
+ #include <xfce4-session/xfsm-fadeout.h>
+ #include <xfce4-session/xfsm-global.h>
+ #include <xfce4-session/xfsm-legacy.h>
+@@ -70,8 +71,6 @@
+
+ #ifdef HAVE_SYSTEMD
+ #include <xfce4-session/xfsm-systemd.h>
+-#else
+-#include <xfce4-session/xfsm-consolekit.h>
+ #endif
+
+ static void xfsm_shutdown_finalize (GObject *object);
+@@ -98,9 +97,8 @@ struct _XfsmShutdown
+
+ #ifdef HAVE_SYSTEMD
+ XfsmSystemd *systemd;
+-#else
+- XfsmConsolekit *consolekit;
+ #endif
++ XfsmConsolekit *consolekit;
+ XfsmUPower *upower;
+
+ /* kiosk settings */
+@@ -139,10 +137,14 @@ xfsm_shutdown_init (XfsmShutdown *shutdown)
+ XfceKiosk *kiosk;
+
+ #ifdef HAVE_SYSTEMD
+- shutdown->systemd = xfsm_systemd_get ();
+-#else
+- shutdown->consolekit = xfsm_consolekit_get ();
++ shutdown->consolekit = NULL;
++ shutdown->systemd = NULL;
++ if (LOGIND_RUNNING())
++ shutdown->systemd = xfsm_systemd_get ();
++ else
+ #endif
++ shutdown->consolekit = xfsm_consolekit_get ();
++
+ shutdown->upower = xfsm_upower_get ();
+ shutdown->helper_state = SUDO_NOT_INITIAZED;
+ shutdown->helper_require_password = FALSE;
+@@ -162,10 +164,11 @@ xfsm_shutdown_finalize (GObject *object)
+ XfsmShutdown *shutdown = XFSM_SHUTDOWN (object);
+
+ #ifdef HAVE_SYSTEMD
+- g_object_unref (G_OBJECT (shutdown->systemd));
+-#else
+- g_object_unref (G_OBJECT (shutdown->consolekit));
++ if (shutdown->systemd != NULL)
++ g_object_unref (G_OBJECT (shutdown->systemd));
+ #endif
++ if (shutdown->consolekit != NULL)
++ g_object_unref (G_OBJECT (shutdown->consolekit));
+ g_object_unref (G_OBJECT (shutdown->upower));
+
+ /* close down helper */
+@@ -657,10 +660,11 @@ xfsm_shutdown_try_restart (XfsmShutdown *shutdown,
+ return xfsm_shutdown_sudo_try_action (shutdown, XFSM_SHUTDOWN_RESTART, error);
+ else
+ #ifdef HAVE_SYSTEMD
+- return xfsm_systemd_try_restart (shutdown->systemd, error);
+-#else
+- return xfsm_consolekit_try_restart (shutdown->consolekit, error);
++ if (shutdown->systemd != NULL)
++ return xfsm_systemd_try_restart (shutdown->systemd, error);
++ else
+ #endif
++ return xfsm_consolekit_try_restart (shutdown->consolekit, error);
+ }
+
+
+@@ -678,10 +682,11 @@ xfsm_shutdown_try_shutdown (XfsmShutdown *shutdown,
+ return xfsm_shutdown_sudo_try_action (shutdown, XFSM_SHUTDOWN_SHUTDOWN, error);
+ else
+ #ifdef HAVE_SYSTEMD
+- return xfsm_systemd_try_shutdown (shutdown->systemd, error);
+-#else
+- return xfsm_consolekit_try_shutdown (shutdown->consolekit, error);
++ if (shutdown->systemd != NULL)
++ return xfsm_systemd_try_shutdown (shutdown->systemd, error);
++ else
+ #endif
++ return xfsm_consolekit_try_shutdown (shutdown->consolekit, error);
+ }
+
+
+@@ -692,6 +697,11 @@ xfsm_shutdown_try_suspend (XfsmShutdown *shutdown,
+ {
+ g_return_val_if_fail (XFSM_IS_SHUTDOWN (shutdown), FALSE);
+
++#ifdef HAVE_SYSTEMD
++ if (shutdown->systemd != NULL)
++ return xfsm_systemd_try_suspend (shutdown->systemd, error);
++ else
++#endif
+ return xfsm_upower_try_suspend (shutdown->upower, error);
+ }
+
+@@ -703,6 +713,11 @@ xfsm_shutdown_try_hibernate (XfsmShutdown *shutdown,
+ {
+ g_return_val_if_fail (XFSM_IS_SHUTDOWN (shutdown), FALSE);
+
++#ifdef HAVE_SYSTEMD
++ if (shutdown->systemd != NULL)
++ return xfsm_systemd_try_hibernate (shutdown->systemd, error);
++ else
++#endif
+ return xfsm_upower_try_hibernate (shutdown->upower, error);
+ }
+
+@@ -722,10 +737,14 @@ xfsm_shutdown_can_restart (XfsmShutdown *shutdown,
+ }
+
+ #ifdef HAVE_SYSTEMD
+- if (xfsm_systemd_can_restart (shutdown->systemd, can_restart, error))
+-#else
+- if (xfsm_consolekit_can_restart (shutdown->consolekit, can_restart, error))
++ if (shutdown->systemd != NULL)
++ {
++ if (xfsm_systemd_can_restart (shutdown->systemd, can_restart, error))
++ return TRUE;
++ }
++ else
+ #endif
++ if (xfsm_consolekit_can_restart (shutdown->consolekit, can_restart, error))
+ return TRUE;
+
+ if (xfsm_shutdown_sudo_init (shutdown, error))
+@@ -753,10 +772,14 @@ xfsm_shutdown_can_shutdown (XfsmShutdown *shutdown,
+ }
+
+ #ifdef HAVE_SYSTEMD
+- if (xfsm_systemd_can_shutdown (shutdown->systemd, can_shutdown, error))
+-#else
+- if (xfsm_consolekit_can_shutdown (shutdown->consolekit, can_shutdown, error))
++ if (shutdown->systemd != NULL)
++ {
++ if (xfsm_systemd_can_shutdown (shutdown->systemd, can_shutdown, error))
++ return TRUE;
++ }
++ else
+ #endif
++ if (xfsm_consolekit_can_shutdown (shutdown->consolekit, can_shutdown, error))
+ return TRUE;
+
+ if (xfsm_shutdown_sudo_init (shutdown, error))
+@@ -784,6 +807,12 @@ xfsm_shutdown_can_suspend (XfsmShutdown *shutdown,
+ return TRUE;
+ }
+
++#ifdef HAVE_SYSTEMD
++ if (shutdown->systemd != NULL)
++ return xfsm_systemd_can_suspend (shutdown->systemd, can_suspend,
++ auth_suspend, error);
++ else
++#endif
+ return xfsm_upower_can_suspend (shutdown->upower, can_suspend,
+ auth_suspend, error);
+ }
+@@ -804,6 +833,12 @@ xfsm_shutdown_can_hibernate (XfsmShutdown *shutdown,
+ return TRUE;
+ }
+
++#ifdef HAVE_SYSTEMD
++ if (shutdown->systemd != NULL)
++ return xfsm_systemd_can_hibernate (shutdown->systemd, can_hibernate,
++ auth_hibernate, error);
++ else
++#endif
+ return xfsm_upower_can_hibernate (shutdown->upower, can_hibernate,
+ auth_hibernate, error);
+ }
+diff --git a/xfce4-session/xfsm-systemd.c b/xfce4-session/xfsm-systemd.c
+index 7bdd39d..f18fbf7 100644
+--- a/xfce4-session/xfsm-systemd.c
++++ b/xfce4-session/xfsm-systemd.c
+@@ -24,6 +24,7 @@
+ #include <dbus/dbus-glib.h>
+ #include <dbus/dbus-glib-lowlevel.h>
+
++#include <libxfsm/xfsm-util.h>
+ #include <xfce4-session/xfsm-systemd.h>
+
+
+@@ -33,8 +34,12 @@
+ #define SYSTEMD_DBUS_INTERFACE "org.freedesktop.login1.Manager"
+ #define SYSTEMD_REBOOT_ACTION "Reboot"
+ #define SYSTEMD_POWEROFF_ACTION "PowerOff"
++#define SYSTEMD_SUSPEND_ACTION "Suspend"
++#define SYSTEMD_HIBERNATE_ACTION "Hibernate"
+ #define SYSTEMD_REBOOT_TEST "org.freedesktop.login1.reboot"
+ #define SYSTEMD_POWEROFF_TEST "org.freedesktop.login1.power-off"
++#define SYSTEMD_SUSPEND_TEST "org.freedesktop.login1.suspend"
++#define SYSTEMD_HIBERNATE_TEST "org.freedesktop.login1.hibernate"
+
+
+
+@@ -93,6 +98,22 @@ xfsm_systemd_finalize (GObject *object)
+ }
+
+
++
++static gboolean
++xfsm_systemd_lock_screen (GError **error)
++{
++ XfconfChannel *channel;
++ gboolean ret = TRUE;
++
++ channel = xfsm_open_config ();
++ if (xfconf_channel_get_bool (channel, "/shutdown/LockScreen", FALSE))
++ ret = g_spawn_command_line_async ("xflock4", error);
++
++ return ret;
++}
++
++
++
+ static gboolean
+ xfsm_systemd_can_method (XfsmSystemd *systemd,
+ gboolean *can_method,
+@@ -205,6 +226,34 @@ xfsm_systemd_try_shutdown (XfsmSystemd *systemd,
+
+
+ gboolean
++xfsm_systemd_try_suspend (XfsmSystemd *systemd,
++ GError **error)
++{
++ if (!xfsm_systemd_lock_screen (error))
++ return FALSE;
++
++ return xfsm_systemd_try_method (systemd,
++ SYSTEMD_SUSPEND_ACTION,
++ error);
++}
++
++
++
++gboolean
++xfsm_systemd_try_hibernate (XfsmSystemd *systemd,
++ GError **error)
++{
++ if (!xfsm_systemd_lock_screen (error))
++ return FALSE;
++
++ return xfsm_systemd_try_method (systemd,
++ SYSTEMD_HIBERNATE_ACTION,
++ error);
++}
++
++
++
++gboolean
+ xfsm_systemd_can_restart (XfsmSystemd *systemd,
+ gboolean *can_restart,
+ GError **error)
+@@ -227,3 +276,39 @@ xfsm_systemd_can_shutdown (XfsmSystemd *systemd,
+ SYSTEMD_POWEROFF_TEST,
+ error);
+ }
++
++
++
++gboolean
++xfsm_systemd_can_suspend (XfsmSystemd *systemd,
++ gboolean *can_suspend,
++ gboolean *auth_suspend,
++ GError **error)
++{
++ gboolean ret = FALSE;
++
++ ret = xfsm_systemd_can_method (systemd,
++ can_suspend,
++ SYSTEMD_SUSPEND_TEST,
++ error);
++ *auth_suspend = *can_suspend;
++ return ret;
++}
++
++
++
++gboolean
++xfsm_systemd_can_hibernate (XfsmSystemd *systemd,
++ gboolean *can_hibernate,
++ gboolean *auth_hibernate,
++ GError **error)
++{
++ gboolean ret = FALSE;
++
++ ret = xfsm_systemd_can_method (systemd,
++ can_hibernate,
++ SYSTEMD_HIBERNATE_TEST,
++ error);
++ *auth_hibernate = *can_hibernate;
++ return ret;
++}
+diff --git a/xfce4-session/xfsm-systemd.h b/xfce4-session/xfsm-systemd.h
+index 8223622..c5e74b5 100644
+--- a/xfce4-session/xfsm-systemd.h
++++ b/xfce4-session/xfsm-systemd.h
+@@ -22,6 +22,8 @@
+ #ifndef __XFSM_SYSTEMD_H__
+ #define __XFSM_SYSTEMD_H__
+
++#define LOGIND_RUNNING() (access ("/run/systemd/seats/", F_OK) >= 0)
++
+ typedef struct _XfsmSystemdClass XfsmSystemdClass;
+ typedef struct _XfsmSystemd XfsmSystemd;
+
+@@ -42,6 +44,12 @@ gboolean xfsm_systemd_try_restart (XfsmSystemd *systemd,
+ gboolean xfsm_systemd_try_shutdown (XfsmSystemd *systemd,
+ GError **error);
+
++gboolean xfsm_systemd_try_suspend (XfsmSystemd *systemd,
++ GError **error);
++
++gboolean xfsm_systemd_try_hibernate (XfsmSystemd *systemd,
++ GError **error);
++
+ gboolean xfsm_systemd_can_restart (XfsmSystemd *systemd,
+ gboolean *can_restart,
+ GError **error);
+@@ -50,6 +58,16 @@ gboolean xfsm_systemd_can_shutdown (XfsmSystemd *systemd,
+ gboolean *can_shutdown,
+ GError **error);
+
++gboolean xfsm_systemd_can_suspend (XfsmSystemd *systemd,
++ gboolean *can_suspend,
++ gboolean *auth_suspend,
++ GError **error);
++
++gboolean xfsm_systemd_can_hibernate (XfsmSystemd *systemd,
++ gboolean *can_hibernate,
++ gboolean *auth_hibernate,
++ GError **error);
++
+ G_END_DECLS
+
+ #endif /* __XFSM_SYSTEMD_H__ */
diff --git a/xfce-base/xfce4-session/xfce4-session-4.10.1-r2.ebuild b/xfce-base/xfce4-session/xfce4-session-4.10.1-r2.ebuild
new file mode 100644
index 000000000000..302138299024
--- /dev/null
+++ b/xfce-base/xfce4-session/xfce4-session-4.10.1-r2.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/xfce-base/xfce4-session/xfce4-session-4.10.1-r2.ebuild,v 1.1 2014/06/02 16:39:34 ssuominen Exp $
+
+EAPI=5
+EAUTORECONF=1
+inherit xfconf
+
+DESCRIPTION="A session manager for the Xfce desktop environment"
+HOMEPAGE="http://docs.xfce.org/xfce/xfce4-session/start"
+SRC_URI="mirror://xfce/src/xfce/${PN}/${PV%.*}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~x86-solaris"
+IUSE="debug nls systemd udev +xscreensaver"
+
+COMMON_DEPEND=">=dev-libs/dbus-glib-0.100
+ x11-apps/iceauth
+ x11-libs/libSM
+ >=x11-libs/libwnck-2.30:1
+ x11-libs/libX11
+ >=xfce-base/libxfce4util-4.10.1
+ >=xfce-base/libxfce4ui-4.10
+ >=xfce-base/xfconf-4.10
+ !xfce-base/xfce-utils
+ systemd? ( >=sys-auth/polkit-0.100 )"
+RDEPEND="${COMMON_DEPEND}
+ x11-apps/xrdb
+ nls? ( x11-misc/xdg-user-dirs )
+ udev? (
+ systemd? ( || ( >=sys-power/upower-0.9.23 sys-power/upower-pm-utils ) )
+ !systemd? ( || ( <sys-power/upower-0.99 sys-power/upower-pm-utils ) )
+ )
+ xscreensaver? ( || (
+ >=x11-misc/xscreensaver-5.26
+ gnome-extra/gnome-screensaver
+ >=x11-misc/xlockmore-5.43
+ x11-misc/slock
+ x11-misc/alock[pam]
+ ) )"
+DEPEND="${COMMON_DEPEND}
+ dev-util/intltool
+ sys-devel/gettext
+ virtual/pkgconfig"
+
+pkg_setup() {
+ PATCHES=(
+ "${FILESDIR}"/${P}-alock_support_to_xflock4.patch
+ "${FILESDIR}"/${P}-systemd.patch
+ )
+
+ XFCONF=(
+ --docdir="${EPREFIX}"/usr/share/doc/${PF}
+ $(use_enable systemd)
+ --with-xsession-prefix="${EPREFIX}"/usr
+ $(xfconf_use_debug)
+ )
+
+ DOCS=( AUTHORS BUGS ChangeLog NEWS README TODO )
+}
+
+src_install() {
+ xfconf_src_install
+
+ local sessiondir=/etc/X11/Sessions
+ echo startxfce4 > "${T}"/Xfce4
+ exeinto ${sessiondir}
+ doexe "${T}"/Xfce4
+ dosym Xfce4 ${sessiondir}/Xfce
+}
diff --git a/xfce-base/xfce4-session/xfce4-session-4.11.0-r1.ebuild b/xfce-base/xfce4-session/xfce4-session-4.11.0-r1.ebuild
index 3f2bc372abbf..4c4eccd35c3d 100644
--- a/xfce-base/xfce4-session/xfce4-session-4.11.0-r1.ebuild
+++ b/xfce-base/xfce4-session/xfce4-session-4.11.0-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/xfce-base/xfce4-session/xfce4-session-4.11.0-r1.ebuild,v 1.2 2014/06/02 07:07:44 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/xfce-base/xfce4-session/xfce4-session-4.11.0-r1.ebuild,v 1.3 2014/06/02 16:39:34 ssuominen Exp $
EAPI=5
EAUTORECONF=1
@@ -29,6 +29,7 @@ COMMON_DEPEND=">=dev-libs/dbus-glib-0.100
RDEPEND="${COMMON_DEPEND}
x11-apps/xrdb
nls? ( x11-misc/xdg-user-dirs )
+ !systemd? ( udev? ( sys-power/pm-utils ) )
xscreensaver? ( || (
>=x11-misc/xscreensaver-5.26
gnome-extra/gnome-screensaver