x11-misc/light-locker: fix elogind patch, bug 687318
authorDenis Dupeyron <calchan@gentoo.org>
Mon, 10 Jun 2019 14:43:37 +0000 (08:43 -0600)
committerDenis Dupeyron <calchan@gentoo.org>
Mon, 10 Jun 2019 14:43:37 +0000 (08:43 -0600)
Package-Manager: Portage-2.3.67, Repoman-2.3.13
Signed-off-by: Denis Dupeyron <calchan@gentoo.org>
x11-misc/light-locker/files/light-locker-1.9.0-elogind.patch
x11-misc/light-locker/light-locker-1.9.0-r2.ebuild [moved from x11-misc/light-locker/light-locker-1.9.0-r1.ebuild with 100% similarity]

index 298e75844c4bbd3410d5e8ec2a47f7b1199338cd..aa630bd1fd28e17d9804178f259102a32011adfc 100644 (file)
@@ -1,14 +1,15 @@
-From 76afbe0757d8846d76bfed350aa9c9e4242aef86 Mon Sep 17 00:00:00 2001
-From: Denis Dupeyron <calchan@gentoo.org>
-Date: Thu, 23 May 2019 13:52:12 -0600
-Subject: [PATCH] Port light-locker-1.8.0-elogind.patch
+From 0b5dbd25a21a16b93c371fd892b910969e4b2d58 Mon Sep 17 00:00:00 2001
+From: Robert Dyer <robert.dyer@sony.com>
+Date: Mon, 3 Jun 2019 22:17:08 -0500
+Subject: [PATCH] fix-up light-locker-1.9.0-elogind.patch
 
 ---
  README.md              |  2 ++
- configure.ac.in        | 37 +++++++++++++++++++++++++++++++++++++
- src/gs-listener-dbus.c | 34 +++++++++++++++++++---------------
+ configure.ac.in        | 39 ++++++++++++++++++++++++++++++++++++++-
+ src/Makefile.am        |  4 +++-
+ src/gs-listener-dbus.c | 32 +++++++++++++++++---------------
  src/light-locker.c     |  6 ++++++
4 files changed, 64 insertions(+), 15 deletions(-)
5 files changed, 66 insertions(+), 17 deletions(-)
 
 diff --git a/README.md b/README.md
 index 86b66d0..b093a4f 100644
@@ -24,9 +25,18 @@ index 86b66d0..b093a4f 100644
  
    --with-mit-ext: This enables the lock-after-screensaver feature. This options requires the X11 Screen Saver extension development files to be installed.
 diff --git a/configure.ac.in b/configure.ac.in
-index f95863a..5c92191 100644
+index 67c271b..2c0678f 100644
 --- a/configure.ac.in
 +++ b/configure.ac.in
+@@ -408,7 +408,7 @@ if test "x$with_systemd" = "xauto" ; then
+                 use_systemd=yes
+         fi
+ else
+-      use_systemd=$with_systemd
++        use_systemd=$with_systemd
+ fi
+ if test "x$use_systemd" = "xyes"; then
 @@ -421,6 +421,42 @@ fi
  AC_SUBST(SYSTEMD_CFLAGS)
  AC_SUBST(SYSTEMD_LIBS)
@@ -55,7 +65,7 @@ index f95863a..5c92191 100644
 +                use_elogind=yes
 +        fi
 +else
-+       use_elogind=$with_elogind
++        use_elogind=$with_elogind
 +fi
 +
 +if test "x$use_elogind" = "xyes"; then
@@ -74,89 +84,109 @@ index f95863a..5c92191 100644
                      Platform:
                      ---------
          systemd:                  ${use_systemd}
-+      elogind:                  ${use_elogind}
++        elogind:                  ${use_elogind}
          UPower:                   ${use_upower}
  
                      Features:
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 0fa4ef9..be6fb0d 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -25,6 +25,7 @@ AM_CPPFLAGS =                                                        \
+       $(DBUS_CFLAGS)                                          \
+       $(LIBNOTIFY_CFLAGS)                                     \
+       $(SYSTEMD_CFLAGS)                                       \
++      $(ELOGIND_CFLAGS)                                       \
+       $(NULL)
+ bin_PROGRAMS = \
+@@ -90,7 +91,8 @@ light_locker_SOURCES =       \
+ light_locker_LDADD =          \
+       $(LIGHT_LOCKER_LIBS)    \
+       $(SAVER_LIBS)                   \
+-      $(SYSTEMD_LIBS)                 \
++      $(SYSTEMD_LIBS)                 \
++      $(ELOGIND_LIBS)                 \
+       $(NULL)
+ light_locker_LDFLAGS = -export-dynamic
 diff --git a/src/gs-listener-dbus.c b/src/gs-listener-dbus.c
