summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Rostovtsev <tetromino@gentoo.org>2012-11-24 23:43:39 +0000
committerAlexandre Rostovtsev <tetromino@gentoo.org>2012-11-24 23:43:39 +0000
commit7937b7ffd3722926e93252bce29d870f4bdf4072 (patch)
treea64f1aad9decda9b3557f04fbf6ff25390fc84cd
parentFixing service name in xinetd config file, see bug #442620 (diff)
downloadgentoo-2-7937b7ffd3722926e93252bce29d870f4bdf4072.tar.gz
gentoo-2-7937b7ffd3722926e93252bce29d870f4bdf4072.tar.bz2
gentoo-2-7937b7ffd3722926e93252bce29d870f4bdf4072.zip
Correctly load custom menus from 'applications-merged' directories when XDG_MENU_PREFIX is set.
(Portage version: 2.2.0_alpha142/cvs/Linux x86_64, signed Manifest commit with key CF0ADD61)
-rw-r--r--gnome-base/gnome-menus/ChangeLog14
-rw-r--r--gnome-base/gnome-menus/files/gnome-menus-3.0.1-applications-merged.patch100
-rw-r--r--gnome-base/gnome-menus/files/gnome-menus-3.6.1-applications-merged.patch102
-rw-r--r--gnome-base/gnome-menus/gnome-menus-2.30.5-r1.ebuild102
-rw-r--r--gnome-base/gnome-menus/gnome-menus-3.0.1-r2.ebuild92
-rw-r--r--gnome-base/gnome-menus/gnome-menus-3.4.2-r1.ebuild (renamed from gnome-base/gnome-menus/gnome-menus-3.4.0.ebuild)5
6 files changed, 413 insertions, 2 deletions
diff --git a/gnome-base/gnome-menus/ChangeLog b/gnome-base/gnome-menus/ChangeLog
index b4d7f640093d..3596e5f0fdbe 100644
--- a/gnome-base/gnome-menus/ChangeLog
+++ b/gnome-base/gnome-menus/ChangeLog
@@ -1,6 +1,18 @@
# ChangeLog for gnome-base/gnome-menus
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/gnome-base/gnome-menus/ChangeLog,v 1.179 2012/05/20 09:47:16 tetromino Exp $
+# $Header: /var/cvsroot/gentoo-x86/gnome-base/gnome-menus/ChangeLog,v 1.180 2012/11/24 23:43:39 tetromino Exp $
+
+*gnome-menus-3.4.2-r1 (24 Nov 2012)
+*gnome-menus-3.0.1-r2 (24 Nov 2012)
+*gnome-menus-2.30.5-r1 (24 Nov 2012)
+
+ 24 Nov 2012; Alexandre Rostovtsev <tetromino@gentoo.org>
+ +gnome-menus-2.30.5-r1.ebuild, +gnome-menus-3.0.1-r2.ebuild,
+ +files/gnome-menus-3.0.1-applications-merged.patch,
+ -gnome-menus-3.4.0.ebuild, +gnome-menus-3.4.2-r1.ebuild,
+ +files/gnome-menus-3.6.1-applications-merged.patch:
+ Correctly load custom menus from 'applications-merged' directories when
+ XDG_MENU_PREFIX is set.
*gnome-menus-3.4.2 (20 May 2012)
diff --git a/gnome-base/gnome-menus/files/gnome-menus-3.0.1-applications-merged.patch b/gnome-base/gnome-menus/files/gnome-menus-3.0.1-applications-merged.patch
new file mode 100644
index 000000000000..f5255cc5466e
--- /dev/null
+++ b/gnome-base/gnome-menus/files/gnome-menus-3.0.1-applications-merged.patch
@@ -0,0 +1,100 @@
+From 15baddac6c5343eaa103ecd27c625f5a415d24f3 Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gentoo.org>
+Date: Sat, 24 Nov 2012 15:24:50 -0500
+Subject: [PATCH] libmenu: always call menu_layout_load() with
+ non_prefixed_name parameter
+
+We must ensure that when loading "${XDG_MENU_PREFIX}applications.menu",
+the root layout node's name is set to "applications", not
+"${XDG_MENU_PREFIX}applications", because the menu spec states that the
+default merge directory for "${XDG_MENU_PREFIX}applications.menu" is
+"applications-merged", not "${XDG_MENU_PREFIX}applications-merged".
+
+https://bugzilla.gnome.org/show_bug.cgi?id=688972
+---
+ libmenu/gmenu-tree.c | 29 ++++++++++++++++++++++++++---
+ 1 file changed, 26 insertions(+), 3 deletions(-)
+
+diff --git a/libmenu/gmenu-tree.c b/libmenu/gmenu-tree.c
+index 0cb9645..a0d85d6 100644
+--- a/libmenu/gmenu-tree.c
++++ b/libmenu/gmenu-tree.c
+@@ -47,6 +47,7 @@ struct GMenuTree
+ guint refcount;
+
+ char *basename;
++ char *non_prefixed_basename;
+ char *absolute_path;
+ char *canonical_path;
+
+@@ -630,6 +631,24 @@ gmenu_tree_lookup (const char *menu_file,
+ return retval;
+ }
+
++static void
++gmenu_tree_update_non_prefixed_basename (GMenuTree *tree,
++ const gchar *filename)
++{
++ gchar *s, *basename;
++
++ g_free (tree->non_prefixed_basename);
++ tree->non_prefixed_basename = NULL;
++ if (filename == NULL)
++ return;
++ s = g_strdup_printf ("%sapplications.menu", g_getenv ("XDG_MENU_PREFIX"));
++ basename = g_path_get_basename (filename);
++ if (!g_strcmp0 (basename, "applications.menu") || !g_strcmp0 (basename, s))
++ tree->non_prefixed_basename = g_strdup ("applications.menu");
++ g_free (s);
++ g_free (basename);
++}
++
+ static GMenuTree *
+ gmenu_tree_new (GMenuTreeType type,
+ const char *menu_file,
+@@ -650,11 +669,13 @@ gmenu_tree_new (GMenuTreeType type,
+ {
+ g_assert (canonical == FALSE);
+ tree->basename = g_strdup (menu_file);
++ gmenu_tree_update_non_prefixed_basename (tree, tree->basename);
+ }
+ else
+ {
+ tree->canonical = canonical != FALSE;
+ tree->absolute_path = g_strdup (menu_file);
++ gmenu_tree_update_non_prefixed_basename (tree, tree->absolute_path);
+
+ if (tree->canonical)
+ {
+@@ -709,6 +730,9 @@ gmenu_tree_unref (GMenuTree *tree)
+ g_free (tree->basename);
+ tree->basename = NULL;
+
++ g_free (tree->non_prefixed_basename);
++ tree->non_prefixed_basename = NULL;
++
+ if (tree->absolute_path != NULL)
+ g_free (tree->absolute_path);
+ tree->absolute_path = NULL;
+@@ -1768,7 +1792,7 @@ load_merge_file (GMenuTree *tree,
+
+ menu_verbose ("Merging file \"%s\"\n", canonical);
+
+- to_merge = menu_layout_load (canonical, NULL, NULL);
++ to_merge = menu_layout_load (canonical, tree->non_prefixed_basename, NULL);
+ if (to_merge == NULL)
+ {
+ menu_verbose ("No menu for file \"%s\" found when merging\n",
+@@ -2926,8 +2950,7 @@ gmenu_tree_load_layout (GMenuTree *tree)
+
+ error = NULL;
+ tree->layout = menu_layout_load (tree->canonical_path,
+- tree->type == GMENU_TREE_BASENAME ?
+- tree->basename : NULL,
++ tree->non_prefixed_basename,
+ &error);
+ if (tree->layout == NULL)
+ {
+--
+1.8.0
+
diff --git a/gnome-base/gnome-menus/files/gnome-menus-3.6.1-applications-merged.patch b/gnome-base/gnome-menus/files/gnome-menus-3.6.1-applications-merged.patch
new file mode 100644
index 000000000000..ada08df02491
--- /dev/null
+++ b/gnome-base/gnome-menus/files/gnome-menus-3.6.1-applications-merged.patch
@@ -0,0 +1,102 @@
+From e047041a49ad9e857b97c534203a98aac80de8d8 Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gentoo.org>
+Date: Sat, 24 Nov 2012 15:24:50 -0500
+Subject: [PATCH] libmenu: always call menu_layout_load() with
+ non_prefixed_name parameter
+
+We must ensure that when loading "${XDG_MENU_PREFIX}applications.menu",
+the root layout node's name is set to "applications", not
+"${XDG_MENU_PREFIX}applications", because the menu spec states that the
+default merge directory for "${XDG_MENU_PREFIX}applications.menu" is
+"applications-merged", not "${XDG_MENU_PREFIX}applications-merged".
+
+https://bugzilla.gnome.org/show_bug.cgi?id=688972
+---
+ libmenu/gmenu-tree.c | 31 +++++++++++++++++++++++++++++--
+ 1 file changed, 29 insertions(+), 2 deletions(-)
+
+diff --git a/libmenu/gmenu-tree.c b/libmenu/gmenu-tree.c
+index 3e59c2c..dd6c670 100644
+--- a/libmenu/gmenu-tree.c
++++ b/libmenu/gmenu-tree.c
+@@ -60,6 +60,7 @@ struct _GMenuTree
+ GObject parent_instance;
+
+ char *basename;
++ char *non_prefixed_basename;
+ char *path;
+ char *canonical_path;
+
+@@ -524,6 +525,24 @@ gmenu_tree_constructor (GType type,
+ }
+
+ static void
++gmenu_tree_update_non_prefixed_basename (GMenuTree *tree,
++ const gchar *filename)
++{
++ gchar *s, *basename;
++
++ g_free (tree->non_prefixed_basename);
++ tree->non_prefixed_basename = NULL;
++ if (filename == NULL)
++ return;
++ s = g_strdup_printf ("%sapplications.menu", g_getenv ("XDG_MENU_PREFIX"));
++ basename = g_path_get_basename (filename);
++ if (!g_strcmp0 (basename, "applications.menu") || !g_strcmp0 (basename, s))
++ tree->non_prefixed_basename = g_strdup ("applications.menu");
++ g_free (s);
++ g_free (basename);
++}
++
++static void
+ gmenu_tree_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+@@ -534,10 +553,14 @@ gmenu_tree_set_property (GObject *object,
+ switch (prop_id)
+ {
+ case PROP_MENU_BASENAME:
++ if (g_strcmp0 (self->basename, g_value_get_string (value)))
++ gmenu_tree_update_non_prefixed_basename (self, g_value_get_string (value));
+ self->basename = g_value_dup_string (value);
+ break;
+
+ case PROP_MENU_PATH:
++ if (g_strcmp0 (self->path, g_value_get_string (value)))
++ gmenu_tree_update_non_prefixed_basename (self, g_value_get_string (value));
+ self->path = g_value_dup_string (value);
+ break;
+
+@@ -587,6 +610,9 @@ gmenu_tree_finalize (GObject *object)
+ g_free (tree->basename);
+ tree->basename = NULL;
+
++ g_free (tree->non_prefixed_basename);
++ tree->non_prefixed_basename = NULL;
++
+ if (tree->path != NULL)
+ g_free (tree->path);
+ tree->path = NULL;
+@@ -1896,7 +1922,7 @@ load_merge_file (GMenuTree *tree,
+
+ menu_verbose ("Merging file \"%s\"\n", canonical);
+
+- to_merge = menu_layout_load (canonical, NULL, NULL);
++ to_merge = menu_layout_load (canonical, tree->non_prefixed_basename, NULL);
+ if (to_merge == NULL)
+ {
+ menu_verbose ("No menu for file \"%s\" found when merging\n",
+@@ -3053,8 +3079,9 @@ gmenu_tree_load_layout (GMenuTree *tree,
+ tree->canonical_path);
+
+ error = NULL;
++
+ tree->layout = menu_layout_load (tree->canonical_path,
+- tree->path ? NULL : tree->basename,
++ tree->non_prefixed_basename,
+ error);
+ if (!tree->layout)
+ return FALSE;
+--
+1.8.0
+
diff --git a/gnome-base/gnome-menus/gnome-menus-2.30.5-r1.ebuild b/gnome-base/gnome-menus/gnome-menus-2.30.5-r1.ebuild
new file mode 100644
index 000000000000..7b7ebb4bee78
--- /dev/null
+++ b/gnome-base/gnome-menus/gnome-menus-2.30.5-r1.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/gnome-base/gnome-menus/gnome-menus-2.30.5-r1.ebuild,v 1.1 2012/11/24 23:43:39 tetromino Exp $
+
+EAPI="3"
+GCONF_DEBUG="no"
+
+PYTHON_DEPEND="python? 2:2.5"
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="3.*"
+
+inherit eutils gnome2 python
+
+DESCRIPTION="The GNOME menu system, implementing the F.D.O cross-desktop spec"
+HOMEPAGE="http://www.gnome.org"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~x86-solaris"
+IUSE="debug +introspection python"
+
+RDEPEND=">=dev-libs/glib-2.18
+ python? ( dev-python/pygtk )
+ introspection? ( >=dev-libs/gobject-introspection-0.6.7 )"
+DEPEND="${RDEPEND}
+ sys-devel/gettext
+ virtual/pkgconfig
+ >=dev-util/intltool-0.40"
+
+pkg_setup() {
+ DOCS="AUTHORS ChangeLog HACKING NEWS README"
+
+ # Do NOT compile with --disable-debug/--enable-debug=no
+ # It disables api usage checks
+ if ! use debug ; then
+ G2CONF="${G2CONF} --enable-debug=minimum"
+ fi
+
+ G2CONF="${G2CONF}
+ --disable-static
+ $(use_enable python)
+ $(use_enable introspection)"
+}
+
+src_prepare() {
+ gnome2_src_prepare
+
+ # Don't show KDE standalone settings desktop files in GNOME others menu
+ epatch "${FILESDIR}/${PN}-2.18.3-ignore_kde_standalone.patch"
+ # https://bugzilla.gnome.org/show_bug.cgi?id=688972
+ epatch "${FILESDIR}/${PN}-3.0.1-applications-merged.patch"
+
+ # disable pyc compiling
+ python_clean_py-compile_files
+
+ python_copy_sources
+}
+
+src_configure() {
+ python_execute_function -s gnome2_src_configure
+}
+
+src_compile() {
+ python_execute_function -s gnome2_src_compile
+}
+
+src_test() {
+ python_execute_function -s -d
+}
+
+src_install() {
+ python_execute_function -s gnome2_src_install
+ python_clean_installation_image
+
+ # Prefix menu, bug #256614
+ mv "${ED}"/etc/xdg/menus/applications.menu \
+ "${ED}"/etc/xdg/menus/gnome-applications.menu || die "menu move failed"
+
+ exeinto /etc/X11/xinit/xinitrc.d/
+ doexe "${FILESDIR}/10-xdg-menu-gnome" || die "doexe failed"
+
+ use python && python_convert_shebangs -r 2 "${ED}"usr/bin/gmenu-simple-editor
+}
+
+pkg_postinst() {
+ gnome2_pkg_postinst
+ if use python; then
+ python_mod_optimize GMenuSimpleEditor
+ fi
+
+ ewarn "Due to bug #256614, you might lose icons in applications menus."
+ ewarn "If you use a login manager, please re-select your session."
+ ewarn "If you use startx and have no .xinitrc, just export XSESSION=Gnome."
+ ewarn "If you use startx and have .xinitrc, export XDG_MENU_PREFIX=gnome-."
+}
+
+pkg_postrm() {
+ gnome2_pkg_postrm
+ if use python; then
+ python_mod_cleanup GMenuSimpleEditor
+ fi
+}
diff --git a/gnome-base/gnome-menus/gnome-menus-3.0.1-r2.ebuild b/gnome-base/gnome-menus/gnome-menus-3.0.1-r2.ebuild
new file mode 100644
index 000000000000..949604acf88c
--- /dev/null
+++ b/gnome-base/gnome-menus/gnome-menus-3.0.1-r2.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/gnome-base/gnome-menus/gnome-menus-3.0.1-r2.ebuild,v 1.1 2012/11/24 23:43:39 tetromino Exp $
+
+EAPI="4"
+GCONF_DEBUG="no"
+GNOME2_LA_PUNT="yes"
+GNOME_TARBALL_SUFFIX="bz2"
+
+PYTHON_DEPEND="python? 2:2.5"
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="3.* *-jython 2.7-pypy-*"
+
+inherit autotools eutils gnome2 python
+
+DESCRIPTION="The GNOME menu system, implementing the F.D.O cross-desktop spec"
+HOMEPAGE="http://www.gnome.org"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris"
+
+IUSE="debug python +introspection"
+
+RDEPEND=">=dev-libs/glib-2.18
+ introspection? ( >=dev-libs/gobject-introspection-0.9.5 )"
+DEPEND="${RDEPEND}
+ sys-devel/gettext
+ virtual/pkgconfig
+ >=dev-util/intltool-0.40
+
+ gnome-base/gnome-common
+ dev-libs/gobject-introspection-common"
+# eautoreconf requires gnome-common
+# The actual menus are provided by slot 3
+PDEPEND="gnome-base/gnome-menus:3"
+
+pkg_setup() {
+ DOCS="AUTHORS ChangeLog HACKING NEWS README"
+
+ # Do NOT compile with --disable-debug/--enable-debug=no
+ # It disables api usage checks
+ if ! use debug ; then
+ G2CONF="${G2CONF} --enable-debug=minimum"
+ fi
+
+ G2CONF="${G2CONF}
+ --disable-static
+ $(use_enable python)
+ $(use_enable introspection)"
+
+ python_pkg_setup
+}
+
+src_prepare() {
+ # Only build the library (everything else is coming from slot 3)
+ epatch "${FILESDIR}/${PN}-3.0.2-library-only.patch"
+ # https://bugzilla.gnome.org/show_bug.cgi?id=688972
+ epatch "${FILESDIR}/${PN}-3.0.1-applications-merged.patch"
+ eautoreconf
+ gnome2_src_prepare
+
+ # disable pyc compiling
+ python_clean_py-compile_files
+
+ python_copy_sources
+}
+
+src_configure() {
+ python_execute_function -s gnome2_src_configure
+}
+
+src_compile() {
+ python_execute_function -s gnome2_src_compile
+}
+
+src_test() {
+ python_execute_function -s -d
+}
+
+src_install() {
+ python_execute_function -s gnome2_src_install
+ python_clean_installation_image
+}
+
+pkg_postinst() {
+ gnome2_pkg_postinst
+}
+
+pkg_postrm() {
+ gnome2_pkg_postrm
+}
diff --git a/gnome-base/gnome-menus/gnome-menus-3.4.0.ebuild b/gnome-base/gnome-menus/gnome-menus-3.4.2-r1.ebuild
index 6c8418e902a8..f9f4280c8161 100644
--- a/gnome-base/gnome-menus/gnome-menus-3.4.0.ebuild
+++ b/gnome-base/gnome-menus/gnome-menus-3.4.2-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/gnome-base/gnome-menus/gnome-menus-3.4.0.ebuild,v 1.1 2012/05/13 18:43:24 tetromino Exp $
+# $Header: /var/cvsroot/gentoo-x86/gnome-base/gnome-menus/gnome-menus-3.4.2-r1.ebuild,v 1.1 2012/11/24 23:43:39 tetromino Exp $
EAPI="4"
GCONF_DEBUG="no"
@@ -64,6 +64,9 @@ src_prepare() {
# Don't show KDE standalone settings desktop files in GNOME others menu
epatch "${FILESDIR}/${PN}-3.0.0-ignore_kde_standalone.patch"
+ # https://bugzilla.gnome.org/show_bug.cgi?id=688972
+ epatch "${FILESDIR}/${PN}-3.6.1-applications-merged.patch"
+
if use python; then
python_clean_py-compile_files
python_copy_sources