diff options
author | Alexandre Rostovtsev <tetromino@gentoo.org> | 2011-11-26 18:11:31 +0000 |
---|---|---|
committer | Alexandre Rostovtsev <tetromino@gentoo.org> | 2011-11-26 18:11:31 +0000 |
commit | f59ca8cc3cb2d550d013c9449376df2ddbf84169 (patch) | |
tree | b390fd5cdb1a49b5c9021afd9fea0538539a8492 /x11-misc/alacarte | |
parent | Provide GTK+-3.0 version in SLOT="3" (diff) | |
download | gentoo-2-f59ca8cc3cb2d550d013c9449376df2ddbf84169.tar.gz gentoo-2-f59ca8cc3cb2d550d013c9449376df2ddbf84169.tar.bz2 gentoo-2-f59ca8cc3cb2d550d013c9449376df2ddbf84169.zip |
Add version with patches for gnome3 compatibility (bug #391989) from the gnome overlay; it's -r50 to provide some room in case the gnome2 version of alacarte will need to be revbumped in the future.
(Portage version: 2.2.0_alpha77/cvs/Linux x86_64)
Diffstat (limited to 'x11-misc/alacarte')
-rw-r--r-- | x11-misc/alacarte/ChangeLog | 11 | ||||
-rw-r--r-- | x11-misc/alacarte/alacarte-0.13.2-r50.ebuild | 87 | ||||
-rw-r--r-- | x11-misc/alacarte/files/alacarte-0.13.2-selection_browse.patch | 29 | ||||
-rw-r--r-- | x11-misc/alacarte/files/alacarte-0.13.2-settings_menu.patch | 118 |
4 files changed, 244 insertions, 1 deletions
diff --git a/x11-misc/alacarte/ChangeLog b/x11-misc/alacarte/ChangeLog index c7d9044aa7bb..78b04e691100 100644 --- a/x11-misc/alacarte/ChangeLog +++ b/x11-misc/alacarte/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for x11-misc/alacarte # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/x11-misc/alacarte/ChangeLog,v 1.109 2011/10/19 22:50:54 tetromino Exp $ +# $Header: /var/cvsroot/gentoo-x86/x11-misc/alacarte/ChangeLog,v 1.110 2011/11/26 18:11:31 tetromino Exp $ + +*alacarte-0.13.2-r50 (26 Nov 2011) + + 26 Nov 2011; Alexandre Rostovtsev <tetromino@gentoo.org> + +alacarte-0.13.2-r50.ebuild, +files/alacarte-0.13.2-selection_browse.patch, + +files/alacarte-0.13.2-settings_menu.patch: + Add version with patches for gnome3 compatibility (bug #391989) from the + gnome overlay; it's -r50 to provide some room in case the gnome2 version of + alacarte will need to be revbumped in the future. 19 Oct 2011; Alexandre Rostovtsev <tetromino@gentoo.org> alacarte-0.12.4.ebuild, alacarte-0.13.2.ebuild: diff --git a/x11-misc/alacarte/alacarte-0.13.2-r50.ebuild b/x11-misc/alacarte/alacarte-0.13.2-r50.ebuild new file mode 100644 index 000000000000..133a152b6fec --- /dev/null +++ b/x11-misc/alacarte/alacarte-0.13.2-r50.ebuild @@ -0,0 +1,87 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/x11-misc/alacarte/alacarte-0.13.2-r50.ebuild,v 1.1 2011/11/26 18:11:31 tetromino Exp $ + +EAPI="3" +GCONF_DEBUG="no" +PYTHON_DEPEND="2:2.4" +SUPPORT_PYTHON_ABIS="1" +RESTRICT_PYTHON_ABIS="3.*" + +inherit eutils gnome2 python + +DESCRIPTION="Simple GNOME menu editor" +HOMEPAGE="http://live.gnome.org/" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" +IUSE="" + +# gnome-menus-2.91.6 is the earliest version that dropped settings.menu +# slot 0 of gnome-menus is required due to an API break in slot 3 +common_depends=" + >=dev-python/pygobject-2.15.1:2 + >=dev-python/pygtk-2.13:2 + >=gnome-base/gnome-menus-2.91.6:0[python]" + +RDEPEND="${common_depends} + >=gnome-base/gnome-panel-2.16" + +DEPEND="${common_depends} + sys-devel/gettext + >=dev-util/intltool-0.40.0 + >=dev-util/pkgconfig-0.19" + +pkg_setup() { + DOCS="AUTHORS ChangeLog NEWS README" + python_pkg_setup +} + +src_prepare() { + # https://bugzilla.gnome.org/show_bug.cgi?id=647382 and 655113 + epatch "${FILESDIR}/${PN}-0.13.2-settings_menu.patch" + + # https://bugzilla.gnome.org/show_bug.cgi?id=652454 + epatch "${FILESDIR}/${PN}-0.13.2-selection_browse.patch" + + gnome2_src_prepare + + # disable pyc compiling + mv py-compile py-compile.orig + ln -s $(type -P true) py-compile + + python_copy_sources +} + +src_configure() { + configure() { + G2CONF="${G2CONF} PYTHON=$(PYTHON -a)" + gnome2_src_configure + } + python_execute_function -s 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 + python_convert_shebangs -r 2 "${ED}" +} + +pkg_postinst() { + gnome2_pkg_postinst + python_mod_optimize Alacarte +} + +pkg_postrm() { + gnome2_pkg_postrm + python_mod_cleanup Alacarte +} diff --git a/x11-misc/alacarte/files/alacarte-0.13.2-selection_browse.patch b/x11-misc/alacarte/files/alacarte-0.13.2-selection_browse.patch new file mode 100644 index 000000000000..4567d8a93b55 --- /dev/null +++ b/x11-misc/alacarte/files/alacarte-0.13.2-selection_browse.patch @@ -0,0 +1,29 @@ +From c3271e552b5071d5663a57a6f8d185258a47a704 Mon Sep 17 00:00:00 2001 +From: Alexandre Rostovtsev <tetromino@gmail.com> +Date: Sat, 6 Aug 2011 19:16:54 -0400 +Subject: [PATCH] Use gtk.SELECTION_BROWSE mode for menu_tree (bgo 652454) + +Use gtk.SELECTION_BROWSE selection mode for menu_tree to ensure that +one row is always selected and valid iters are returned from the +selection's get_selected(). + +Addresses https://bugzilla.gnome.org/show_bug.cgi?id=652454 +--- + Alacarte/MainWindow.py | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/Alacarte/MainWindow.py b/Alacarte/MainWindow.py +index 260efe5..c2b4780 100644 +--- a/Alacarte/MainWindow.py ++++ b/Alacarte/MainWindow.py +@@ -174,6 +174,7 @@ class MainWindow: + menus.append_column(column) + menus.enable_model_drag_source(gtk.gdk.BUTTON1_MASK, self.dnd_menus, gtk.gdk.ACTION_COPY) + menus.enable_model_drag_dest(self.dnd_both, gtk.gdk.ACTION_PRIVATE) ++ menus.get_selection().set_mode(gtk.SELECTION_BROWSE) + + def setupItemTree(self): + items = self.tree.get_object('item_tree') +-- +1.7.6 + diff --git a/x11-misc/alacarte/files/alacarte-0.13.2-settings_menu.patch b/x11-misc/alacarte/files/alacarte-0.13.2-settings_menu.patch new file mode 100644 index 000000000000..c83b09a8f9bd --- /dev/null +++ b/x11-misc/alacarte/files/alacarte-0.13.2-settings_menu.patch @@ -0,0 +1,118 @@ +Index: alacarte-0.13.2/Alacarte/MainWindow.py +=================================================================== +--- alacarte-0.13.2.orig/Alacarte/MainWindow.py 2011-04-16 19:05:15.086723615 +0200 ++++ alacarte-0.13.2/Alacarte/MainWindow.py 2011-04-16 19:05:19.482745099 +0200 +@@ -72,7 +72,6 @@ class MainWindow: + def run(self): + self.loadMenus() + self.editor.applications.tree.add_monitor(self.menuChanged, None) +- self.editor.settings.tree.add_monitor(self.menuChanged, None) + self.tree.get_object('mainwindow').show_all() + gtk.main() + +Index: alacarte-0.13.2/Alacarte/MenuEditor.py +=================================================================== +--- alacarte-0.13.2.orig/Alacarte/MenuEditor.py 2011-04-16 19:05:39.102841022 +0200 ++++ alacarte-0.13.2/Alacarte/MenuEditor.py 2011-04-16 19:07:26.783367453 +0200 +@@ -48,22 +48,10 @@ class MenuEditor: + self.applications.dom = xml.dom.minidom.parse(self.applications.path) + self.__remove_whilespace_nodes(self.applications.dom) + +- self.settings = Menu() +- self.settings.tree = gmenu.lookup_tree('settings.menu', gmenu.FLAGS_SHOW_EMPTY|gmenu.FLAGS_INCLUDE_EXCLUDED|gmenu.FLAGS_INCLUDE_NODISPLAY|gmenu.FLAGS_SHOW_ALL_SEPARATORS) +- self.settings.visible_tree = gmenu.lookup_tree('settings.menu') +- self.settings.tree.sort_key = gmenu.SORT_DISPLAY_NAME +- self.settings.visible_tree.sort_key = gmenu.SORT_DISPLAY_NAME +- self.settings.path = os.path.join(util.getUserMenuPath(), self.settings.tree.get_menu_file()) +- if not os.path.isfile(self.settings.path): +- self.settings.dom = xml.dom.minidom.parseString(util.getUserMenuXml(self.settings.tree)) +- else: +- self.settings.dom = xml.dom.minidom.parse(self.settings.path) +- self.__remove_whilespace_nodes(self.settings.dom) +- + self.save(True) + + def save(self, from_loading=False): +- for menu in ('applications', 'settings'): ++ for menu in ('applications',): + fd = open(getattr(self, menu).path, 'w') + fd.write(re.sub("\n[\s]*([^\n<]*)\n[\s]*</", "\\1</", getattr(self, menu).dom.toprettyxml().replace('<?xml version="1.0" ?>\n', ''))) + fd.close() +@@ -85,7 +73,7 @@ class MenuEditor: + os.unlink(file_path) + + def revert(self): +- for name in ('applications', 'settings'): ++ for name in ('applications',): + menu = getattr(self, name) + self.revertTree(menu.tree.root) + path = os.path.join(util.getUserMenuPath(), menu.tree.get_menu_file()) +@@ -126,7 +114,7 @@ class MenuEditor: + os.unlink(file_path) + redo.append(redo_path) + #reload DOM to make changes stick +- for name in ('applications', 'settings'): ++ for name in ('applications',): + menu = getattr(self, name) + if not os.path.isfile(menu.path): + menu.dom = xml.dom.minidom.parseString(util.getUserMenuXml(menu.tree)) +@@ -150,7 +138,7 @@ class MenuEditor: + os.unlink(file_path) + undo.append(undo_path) + #reload DOM to make changes stick +- for name in ('applications', 'settings'): ++ for name in ('applications',): + menu = getattr(self, name) + if not os.path.isfile(menu.path): + menu.dom = xml.dom.minidom.parseString(util.getUserMenuXml(menu.tree)) +@@ -162,7 +150,6 @@ class MenuEditor: + def getMenus(self, parent=None): + if parent == None: + yield self.applications.tree.root +- yield self.settings.tree.root + else: + for menu in parent.get_contents(): + if menu.get_type() == gmenu.TYPE_DIRECTORY: +@@ -429,31 +416,13 @@ class MenuEditor: + self.__undo[-1].append(undo_path) + + def __getMenu(self, item): +- root = item.get_parent() +- if not root: +- #already at the top +- root = item +- else: +- while True: +- if root.get_parent(): +- root = root.get_parent() +- else: +- break +- if root.menu_id == self.applications.tree.root.menu_id: +- return self.applications +- return self.settings ++ return self.applications + + def __findMenu(self, menu_id, parent=None): + if parent == None: +- menu = self.__findMenu(menu_id, self.applications.tree.root) +- if menu != None: +- return menu +- else: +- return self.__findMenu(menu_id, self.settings.tree.root) ++ return self.__findMenu(menu_id, self.applications.tree.root) + if menu_id == self.applications.tree.root.menu_id: + return self.applications.tree.root +- if menu_id == self.settings.tree.root.menu_id: +- return self.settings.tree.root + for item in parent.get_contents(): + if item.get_type() == gmenu.TYPE_DIRECTORY: + if item.menu_id == menu_id: +@@ -468,8 +437,6 @@ class MenuEditor: + menu = self.__getMenu(item) + if menu == self.applications: + root = self.applications.visible_tree.root +- elif menu == self.settings: +- root = self.settings.visible_tree.root + if item.get_type() == gmenu.TYPE_DIRECTORY: + if self.__findMenu(item.menu_id, root) == None: + return False |