Update to gnome-session-3.26.1.

This commit is contained in:
ajacoutot 2017-11-02 13:06:53 +00:00
parent cdeb440813
commit b076e22161
8 changed files with 9 additions and 1890 deletions

View File

@ -1,10 +1,9 @@
# $OpenBSD: Makefile,v 1.266 2017/10/23 17:11:04 sthen Exp $
# $OpenBSD: Makefile,v 1.267 2017/11/02 13:06:53 ajacoutot Exp $
COMMENT= GNOME session
GNOME_PROJECT= gnome-session
GNOME_VERSION= 3.24.2
REVISION= 0
GNOME_VERSION= 3.26.1
CATEGORIES= x11
@ -53,18 +52,4 @@ CONFIGURE_STYLE= gnu
CONFIGURE_ARGS= --disable-systemd \
--enable-consolekit
### patch-gnome-session_Makefile_am
AUTOCONF_VERSION= 2.69
AUTOMAKE_VERSION= 1.15
BUILD_DEPENDS += ${MODGNU_AUTOCONF_DEPENDS} \
${MODGNU_AUTOMAKE_DEPENDS} \
devel/libtool
pre-configure:
cd ${WRKSRC} && \
AUTOCONF_VERSION=${AUTOCONF_VERSION} \
AUTOMAKE_VERSION=${AUTOMAKE_VERSION} \
autoreconf -fi
###
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (gnome/gnome-session-3.24.2.tar.xz) = ZIOH42PWCsKMCHcSglM/BW4ei8BybI6YWFSWgdnkX6k=
SIZE (gnome/gnome-session-3.24.2.tar.xz) = 783288
SHA256 (gnome/gnome-session-3.26.1.tar.xz) = 2UFLNo25gtODfKEG5kAZ8Y5s3VsTllvqbH0C3fUQNwg=
SIZE (gnome/gnome-session-3.26.1.tar.xz) = 782676

View File

