diff options
author | James Le Cuirot <chewi@gentoo.org> | 2024-08-15 21:30:12 +0100 |
---|---|---|
committer | James Le Cuirot <chewi@gentoo.org> | 2024-08-15 21:31:29 +0100 |
commit | 9bb8d23a10c3021f856920c231ea0b49c16e81c1 (patch) | |
tree | f65f99304df555bf020b839cb539efb10ef572f8 /games-util | |
parent | games-util/sc-controller: add 0.4.8.17 (diff) | |
download | gentoo-9bb8d23a10c3021f856920c231ea0b49c16e81c1.tar.gz gentoo-9bb8d23a10c3021f856920c231ea0b49c16e81c1.tar.bz2 gentoo-9bb8d23a10c3021f856920c231ea0b49c16e81c1.zip |
games-util/sc-controller: Fix tray icon and Python 3.13
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Diffstat (limited to 'games-util')
4 files changed, 180 insertions, 2 deletions
diff --git a/games-util/sc-controller/files/sc-controller-0.4.8.17-log-warning.patch b/games-util/sc-controller/files/sc-controller-0.4.8.17-log-warning.patch new file mode 100644 index 000000000000..124a6df427d5 --- /dev/null +++ b/games-util/sc-controller/files/sc-controller-0.4.8.17-log-warning.patch @@ -0,0 +1,109 @@ +From 5c6b850f4ffe45427492d8b28bbf42b4ee5dd3e0 Mon Sep 17 00:00:00 2001 +From: James Le Cuirot <chewi@gentoo.org> +Date: Thu, 15 Aug 2024 21:25:42 +0100 +Subject: [PATCH] logging.warn was dropped in favour of logging.warning in + Python 3.13 + +We already using logging.warning in many places. +--- + scc/actions.py | 12 ++++++------ + scc/gui/app.py | 2 +- + scc/sccdaemon.py | 4 ++-- + 3 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/scc/actions.py b/scc/actions.py +index ae43db4b..4f4f5848 100644 +--- a/scc/actions.py ++++ b/scc/actions.py +@@ -256,7 +256,7 @@ class Action(object): + Called when action is executed by pressing physical gamepad button. + 'button_release' will be called later. + """ +- log.warn("Action %s can't handle button press event", self.__class__.__name__) ++ log.warning("Action %s can't handle button press event", self.__class__.__name__) + + + def button_release(self, mapper): +@@ -264,7 +264,7 @@ class Action(object): + Called when action executed by pressing physical gamepad button is + expected to stop. + """ +- log.warn("Action %s can't handle button release event", self.__class__.__name__) ++ log.warning("Action %s can't handle button release event", self.__class__.__name__) + + + def axis(self, mapper, position, what): +@@ -276,7 +276,7 @@ class Action(object): + 'what' is one of LEFT, RIGHT or STICK (from scc.constants), + describing what is being updated + """ +- log.warn("Action %s can't handle axis event", self.__class__.__name__) ++ log.warning("Action %s can't handle axis event", self.__class__.__name__) + + + def pad(self, mapper, position, what): +@@ -310,7 +310,7 @@ class Action(object): + 'what' is one of LEFT, RIGHT, STICK (from scc.constants), describing what is + being updated + """ +- log.warn("Action %s can't handle whole stick event", self.__class__.__name__) ++ log.warning("Action %s can't handle whole stick event", self.__class__.__name__) + + + def whole_blocked(self, mapper, x, y, what): +@@ -337,7 +337,7 @@ class Action(object): + + 'what' can be None. + """ +- log.warn("Action %s can't handle incremental changes", self.__class__.__name__) ++ log.warning("Action %s can't handle incremental changes", self.__class__.__name__) + + + def cancel(self, mapper): +@@ -397,7 +397,7 @@ class Action(object): + 'position' contains current trigger position. + 'old_position' contains last known trigger position. + """ +- log.warn("Action %s can't handle trigger event", self.__class__.__name__) ++ log.warning("Action %s can't handle trigger event", self.__class__.__name__) + + + class RangeOP(object): +diff --git a/scc/gui/app.py b/scc/gui/app.py +index fc6110f0..a537f831 100644 +--- a/scc/gui/app.py ++++ b/scc/gui/app.py +@@ -633,7 +633,7 @@ class App(Gtk.Application, UserDataManager, BindingEditor): + + + def on_unknown_profile(self, ps, name): +- log.warn("Daemon reported unknown profile: '%s'; Overriding.", name) ++ log.warning("Daemon reported unknown profile: '%s'; Overriding.", name) + if self.current_file is not None and ps.get_controller() is not None: + ps.get_controller().set_profile(self.current_file.get_path()) + +diff --git a/scc/sccdaemon.py b/scc/sccdaemon.py +index cc140222..4a99b333 100644 +--- a/scc/sccdaemon.py ++++ b/scc/sccdaemon.py +@@ -90,7 +90,7 @@ class SCCDaemon(Daemon): + if hasattr(mod, "init"): + to_init.append(mod) + else: +- log.warn("Skipping disabled driver '%s'", modname) ++ log.warning("Skipping disabled driver '%s'", modname) + + from scc.drivers import MOD_INIT_ORDER as order + index_fn = lambda n: order.index(n) if n in order else 1024 +@@ -500,7 +500,7 @@ class SCCDaemon(Daemon): + d.float() + except OSError as e: + # Most likely 'xinput' executable not found +- log.warn("Failed to deatach gamepad from xinput master: %s", e) ++ log.warning("Failed to deatach gamepad from xinput master: %s", e) + + + def load_default_profile(self, mapper=None): +-- +2.45.2 + diff --git a/games-util/sc-controller/files/sc-controller-0.4.8.17-tray-icon.patch b/games-util/sc-controller/files/sc-controller-0.4.8.17-tray-icon.patch new file mode 100644 index 000000000000..575ec67eb9d2 --- /dev/null +++ b/games-util/sc-controller/files/sc-controller-0.4.8.17-tray-icon.patch @@ -0,0 +1,60 @@ +From 828a4fa17a6cc1df1a149411c3f3ede52ec5a199 Mon Sep 17 00:00:00 2001 +From: angrylinuxuser <angrylinuxuser@gmail.com> +Date: Sun, 23 Jun 2024 18:24:43 +0200 +Subject: [PATCH] Fix tray icon not showing up + +--- + scc/gui/statusicon.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/scc/gui/statusicon.py b/scc/gui/statusicon.py +index f5257270..713c56ba 100644 +--- a/scc/gui/statusicon.py ++++ b/scc/gui/statusicon.py +@@ -350,8 +350,8 @@ def _load_fallback(self): + for StatusIconBackend in status_icon_backends: + try: + self._status_fb = StatusIconBackend(*self._arguments[0], **self._arguments[1]) +- self._status_fb.connect(b"clicked", self._on_click) +- self._status_fb.connect(b"notify::active", self._on_notify_active_fb) ++ self._status_fb.connect("clicked", self._on_click) ++ self._status_fb.connect("notify::active", self._on_notify_active_fb) + self._on_notify_active_fb() + + log.warning("StatusIcon: Using backend %s (fallback)" % StatusIconBackend.__name__) + +From a9ebf39749e885114bfec8a3b0ec6b9e62d213c7 Mon Sep 17 00:00:00 2001 +From: James Le Cuirot <chewi@gentoo.org> +Date: Thu, 15 Aug 2024 21:13:26 +0100 +Subject: [PATCH] Support libayatana-appindicator as libappindicator is now + dead + +It seems to be a drop-in replacement. +--- + scc/gui/statusicon.py | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/scc/gui/statusicon.py b/scc/gui/statusicon.py +index f5257270..317b1aa3 100644 +--- a/scc/gui/statusicon.py ++++ b/scc/gui/statusicon.py +@@ -263,8 +263,14 @@ class StatusIconAppIndicator(StatusIconDBus): + StatusIcon.__init__(self, *args, **kwargs) + + try: +- from gi.repository import AppIndicator3 as appindicator +- ++ import gi ++ try: ++ gi.require_version("AyatanaAppIndicator3", "0.1") ++ from gi.repository import AyatanaAppIndicator3 as appindicator ++ except ImportError: ++ gi.require_version("AppIndicator3", "0.1") ++ from gi.repository import AppIndicator3 as appindicator ++ + self._status_active = appindicator.IndicatorStatus.ACTIVE + self._status_passive = appindicator.IndicatorStatus.PASSIVE + except ImportError: +-- +2.45.2 + diff --git a/games-util/sc-controller/metadata.xml b/games-util/sc-controller/metadata.xml index 20f13f973f8f..92ff06782e0e 100644 --- a/games-util/sc-controller/metadata.xml +++ b/games-util/sc-controller/metadata.xml @@ -8,4 +8,7 @@ <upstream> <remote-id type="github">C0rn3j/sc-controller</remote-id> </upstream> + <use> + <flag name="trayicon">Enable system tray icon</flag> + </use> </pkgmetadata> diff --git a/games-util/sc-controller/sc-controller-0.4.8.17.ebuild b/games-util/sc-controller/sc-controller-0.4.8.17.ebuild index 05c53bdb4a47..e61c2e6455f9 100644 --- a/games-util/sc-controller/sc-controller-0.4.8.17.ebuild +++ b/games-util/sc-controller/sc-controller-0.4.8.17.ebuild @@ -6,7 +6,7 @@ EAPI=8 DISTUTILS_EXT=1 DISTUTILS_SINGLE_IMPL=1 DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..12} ) +PYTHON_COMPAT=( python3_{10..13} ) inherit distutils-r1 linux-info xdg DESCRIPTION="User-mode driver and GTK-based GUI for Steam Controllers and others" @@ -16,7 +16,7 @@ SRC_URI="https://github.com/C0rn3j/sc-controller/archive/v${PV}.tar.gz -> ${P}.t LICENSE="GPL-2 BSD CC-BY-3.0 CC0-1.0 LGPL-2.1 MIT PSF-2 ZLIB" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="+udev wayland" +IUSE="+trayicon +udev wayland" RDEPEND=" $(python_gen_cond_dep ' @@ -28,12 +28,18 @@ RDEPEND=" gnome-base/librsvg[introspection] virtual/libusb x11-libs/gtk+:3[introspection] + trayicon? ( dev-libs/libayatana-appindicator ) udev? ( games-util/game-device-udev-rules ) wayland? ( gui-libs/gtk-layer-shell[introspection(+)] ) " distutils_enable_tests pytest +PATCHES=( + "${FILESDIR}"/${P}-tray-icon.patch + "${FILESDIR}"/${P}-log-warning.patch +) + pkg_setup() { local CONFIG_CHECK="~INPUT_UINPUT" |