-index 044a2bf..164856f 100644
+index 044a2bf..3ba476e 100644
 --- a/src/gs-listener-dbus.c
 +++ b/src/gs-listener-dbus.c
-@@ -43,6 +43,10 @@
+@@ -41,6 +41,8 @@
+ #ifdef WITH_SYSTEMD
  #include <systemd/sd-login.h>
++#elif WITH_ELOGIND
++#include <elogind/systemd/sd-login.h>
  #endif
  
-+#ifdef WITH_ELOGIND
-+#include <elogind/systemd/sd-login.h>
-+#endif
-+
  #include "gs-listener-dbus.h"
- #include "gs-marshal.h"
- #include "gs-debug.h"
-@@ -78,7 +82,7 @@ struct GSListenerPrivate
+@@ -78,7 +80,7 @@ struct GSListenerPrivate
          char           *session_id;
          char           *seat_path;
  
 -#ifdef WITH_SYSTEMD
-+#ifdef WITH_SYSTEMD || defined(WITH_ELOGIND)
++#if defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)
          gboolean        have_systemd;
          char           *sd_session_id;
          int             delay_fd;
-@@ -134,7 +138,7 @@ gs_listener_send_switch_greeter (GSListener *listener)
+@@ -134,7 +136,7 @@ gs_listener_send_switch_greeter (GSListener *listener)
  
          gs_debug ("Send switch greeter");
  
 -#ifdef WITH_SYSTEMD
-+#ifdef WITH_SYSTEMD || defined(WITH_ELOGIND)
++#if defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)
          /* Compare with 0. On failure this will return < 0.
           * In the later case we probably aren't using systemd.
           */
-@@ -175,7 +179,7 @@ gs_listener_send_lock_session (GSListener *listener)
+@@ -175,7 +177,7 @@ gs_listener_send_lock_session (GSListener *listener)
  
          gs_debug ("Send lock session");
  
 -#ifdef WITH_SYSTEMD
-+#ifdef WITH_SYSTEMD || defined(WITH_ELOGIND)
++#if defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)
          /* Compare with 0. On failure this will return < 0.
           * In the later case we probably aren't using systemd.
           */
-@@ -359,7 +363,7 @@ gs_listener_set_idle_hint (GSListener *listener, gboolean idle)
+@@ -359,7 +361,7 @@ gs_listener_set_idle_hint (GSListener *listener, gboolean idle)
  
          gs_debug ("Send idle hint: %d", idle);
  
 -#ifdef WITH_SYSTEMD
