pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/x11/gnome-session Make gnome-session spawn a dbus-daem...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/da7c9e172218
branches:  trunk
changeset: 510642:da7c9e172218
user:      jmmv <jmmv%pkgsrc.org@localhost>
date:      Sat Apr 01 17:36:41 2006 +0000

description:
Make gnome-session spawn a dbus-daemon for the current session so that
things work "out of the box" again: some programs now require dbus to
even start up (e.g. epiphany).  Bump PKGREVISION to 1.

The code comes from GNOME's bug 336237 and I'm adding it to the package
so that it can get some testing.

diffstat:

 x11/gnome-session/Makefile         |    4 +-
 x11/gnome-session/distinfo         |    7 +-
 x11/gnome-session/patches/patch-aa |   35 +++-
 x11/gnome-session/patches/patch-ac |   40 ++++
 x11/gnome-session/patches/patch-ad |   34 +++
 x11/gnome-session/patches/patch-ae |  363 +++++++++++++++++++++++++++++++++++++
 6 files changed, 477 insertions(+), 6 deletions(-)

diffs (truncated from 537 to 300 lines):

diff -r ef8c8a339cb5 -r da7c9e172218 x11/gnome-session/Makefile
--- a/x11/gnome-session/Makefile        Sat Apr 01 17:23:14 2006 +0000
+++ b/x11/gnome-session/Makefile        Sat Apr 01 17:36:41 2006 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.63 2006/03/30 21:19:13 jmmv Exp $
+# $NetBSD: Makefile,v 1.64 2006/04/01 17:36:41 jmmv Exp $
 #
 
 DISTNAME=              gnome-session-2.14.0
+PKGREVISION=           1
 CATEGORIES=            x11 gnome
 MASTER_SITES=          ${MASTER_SITE_GNOME:=sources/gnome-session/2.14/}
 SITES_gnome-splash-2.14.0.png= ${MASTER_SITE_LOCAL:=gnome-splash/}
@@ -41,6 +42,7 @@
 .include "../../devel/libgnomeui/buildlink3.mk"
 .include "../../devel/pango/buildlink3.mk"
 .include "../../security/gnome-keyring/buildlink3.mk"
+.include "../../sysutils/dbus/buildlink3.mk"
 .include "../../sysutils/libnotify/buildlink3.mk"
 .include "../../textproc/intltool/buildlink3.mk"
 .include "../../textproc/scrollkeeper/buildlink3.mk"
diff -r ef8c8a339cb5 -r da7c9e172218 x11/gnome-session/distinfo
--- a/x11/gnome-session/distinfo        Sat Apr 01 17:23:14 2006 +0000
+++ b/x11/gnome-session/distinfo        Sat Apr 01 17:36:41 2006 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.21 2006/03/30 21:19:13 jmmv Exp $
+$NetBSD: distinfo,v 1.22 2006/04/01 17:36:41 jmmv Exp $
 
 SHA1 (gnome-session-2.14.0.tar.bz2) = 15e34ed8d59fcc10942626f366c2c0f7d42e7777
 RMD160 (gnome-session-2.14.0.tar.bz2) = 6082b9bd9ba84be849bcd365635e8f0733d4d6e3
@@ -6,5 +6,8 @@
 SHA1 (gnome-splash-2.14.0.png) = 7f03b85043b12b7f884973ac6ad170d0af7331a3
 RMD160 (gnome-splash-2.14.0.png) = 9421569fa918654492e639990f896d49af3bb44a
 Size (gnome-splash-2.14.0.png) = 38545 bytes
-SHA1 (patch-aa) = 6cdba04e00c439858b428dd275fff1c0c263534f
+SHA1 (patch-aa) = 3a7bac87c0031ea73bf313d3a2dcb983b83d7cbf
 SHA1 (patch-ab) = 7287c9f0a921f2dfe28373027a4f3564d58e5ac8
+SHA1 (patch-ac) = 76104795beb231f8fe69ad8eabe7821b2a6da716
+SHA1 (patch-ad) = 42aa7867f6b660e5eb4b59eb5d74a97a38078fe5
+SHA1 (patch-ae) = 77fac6d0a3cfbfa9929f65e3c0e2d6ae1b48342b
diff -r ef8c8a339cb5 -r da7c9e172218 x11/gnome-session/patches/patch-aa
--- a/x11/gnome-session/patches/patch-aa        Sat Apr 01 17:23:14 2006 +0000
+++ b/x11/gnome-session/patches/patch-aa        Sat Apr 01 17:36:41 2006 +0000
@@ -1,8 +1,20 @@
-$NetBSD: patch-aa,v 1.6 2004/10/26 21:09:47 jmmv Exp $
+$NetBSD: patch-aa,v 1.7 2006/04/01 17:36:41 jmmv Exp $
+
+http://bugzilla.gnome.org/show_bug.cgi?id=336237
+The GONFTOOL_CMD change does not belong to the bug report!
 