@ -1,18 +0,0 @@
$OpenBSD: patch-configure_ac,v 1.1 2017/06/24 07:36:39 ajacoutot Exp $
https://wiki.gnome.org/Projects/GnomeCommon/Migration
Index: configure.ac
--- configure.ac.orig
+++ configure.ac
@@ -20,8 +20,8 @@ PKG_PROG_PKG_CONFIG()
LT_PREREQ([2.2.6])
LT_INIT([dlopen disable-static])
-GNOME_MAINTAINER_MODE_DEFINES
-GNOME_COMPILE_WARNINGS([maximum])
+# GNOME_MAINTAINER_MODE_DEFINES
+# GNOME_COMPILE_WARNINGS([maximum])
AC_ARG_ENABLE(deprecation_flags,
[AS_HELP_STRING([--enable-deprecation-flags],

View File

@ -1,47 +0,0 @@
$OpenBSD: patch-gnome-session_Makefile_am,v 1.1 2017/06/24 07:36:39 ajacoutot Exp $
From 1e3b5a2f4c6cb65dfa94b65a84d1f6c2c9dd61fe Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Tue, 20 Jun 2017 15:32:11 -0400
Subject: manager: add bus daemon dbus api xml file
Index: gnome-session/Makefile.am
--- gnome-session/Makefile.am.orig
+++ gnome-session/Makefile.am
@@ -192,6 +192,15 @@ org.gnome.SessionManager.Presence.h: org.gnome.Session
org.gnome.SessionManager.Presence.c: org.gnome.SessionManager.Presence.h
@: # generated as a side-effect
+org.freedesktop.DBus.h org.freedesktop.DBus.c: $(srcdir)/org.freedesktop.DBus.xml Makefile.am
+ $(AM_V_GEN) gdbus-codegen --interface-prefix org.freedesktop.DBus. \
+ --generate-c-code org.freedesktop.DBus \
+ --annotate "org.freedesktop.DBus" "org.gtk.GDBus.C.Name" Bus \
+ --c-namespace Gsm \
+ $(srcdir)/org.freedesktop.DBus.xml \
+ $(NULL)
+
+
BUILT_SOURCES = \
org.gnome.SessionManager.App.h \
org.gnome.SessionManager.App.c \
@@ -204,7 +213,9 @@ BUILT_SOURCES = \
org.gnome.SessionManager.h \
org.gnome.SessionManager.c \
org.gnome.SessionManager.Presence.h \
- org.gnome.SessionManager.Presence.c
+ org.gnome.SessionManager.Presence.c \
+ org.freedesktop.DBus.h \
+ org.freedesktop.DBus.c
EXTRA_DIST += \
README \
@@ -213,7 +224,8 @@ EXTRA_DIST += \
org.gnome.SessionManager.Client.xml \
org.gnome.SessionManager.ClientPrivate.xml \
org.gnome.SessionManager.Inhibitor.xml \
- org.gnome.SessionManager.Presence.xml
+ org.gnome.SessionManager.Presence.xml \
+ org.freedesktop.DBus.xml
CLEANFILES = \
gnome-session \

File diff suppressed because it is too large Load Diff

View File

@ -1,150 +0,0 @@
$OpenBSD: patch-gnome-session_gsm-manager_c,v 1.16 2017/09/15 13:09:02 ajacoutot Exp $
From e7a650b88b92c3381eccef7bf4765fa814389aaa Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Tue, 20 Jun 2017 16:28:10 -0400
Subject: manager: kill off bus clients at log out
Index: gnome-session/gsm-manager.c
--- gnome-session/gsm-manager.c.orig
+++ gnome-session/gsm-manager.c
@@ -39,6 +39,7 @@
#include "gsm-manager.h"
#include "org.gnome.SessionManager.h"
+#include "org.freedesktop.DBus.h"
#ifdef HAVE_SYSTEMD
#include <systemd/sd-journal.h>
@@ -156,6 +157,7 @@ struct GsmManagerPrivate
GsmSystem *system;
GDBusConnection *connection;
+ GsmBus *bus_proxy;
GsmExportedManager *skeleton;
gboolean dbus_disconnected : 1;
@@ -969,7 +971,93 @@ maybe_restart_user_bus (GsmManager *manager)
}
#endif
+static GPid *
+get_pids_for_bus_clients (GsmManager *manager,
+ const char * const *bus_clients)
+{
+ GHashTable *process_id_hash;
+ GHashTableIter iter;
+ gpointer key, value;
+ GPid *process_ids;
+ int i, j;
+
+ process_id_hash = g_hash_table_new (NULL, NULL);
+
+ for (i = 0; bus_clients[i] != NULL; i++) {
+ gboolean ret;
+ GError *error;
+ guint pid;
+
+ error = NULL;
+ ret = gsm_bus_call_get_connection_unix_process_id_sync (manager->priv->bus_proxy,
+ bus_clients[i],
+ &pid,
+ NULL,
+ &error);
+
+ if (! ret) {
+ g_debug ("GsmManager: couldn't get process id of client '%s': %s",
+ bus_clients[i], error->message);
+ g_error_free (error);
+ continue;
+ }
+
+ g_hash_table_add (process_id_hash, GUINT_TO_POINTER (pid));
+ }
+
+ j = 0;
+ process_ids = g_new0 (GPid, g_hash_table_size (process_id_hash) + 1);
+ g_hash_table_iter_init (&iter, process_id_hash);
+ while (g_hash_table_iter_next (&iter, &key, &value)) {
+ process_ids[j++] = (GPid) GPOINTER_TO_UINT (key);
+ }
+
+ g_hash_table_unref (process_id_hash);
+
+ return process_ids;
+}
+
static void
+maybe_kill_bus_clients (GsmManager *manager)
+{
+ GsmSystem *system;
+ gboolean ret;
+ GError *error;
+ GPid *process_ids;
+ char **bus_clients;
+ int i;
+
+ if (manager->priv->dbus_disconnected)
+ return;
+
+ system = gsm_get_system ();
+
+ if (!gsm_system_is_last_session_for_user (system))
+ return;
+
+ error = NULL;
+ ret = gsm_bus_call_list_names_sync (manager->priv->bus_proxy,
+ &bus_clients,
+ NULL,
+ &error);
+
+ if (! ret) {
+ g_warning ("Unable to list bus clients: %s", error->message);
+ g_error_free (error);
+ return;
+ }
+
+ process_ids = get_pids_for_bus_clients (manager, (const char * const *) bus_clients);
+ g_strfreev (bus_clients);
+
+ for (i = 0; process_ids[i] != 0; i++) {
+ kill (process_ids[i], SIGTERM);
+ }
+
+ g_free (process_ids);
+}
+
+static void
do_phase_exit (GsmManager *manager)
{
if (gsm_store_size (manager->priv->clients) > 0) {
@@ -982,6 +1070,8 @@ do_phase_exit (GsmManager *manager)
maybe_restart_user_bus (manager);
#endif
+ maybe_kill_bus_clients (manager);
+
end_phase (manager);
}
@@ -3107,6 +3197,20 @@ register_manager (GsmManager *manager)
if (error != NULL) {
g_critical ("error getting session bus: %s", error->message);
+ g_error_free (error);
+
+ exit (1);
+ }
+
+ manager->priv->bus_proxy = gsm_bus_proxy_new_sync (connection,
+ G_DBUS_PROXY_FLAGS_NONE,
+ "org.freedesktop.DBus",
+ "/org/freedesktop/DBus",
+ NULL,
+ &error);
+
+ if (error != NULL) {
+ g_critical ("error getting proxy to bus daemon: %s", error->message);
g_error_free (error);
exit (1);

View File

@ -1,10 +1,11 @@
$OpenBSD: patch-gnome-session_main_c,v 1.19 2017/04/17 10:51:02 ajacoutot Exp $
$OpenBSD: patch-gnome-session_main_c,v 1.20 2017/11/02 13:06:53 ajacoutot Exp $
XXX no rpmatch(3) on OpenBSD
--- gnome-session/main.c.orig Wed Apr 12 16:35:48 2017
+++ gnome-session/main.c Mon Apr 17 12:40:35 2017
@@ -311,7 +311,7 @@ main (int argc, char **argv)
Index: gnome-session/main.c
--- gnome-session/main.c.orig
+++ gnome-session/main.c
@@ -309,7 +309,7 @@ main (int argc, char **argv)
debug_string = g_getenv ("GNOME_SESSION_DEBUG");
if (debug_string != NULL) {

View File

@ -1,87 +0,0 @@
$OpenBSD: patch-gnome-session_org_freedesktop_DBus_xml,v 1.1 2017/06/24 07:36:39 ajacoutot Exp $
From 1e3b5a2f4c6cb65dfa94b65a84d1f6c2c9dd61fe Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Tue, 20 Jun 2017 15:32:11 -0400
Subject: manager: add bus daemon dbus api xml file
Index: gnome-session/org.freedesktop.DBus.xml
--- gnome-session/org.freedesktop.DBus.xml.orig
+++ gnome-session/org.freedesktop.DBus.xml
@@ -0,0 +1,76 @@
+<node>
+ <interface name="org.freedesktop.DBus">
+ <method name="Hello">
+ <arg direction="out" type="s" name="assigned_name"/>
+ </method>
+ <method name="RequestName">
+ <arg direction="in" type="s" name="name"/>
+ <arg direction="in" type="u" name="flags"/>
+ <arg direction="out" type="u" name="value"/>
+ </method>
+ <method name="ReleaseName">
+ <arg direction="in" type="s" name="name"/>
+ <arg direction="out" type="u" name="value"/>
+ </method>
+ <method name="StartServiceByName">
+ <arg direction="in" type="s" name="name"/>
+ <arg direction="in" type="u" name="flags"/>
+ <arg direction="out" type="u" name="value"/>
+ </method>
+ <method name="NameHasOwner">
+ <arg direction="in" type="s" name="name"/>
+ <arg direction="out" type="b" name="has_owner"/>
+ </method>
+ <method name="ListNames">
+ <arg direction="out" type="as" name="names"/>
+ </method>
+ <method name="ListActivatableNames">
+ <arg direction="out" type="as" name="activatable_names"/>
+ </method>
+ <method name="AddMatch">
+ <arg direction="in" type="s" name="rule"/>
+ </method>
+ <method name="RemoveMatch">
+ <arg direction="in" type="s" name="rule"/>
+ </method>
+ <method name="GetNameOwner">
+ <arg direction="in" type="s" name="name"/>
+ <arg direction="out" type="s" name="unique_name"/>
+ </method>
+ <method name="ListQueuedOwners">
+ <arg direction="in" type="s" name="name"/>
+ <arg direction="out" type="as" name="queued_owners"/>
+ </method>
+ <method name="GetConnectionUnixUser">
+ <arg direction="in" type="s" name="name"/>
+ <arg direction="out" type="u" name="uid"/>
+ </method>
+ <method name="GetConnectionUnixProcessID">
+ <arg direction="in" type="s" name="name"/>
+ <arg direction="out" type="u" name="pid"/>
+ </method>
+ <method name="GetConnectionSELinuxSecurityContext">
+ <arg direction="in" type="s" name="name"/>
+ <arg direction="out" type="ay" name="security_context"/>
+ </method>
+ <method name="UpdateActivationEnvironment">
+ <arg direction="in" type="a{ss}" name="environment"/>
+ </method>
+ <method name="ReloadConfig">
+ </method>
+ <method name="GetId">
+ <arg direction="out" type="s" name="unique_id"/>
+ </method>
+ <signal name="NameOwnerChanged">
+ <arg type="s" name="name"/>
+ <arg type="s" name="old_owner"/>
+ <arg type="s" name="new_owner"/>
+ </signal>
+ <signal name="NameLost">
+ <arg type="s" name="name"/>
+ </signal>
+ <signal name="NameAcquired">
+ <arg type="s" name="name"/>
+ </signal>
+ </interface>
+</node>