public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Alexandre Restovtsev" <tetromino@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gnome:master commit in: gnome-base/gdm/, gnome-base/gdm/files/
Date: Sat, 13 Aug 2011 06:08:30 +0000 (UTC)	[thread overview]
Message-ID: <09e6158c7f2664db4dc22b42b68b6ce9c2018fae.tetromino@gentoo> (raw)

commit:     09e6158c7f2664db4dc22b42b68b6ce9c2018fae
Author:     Alexandre Rostovtsev <tetromino <AT> gmail <DOT> com>
AuthorDate: Sat Aug 13 05:58:46 2011 +0000
Commit:     Alexandre Restovtsev <tetromino <AT> gmail <DOT> com>
CommitDate: Sat Aug 13 05:58:46 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=09e6158c

gnome-base/gdm: 3.0.4-r1 → 3.0.4-r2, a11y and env variable fixes

Explicitly use --with-at-spi-registryd-directory configure argument
to correctly set the path in at-spi-registryd-wrapper.desktop; see
https://bugzilla.gnome.org/show_bug.cgi?id=607643#c4

Add at-spi to runtime dependencies when USE=accessibility (it's loaded
at runtime).

Patch gdm's gconf defaults if USE=-accessibility to prevent it from
loading accessibility functionality at runtime.

Patch gdm to not ignore all environment variables when launching
gnome-session; see https://bugzilla.gnome.org/show_bug.cgi?id=656094

---
 gnome-base/gdm/files/gdm-3.0.4-disable-a11y.patch  |   21 +++
 ...dm-3.0.4-hardcoded-gnome-session-path-env.patch |  132 ++++++++++++++++++++
 .../{gdm-3.0.4-r1.ebuild => gdm-3.0.4-r2.ebuild}   |   15 ++-
 3 files changed, 166 insertions(+), 2 deletions(-)

diff --git a/gnome-base/gdm/files/gdm-3.0.4-disable-a11y.patch b/gnome-base/gdm/files/gdm-3.0.4-disable-a11y.patch
new file mode 100644
index 0000000..94d83af
--- /dev/null
+++ b/gnome-base/gdm/files/gdm-3.0.4-disable-a11y.patch
@@ -0,0 +1,21 @@
+diff --git a/data/session-setup.entries b/data/session-setup.entries
+index b84e16f..a47d761 100644
+--- a/data/session-setup.entries
++++ b/data/session-setup.entries
+@@ -406,14 +406,14 @@
+     <entry>
+       <key>/desktop/gnome/interface/accessibility</key>
+       <value>
+-        <bool>true</bool>
++        <bool>false</bool>
+       </value>
+     </entry>
+ 
+     <entry>
+       <key>/desktop/gnome/accessibility/keyboard/enable</key>
+       <value>
+-        <bool>true</bool>
++        <bool>false</bool>
+       </value>
+     </entry>
+ 