---- gnome-session/Makefile.in.orig     2004-10-12 17:57:42.000000000 +0200
+--- gnome-session/Makefile.in.orig     2006-03-13 21:53:02.000000000 +0100
 +++ gnome-session/Makefile.in
-@@ -221,7 +221,7 @@ INCLUDES = \
+@@ -65,7 +65,7 @@ am__objects_1 = egg-screen-exec.$(OBJEXT
+ am_gnome_session_OBJECTS = manager.$(OBJEXT) ice.$(OBJEXT) \
+       main.$(OBJEXT) prop.$(OBJEXT) save.$(OBJEXT) command.$(OBJEXT) \
+       remote.$(OBJEXT) logout.$(OBJEXT) splash-widget.$(OBJEXT) \
+-      gsm-xrandr.$(OBJEXT) gsm-keyring.$(OBJEXT) gsm-gsd.$(OBJEXT) \
++      gsm-xrandr.$(OBJEXT) gsm-dbus.$(OBJEXT) gsm-keyring.$(OBJEXT) gsm-gsd.$(OBJEXT) \
+       gsm-protocol.$(OBJEXT) gsm-remote-desktop.$(OBJEXT) \
+       gsm-sound.$(OBJEXT) gsm-at-startup.$(OBJEXT) \
+       gsm-multiscreen.$(OBJEXT) gsm-typebuiltins.$(OBJEXT) \
+@@ -323,7 +323,7 @@ INCLUDES = \
        -DREBOOT_COMMAND=\""$(REBOOT_COMMAND)\""        \
        -DHALT_COMMAND=\""$(HALT_COMMAND)\""            \
        -DRSH_COMMAND=\""$(RSH_COMMAND)\""              \
@@ -11,3 +23,20 @@
        -DDEFAULTDIR="\"$(defaultdir)\""                \
        -DESD_SERVER="\"$(ESD_SERVER)\""
  
+@@ -386,6 +386,8 @@ gnome_session_SOURCES = \
+       splash-widget.h         \
+       gsm-xrandr.c            \
+       gsm-xrandr.h            \
++      gsm-dbus.c              \
++      gsm-dbus.h              \
+       gsm-keyring.c           \
+       gsm-keyring.h           \
+       gsm-gsd.c               \
+@@ -602,6 +604,7 @@ distclean-compile:
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm-client-list.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm-client-row.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm-gsd.Po@am__quote@
++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm-dbus.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm-keyring.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm-multiscreen.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm-protocol.Po@am__quote@
diff -r ef8c8a339cb5 -r da7c9e172218 x11/gnome-session/patches/patch-ac
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/gnome-session/patches/patch-ac        Sat Apr 01 17:36:41 2006 +0000
@@ -0,0 +1,40 @@
+$NetBSD: patch-ac,v 1.6 2006/04/01 17:36:41 jmmv Exp $
+
+http://bugzilla.gnome.org/show_bug.cgi?id=336237
+
+--- gnome-session/main.c.orig  2006-03-06 14:30:08.000000000 +0100
++++ gnome-session/main.c
+@@ -43,6 +43,7 @@
+ #include "command.h"
+ #include "splash-widget.h"
+ #include "util.h"
++#include "gsm-dbus.h"
+ #include "gsm-sound.h"
+ #include "gsm-gsd.h"
+ #include "gsm-keyring.h"
+@@ -334,6 +335,7 @@ main (int argc, char *argv[])
+   int status;
+   char *display_str;
+   char **versions;
++  gboolean dbus_daemon_owner;
+   
+   if (getenv ("GSM_VERBOSE_DEBUG"))
+     gsm_set_verbose (TRUE);
+@@ -415,6 +417,7 @@ main (int argc, char *argv[])
+   fprintf (stderr, "SESSION_MANAGER=%s\n", getenv ("SESSION_MANAGER"));
+   gnome_window_icon_set_default_from_file (GNOME_ICONDIR"/gnome-session.png");
+ 
++  dbus_daemon_owner = gsm_dbus_daemon_start ();
+ 
+   /* Make sure children see the right value for DISPLAY.  This is
+      useful if --display was specified on the command line.  */
+@@ -497,6 +500,9 @@ main (int argc, char *argv[])
+   gsm_sound_logout ();
+ 
+   gsm_keyring_daemon_stop ();
++
++  if (dbus_daemon_owner)
++    gsm_dbus_daemon_stop ();
+   
+   gsm_shutdown_gconfd ();
+ 
diff -r ef8c8a339cb5 -r da7c9e172218 x11/gnome-session/patches/patch-ad
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/gnome-session/patches/patch-ad        Sat Apr 01 17:36:41 2006 +0000
@@ -0,0 +1,34 @@
+$NetBSD: patch-ad,v 1.3 2006/04/01 17:36:41 jmmv Exp $
+
+http://bugzilla.gnome.org/show_bug.cgi?id=336237
+
+--- /dev/null  2006-04-01 19:01:40.000000000 +0200
++++ gnome-session/gsm-dbus.h   2006-04-01 19:02:57.000000000 +0200
+@@ -0,0 +1,27 @@
++/* gsm-dbus.h - Handle the dbus-daemon process.
++ *
++ * Copyright (c) 2006 Julio M. Merino Vidal <jmmv%NetBSD.org@localhost>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2, or (at your option)
++ * any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++ * 02111-1307, USA.
++ */
++
++#ifndef GSM_DBUS_H
++#define GSM_DBUS_H
++
++gboolean gsm_dbus_daemon_start (void);
++void     gsm_dbus_daemon_stop (void);
++
++#endif /* GSM_DBUS_H */
diff -r ef8c8a339cb5 -r da7c9e172218 x11/gnome-session/patches/patch-ae
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/gnome-session/patches/patch-ae        Sat Apr 01 17:36:41 2006 +0000
@@ -0,0 +1,363 @@
+$NetBSD: patch-ae,v 1.3 2006/04/01 17:36:41 jmmv Exp $
+
+http://bugzilla.gnome.org/show_bug.cgi?id=336237
+
+--- /dev/null  2006-04-01 19:01:40.000000000 +0200
++++ gnome-session/gsm-dbus.c   2006-04-01 19:02:43.000000000 +0200
+@@ -0,0 +1,356 @@
++/* gsm-dbus.c - Handle the dbus-daemon process.
++ *
++ * Copyright (c) 2006 Julio M. Merino Vidal <jmmv%NetBSD.org@localhost>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2, or (at your option)
++ * any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++ * 02111-1307, USA.
++ */
++
++#if HAVE_CONFIG_H
++#include "config.h"
++#endif
++
++#include <sys/wait.h>
++
++#include <errno.h>
++#include <limits.h>
++#include <signal.h>
++#include <stdlib.h>
++#include <unistd.h>
++
++#include <glib.h>
++#include <glib/gprintf.h>
++
++#include "gsm-dbus.h"
++
++static pid_t    dbus_daemon_pid = 0;
++
++static gboolean have_dbus_daemon (void);
++static gboolean have_running_instance (void);
++static int      read_line (int, char *, ssize_t);
++static void     start_child (int, int);
++static void     start_parent (int, int, pid_t);
++
++/* ---------------------------------------------------------------------
++ * PUBLIC INTERFACE
++ * --------------------------------------------------------------------- */
++
++/*
++ * Starts the dbus-daemon if not already running and attaches it to the
++ * current environment by defining DBUS_SESSION_BUS_ADDRESS.  Returns
++ * true if we launch a new dbus-daemon so that we know if we have to call
++ * gsm_dbus_daemon_stop later on or not.
++ *
++ * This function can only be called if dbus-daemon is not already running
++ * (i.e., if gnome-session is starting up or if gsm_dbus_daemon_stop was
++ * previously called).
++ */
++gboolean
++gsm_dbus_daemon_start (void)
++{
++  int address_pipe[2];
++  int pid_pipe[2];
++  pid_t tmp_pid;
++
++  g_assert (dbus_daemon_pid == 0);
++
++  if (have_running_instance ())
++    return TRUE;
++  if (! have_dbus_daemon ())
++    return FALSE;
++
++  /*
++   * At this point, dbus-daemon is not running for the current session
++   * and the binary exists.  Spawn it.
++   */
++
++  if (pipe (address_pipe) == -1)
++    {
++      g_printerr ("Cannot create address pipe for dbus-daemon\n");
++      return FALSE;
++    }
++
++  if (pipe (pid_pipe) == -1)
++    {
++      close (address_pipe[0]);
++      close (address_pipe[1]);
++      g_printerr ("Cannot create pid pipe for dbus-daemon\n");
++      return FALSE;
++    }
++
++  tmp_pid = fork ();
++  if (tmp_pid == -1)
++    {
++      close (address_pipe[0]);
++      close (address_pipe[1]);
++      close (pid_pipe[0]);
++      close (pid_pipe[1]);
++      g_printerr ("Cannot create child process for dbus-daemon\n");
++      return FALSE;
++    }
++  else if (tmp_pid == 0)
++    {
++      close (address_pipe[0]);
++      close (pid_pipe[0]);
++      start_child (address_pipe[1], pid_pipe[1]);
++      /* NOTREACHED */
++    }
++  else
++    {
++      close (address_pipe[1]);
++      close (pid_pipe[1]);
++      start_parent (address_pipe[0], pid_pipe[0], tmp_pid);
++    }
++
++  g_assert (dbus_daemon_pid != 0);
++  return TRUE;
++}



Home | Main Index | Thread Index | Old Index