-+#ifdef WITH_SYSTEMD || defined(WITH_ELOGIND)
++#if defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)
          if (listener->priv->have_systemd) {
  
                  if (listener->priv->system_connection == NULL) {
-@@ -400,7 +404,7 @@ gs_listener_set_idle_hint (GSListener *listener, gboolean idle)
+@@ -400,7 +402,7 @@ gs_listener_set_idle_hint (GSListener *listener, gboolean idle)
  void
  gs_listener_delay_suspend (GSListener *listener)
  {
 -#ifdef WITH_SYSTEMD
-+#ifdef WITH_SYSTEMD || defined(WITH_ELOGIND)
++#if defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)
          DBusMessage    *message;
          DBusMessage    *reply;
          DBusError       error;
-@@ -473,7 +477,7 @@ gs_listener_delay_suspend (GSListener *listener)
+@@ -473,7 +475,7 @@ gs_listener_delay_suspend (GSListener *listener)
  void
  gs_listener_resume_suspend (GSListener *listener)
  {
 -#ifdef WITH_SYSTEMD
-+#ifdef WITH_SYSTEMD || defined(WITH_ELOGIND)
++#if defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)
          gs_debug ("Resume suspend: fd=%d", listener->priv->delay_fd);
  
          if (listener->priv->delay_fd >= 0) {
-@@ -1076,7 +1080,7 @@ _listener_message_path_is_our_session (GSListener  *listener,
+@@ -1076,7 +1078,7 @@ _listener_message_path_is_our_session (GSListener  *listener,
          return FALSE;
  }
  
 -#ifdef WITH_SYSTEMD
-+#ifdef WITH_SYSTEMD || defined(WITH_ELOGIND)
++#if defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)
  static gboolean
  query_session_active (GSListener *listener)
  {
-@@ -1212,7 +1216,7 @@ query_lid_closed (GSListener *listener)
+@@ -1212,7 +1214,7 @@ query_lid_closed (GSListener *listener)
  #endif
  #endif
  
@@ -165,78 +195,78 @@ index 044a2bf..164856f 100644
  static gboolean
  properties_changed_match (DBusMessage *message,
                            const char  *property)
-@@ -1307,7 +1311,7 @@ listener_dbus_handle_system_message (DBusConnection *connection,
+@@ -1307,7 +1309,7 @@ listener_dbus_handle_system_message (DBusConnection *connection,
                    dbus_message_get_destination (message));
  #endif
  
 -#ifdef WITH_SYSTEMD
-+#ifdef WITH_SYSTEMD || defined(WITH_ELOGIND)
++#if defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)
  
          if (listener->priv->have_systemd) {
  
-@@ -1880,7 +1884,7 @@ gs_listener_acquire (GSListener *listener,
+@@ -1880,7 +1882,7 @@ gs_listener_acquire (GSListener *listener,
                                              listener_dbus_system_filter_function,
                                              listener,
                                              NULL);
 -#ifdef WITH_SYSTEMD
-+#ifdef WITH_SYSTEMD || defined(WITH_ELOGIND)
++#if defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)
                  if (listener->priv->have_systemd) {
                          dbus_bus_add_match (listener->priv->system_connection,
                                              "type='signal'"
-@@ -1971,7 +1975,7 @@ query_session_id (GSListener *listener)
+@@ -1971,7 +1973,7 @@ query_session_id (GSListener *listener)
  
          dbus_error_init (&error);
  
 -#ifdef WITH_SYSTEMD
-+#ifdef WITH_SYSTEMD || defined(WITH_ELOGIND)
++#if defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)
          if (listener->priv->have_systemd) {
                  dbus_uint32_t pid = getpid();
  
-@@ -2022,7 +2026,7 @@ query_session_id (GSListener *listener)
+@@ -2022,7 +2024,7 @@ query_session_id (GSListener *listener)
          return NULL;
  }
  
 -#ifdef WITH_SYSTEMD
-+#ifdef WITH_SYSTEMD || defined(WITH_ELOGIND)
++#if defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)
  static char *
  query_sd_session_id (GSListener *listener)
  {
-@@ -2053,7 +2057,7 @@ init_session_id (GSListener *listener)
+@@ -2053,7 +2055,7 @@ init_session_id (GSListener *listener)
          else
                  gs_debug ("Got session-id: %s", listener->priv->session_id);
  
 -#ifdef WITH_SYSTEMD
-+#ifdef WITH_SYSTEMD || defined(WITH_ELOGIND)
++#if defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)
          g_free (listener->priv->sd_session_id);
          listener->priv->sd_session_id = query_sd_session_id (listener);
          if (listener->priv->sd_session_id == NULL)
-@@ -2150,7 +2154,7 @@ gs_listener_init (GSListener *listener)
+@@ -2150,7 +2152,7 @@ gs_listener_init (GSListener *listener)
  {
          listener->priv = GS_LISTENER_GET_PRIVATE (listener);
  
 -#ifdef WITH_SYSTEMD
-+#ifdef WITH_SYSTEMD || defined(WITH_ELOGIND)
++#if defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)
          /* check if logind is running */
          listener->priv->have_systemd = (access("/run/systemd/seats/", F_OK) >= 0);
          listener->priv->delay_fd = -1;
-@@ -2179,7 +2183,7 @@ gs_listener_finalize (GObject *object)
+@@ -2179,7 +2181,7 @@ gs_listener_finalize (GObject *object)
          g_free (listener->priv->session_id);
          g_free (listener->priv->seat_path);
  
 -#ifdef WITH_SYSTEMD
-+#ifdef WITH_SYSTEMD || defined(WITH_ELOGIND)
++#if defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)
          g_free (listener->priv->sd_session_id);
  #endif
  
 diff --git a/src/light-locker.c b/src/light-locker.c
-index aefc4c6..51ae519 100644
+index aefc4c6..612e300 100644
 --- a/src/light-locker.c
 +++ b/src/light-locker.c
 @@ -139,6 +139,7 @@ main (int    argc,
          gs_debug ("Platform:\n"
                    "gtk:        %d\n"
                    "systemd:    %s\n"
-+                "elogind:    %s"
++                  "elogind:    %s\n"
                    "UPower:     %s",
                    GTK_MAJOR_VERSION,
  #ifdef WITH_SYSTEMD
@@ -245,9 +275,9 @@ index aefc4c6..51ae519 100644
                    "no",
  #endif
 +#ifdef WITH_ELOGIND
-+                  "yes"
++                  "yes",
 +#else
-+                  "no"
++                  "no",
 +#endif
  #ifdef WITH_UPOWER
                    "yes"