diff --git a/gnome-base/gdm/files/gdm-3.0.4-hardcoded-gnome-session-path-env.patch b/gnome-base/gdm/files/gdm-3.0.4-hardcoded-gnome-session-path-env.patch
new file mode 100644
index 0000000..50564de
--- /dev/null
+++ b/gnome-base/gdm/files/gdm-3.0.4-hardcoded-gnome-session-path-env.patch
@@ -0,0 +1,132 @@
+From ece7e78e3ef5278382acbf8258950c8607a5d7df Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gmail.com>
+Date: Sun, 7 Aug 2011 02:15:11 -0400
+Subject: [PATCH] Don't hardcode gnome-session path, don't drop harmless env
+ variables
+
+Don't hardcode the location of the gnome-session executable to /usr/bin.
+The system administrator may want have installed a custom wrapper in
+/usr/local that he wants gdm to use instead.
+
+Also, change the logic for how environment variables in spawned session
+processes are set. Instead of inheriting i18n variables from the current
+process and then setting the needed ones, we now:
+1. set needed environment variables;
+2. inherit env variables that had not been set in step 1 from the
+   current process;
+3. drop specific variables that may cause problems.
+
+This allows a system administrator to force gdm to spawn sessions with a
+particular custom environment variable set to e.g. work around hardware
+driver bugs.
+
+Addresses https://bugzilla.gnome.org/show_bug.cgi?id=656094
+---
+ daemon/gdm-greeter-session.c |    2 +-
+ daemon/gdm-welcome-session.c |   43 ++++++++++++++++++++++++++---------------
+ 2 files changed, 28 insertions(+), 17 deletions(-)
+
+diff --git a/daemon/gdm-greeter-session.c b/daemon/gdm-greeter-session.c
+index a401508..7429314 100644
+--- a/daemon/gdm-greeter-session.c
++++ b/daemon/gdm-greeter-session.c
+@@ -148,7 +148,7 @@ gdm_greeter_session_new (const char *display_name,
+         GObject *object;
+ 
+         object = g_object_new (GDM_TYPE_GREETER_SESSION,
+-                               "command", BINDIR "/gnome-session --session gdm --autostart="DATADIR"/gdm/autostart/LoginWindow/",
++                               "command", "gnome-session --session gdm --autostart="DATADIR"/gdm/autostart/LoginWindow/",
+                                "server-dbus-path", GDM_GREETER_SERVER_DBUS_PATH,
+                                "server-dbus-interface", GDM_GREETER_SERVER_DBUS_INTERFACE,
+                                "server-env-var-name", "GDM_GREETER_DBUS_ADDRESS",
+diff --git a/daemon/gdm-welcome-session.c b/daemon/gdm-welcome-session.c
+index b8ec8d7..d0e6030 100644
+--- a/daemon/gdm-welcome-session.c
++++ b/daemon/gdm-welcome-session.c
+@@ -350,32 +350,28 @@ get_welcome_environment (GdmWelcomeSession *welcome_session,
+         GPtrArray     *env;
+         GHashTable    *hash;
+         struct passwd *pwent;
+-        static const char * const optional_environment[] = {
++        static const char * const lang_environment[] = {
+                 "LANG", "LANGUAGE", "LC_CTYPE", "LC_NUMERIC", "LC_TIME",
+                 "LC_COLLATE", "LC_MONETARY", "LC_MESSAGES", "LC_PAPER",
+                 "LC_NAME", "LC_ADDRESS", "LC_TELEPHONE", "LC_MEASUREMENT",
+                 "LC_IDENTIFICATION", "LC_ALL",
+                 NULL
+         };
++        static const char * const drop_environment[] = {
++                "MAIL", NULL
++        };
++        char **curr_environment;
+         int i;
+ 
+         load_lang_config_file (LANG_CONFIG_FILE,
+-                               (const char **) optional_environment);
++                               (const char **) lang_environment);
++        curr_environment = g_listenv ();
+         env = g_ptr_array_new ();
+ 
+-        /* create a hash table of current environment, then update keys has necessary */
++        /* Create a hash table for environment variables.
++         * First, insert keys we need to set. */
+         hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
+ 
+-        for (i = 0; optional_environment[i] != NULL; i++) {
+-                if (g_getenv (optional_environment[i]) == NULL) {
+-                        continue;
+-                }
+-
+-                g_hash_table_insert (hash,
+-                                     g_strdup (optional_environment[i]),
+-                                     g_strdup (g_getenv (optional_environment[i])));
+-        }
+-
+         if (welcome_session->priv->dbus_bus_address != NULL) {
+                 g_hash_table_insert (hash,
+                                      g_strdup ("DBUS_SESSION_BUS_ADDRESS"),
+@@ -409,7 +405,6 @@ get_welcome_environment (GdmWelcomeSession *welcome_session,
+         g_hash_table_insert (hash, g_strdup ("USERNAME"), g_strdup (welcome_session->priv->user_name));
+ 
+         g_hash_table_insert (hash, g_strdup ("GDM_VERSION"), g_strdup (VERSION));
+-        g_hash_table_remove (hash, "MAIL");
+ 
+         g_hash_table_insert (hash, g_strdup ("HOME"), g_strdup ("/"));
+         g_hash_table_insert (hash, g_strdup ("PWD"), g_strdup ("/"));
+@@ -435,15 +430,31 @@ get_welcome_environment (GdmWelcomeSession *welcome_session,
+                 g_hash_table_insert (hash, g_strdup ("GDM_SEAT_ID"), g_strdup (seat_id));
+         }
+ 
+-        g_hash_table_insert (hash, g_strdup ("PATH"), g_strdup (g_getenv ("PATH")));
+-        g_hash_table_insert (hash, g_strdup ("WINDOWPATH"), g_strdup (g_getenv ("WINDOWPATH")));
+         g_hash_table_insert (hash, g_strdup ("RUNNING_UNDER_GDM"), g_strdup ("true"));
+         g_hash_table_insert (hash, g_strdup ("GVFS_DISABLE_FUSE"), g_strdup ("1"));
+         g_hash_table_insert (hash, g_strdup ("DCONF_PROFILE"), g_strdup ("gdm"));
+ 
++        /* Second, insert environment variables from current process that haven't been set in the hash yet. */
++        for (i = 0; curr_environment[i] != NULL; i++) {
++                if (g_hash_table_lookup (hash, curr_environment[i]) != NULL ||
++                    g_getenv (curr_environment[i]) == NULL) {
++                        continue;
++                }
++
++                g_hash_table_insert (hash,
++                                     g_strdup (curr_environment[i]),
++                                     g_strdup (g_getenv (curr_environment[i])));
++        }
++
++        /* Third, remove undesirable environment variables. */
++        for (i = 0; drop_environment[i] != NULL; i++)
++                g_hash_table_remove (hash, drop_environment[i]);
++
+         g_hash_table_foreach (hash, (GHFunc)listify_hash, env);
+         g_hash_table_destroy (hash);
+ 
++        g_strfreev (curr_environment);
++
+         g_ptr_array_add (env, NULL);
+ 
+         return env;
+-- 
+1.7.6
+

diff --git a/gnome-base/gdm/gdm-3.0.4-r1.ebuild b/gnome-base/gdm/gdm-3.0.4-r2.ebuild
similarity index 90%
rename from gnome-base/gdm/gdm-3.0.4-r1.ebuild
rename to gnome-base/gdm/gdm-3.0.4-r2.ebuild
index 736fd65..3a8b8a7 100644
--- a/gnome-base/gdm/gdm-3.0.4-r1.ebuild
+++ b/gnome-base/gdm/gdm-3.0.4-r2.ebuild
@@ -69,11 +69,13 @@ DEPEND="${COMMON_DEPEND}
 	>=app-text/scrollkeeper-0.1.4
 	>=app-text/gnome-doc-utils-0.3.2"
 # XXX: These deps are from the gnome-session gdm.session file
+# at-spi is needed for at-spi-registryd-wrapper.desktop
 RDEPEND="${COMMON_DEPEND}
 	>=gnome-base/gnome-session-2.91.92
 	>=gnome-base/gnome-settings-daemon-2.91
 	x11-wm/metacity
 
+	accessibility? ( gnome-extra/at-spi:1 )
 	consolekit? ( gnome-extra/polkit-gnome )
 
 	!gnome-extra/fast-user-switch-applet"
@@ -84,12 +86,15 @@ pkg_setup() {
 	# PAM is the only auth scheme supported
 	# even though configure lists shadow and crypt
 	# they don't have any corresponding code
+	# --with-at-spi-registryd-directory= needs to be passed explicitly because
+	# of https://bugzilla.gnome.org/show_bug.cgi?id=607643#c4
 	G2CONF="${G2CONF}
 		--disable-schemas-install
-		--localstatedir=/var
+		--localstatedir=${EROOT}var
 		--with-xdmcp=yes
 		--enable-authentication-scheme=pam
-		--with-pam-prefix=/etc
+		--with-pam-prefix=${EROOT}etc
+		--with-at-spi-registryd-directory=${EROOT}usr/libexec
 		$(use_with accessibility xevie)
 		$(use_enable ipv6)
 		$(use_enable xklavier libxklavier)
@@ -123,6 +128,12 @@ src_prepare() {
 	# fix libxklavier automagic support
 	epatch "${FILESDIR}/${PN}-2.32.0-automagic-libxklavier-support.patch"
 
+	# don't ignore all non-i18n environment variables, gnome bug 656094
+	epatch "${FILESDIR}/${PN}-3.0.4-hardcoded-gnome-session-path-env.patch"
+
+	# don't load accessibility support at runtime when USE=-accessibility
+	use accessibility || epatch "${FILESDIR}/${PN}-3.0.4-disable-a11y.patch"
+
 	mkdir -p "${S}"/m4
 	intltoolize --force --copy --automake || die "intltoolize failed"
 	eautoreconf



             reply	other threads:[~2011-08-13  6:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-13  6:08 Alexandre Restovtsev [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-12-11 23:44 [gentoo-commits] proj/gnome:master commit in: gnome-base/gdm/, gnome-base/gdm/files/ Gilles Dartiguelongue
2012-12-26 21:45 Gilles Dartiguelongue
2012-09-12 12:08 Nirbheek Chauhan
2012-09-12 12:06 Nirbheek Chauhan
2012-09-09  0:39 Nirbheek Chauhan
2012-08-18 14:07 Priit Laes
2011-10-23  8:41 Alexandre Restovtsev
2011-06-26  6:22 Nirbheek Chauhan
2011-05-03 10:52 Nirbheek Chauhan
2011-04-15 19:36 Nirbheek Chauhan
2011-04-05  0:57 Nirbheek Chauhan
2011-04-02 13:54 Nirbheek Chauhan
2011-02-26 11:41 Nirbheek Chauhan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=09e6158c7f2664db4dc22b42b68b6ce9c2018fae.tetromino@gentoo \
    --to=tetromino@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox