From 73c7ea9b0b5387fbb07e478f6457ca3c3eeb97bf Mon Sep 17 00:00:00 2001 From: Alfred Wingate Date: Thu, 11 Jun 2026 14:35:39 +0300 Subject: [PATCH] media-gfx/mcomix: fix keybindings for python 3.14 Closes: https://bugs.gentoo.org/977206 Signed-off-by: Alfred Wingate Part-of: https://codeberg.org/gentoo/gentoo/pulls/1140 Merges: https://codeberg.org/gentoo/gentoo/pulls/1140 Signed-off-by: Bernard Cafarelli --- .../mcomix-3.1.1-fix-keybindings-py3.14.patch | 52 +++++++++++++++++++ ...ix-3.1.1.ebuild => mcomix-3.1.1-r1.ebuild} | 4 ++ 2 files changed, 56 insertions(+) create mode 100644 media-gfx/mcomix/files/mcomix-3.1.1-fix-keybindings-py3.14.patch rename media-gfx/mcomix/{mcomix-3.1.1.ebuild => mcomix-3.1.1-r1.ebuild} (94%) diff --git a/media-gfx/mcomix/files/mcomix-3.1.1-fix-keybindings-py3.14.patch b/media-gfx/mcomix/files/mcomix-3.1.1-fix-keybindings-py3.14.patch new file mode 100644 index 0000000000000..61e4c12577ae3 --- /dev/null +++ b/media-gfx/mcomix/files/mcomix-3.1.1-fix-keybindings-py3.14.patch @@ -0,0 +1,52 @@ +https://bugs.gentoo.org/977206 +https://sourceforge.net/p/mcomix/bugs/154/ +https://sourceforge.net/p/mcomix/git/merge-requests/56/ +https://sourceforge.net/p/mcomix/git/ci/274e95ecbcf1cdac6e26341bd7241dd86b70b417/ + +--- a/mcomix/keybindings.py ++++ b/mcomix/keybindings.py +@@ -176,7 +176,7 @@ + # Load stored keybindings, or fall back to passed arguments + keycodes = self._action_to_bindings[name] + if keycodes == []: +- keycodes = [Gtk.accelerator_parse(binding) for binding in bindings ] ++ keycodes = [tuple(Gtk.accelerator_parse(binding)) for binding in bindings] + + for keycode in keycodes: + if keycode in list(self._binding_to_action.keys()): +@@ -207,7 +207,7 @@ + """ + assert name in BINDING_INFO, "'%s' isn't a valid keyboard action." % name + +- nb = Gtk.accelerator_parse(new_binding) ++ nb = tuple(Gtk.accelerator_parse(new_binding)) + old_action_with_nb = self._binding_to_action.get(nb) + if old_action_with_nb is not None: + # The new key is already bound to an action, erase the action +@@ -216,7 +216,7 @@ + + if old_binding and name != old_action_with_nb: + # The action already had a key that is now being replaced +- ob = Gtk.accelerator_parse(old_binding) ++ ob = tuple(Gtk.accelerator_parse(old_binding)) + self._binding_to_action[nb] = name + + # Remove action bound to the key. +@@ -238,7 +238,7 @@ + """ Remove binding for an action """ + assert name in BINDING_INFO, "'%s' isn't a valid keyboard action." % name + +- ob = Gtk.accelerator_parse(binding) ++ ob = tuple(Gtk.accelerator_parse(binding)) + self._action_to_bindings[name].remove(ob) + self._binding_to_action.pop(ob) + +@@ -299,7 +299,7 @@ + for action in BINDING_INFO.keys(): + if action in stored_action_bindings: + bindings = [ +- Gtk.accelerator_parse(keyname) ++ tuple(Gtk.accelerator_parse(keyname)) + for keyname in stored_action_bindings[action] ] + self._action_to_bindings[action] = bindings + for binding in bindings: diff --git a/media-gfx/mcomix/mcomix-3.1.1.ebuild b/media-gfx/mcomix/mcomix-3.1.1-r1.ebuild similarity index 94% rename from media-gfx/mcomix/mcomix-3.1.1.ebuild rename to media-gfx/mcomix/mcomix-3.1.1-r1.ebuild index b2f5763663058..22436000135e6 100644 --- a/media-gfx/mcomix/mcomix-3.1.1.ebuild +++ b/media-gfx/mcomix/mcomix-3.1.1-r1.ebuild @@ -26,6 +26,10 @@ BDEPEND="sys-devel/gettext" # Most tests are quite old and do not run RESTRICT="test" +PATCHES=( + "${FILESDIR}"/mcomix-3.1.1-fix-keybindings-py3.14.patch # bug #977206 +) + src_prepare() { default