summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Ammerlaan <andrewammerlaan@gentoo.org>2023-04-11 20:48:50 +0200
committerAndrew Ammerlaan <andrewammerlaan@gentoo.org>2023-04-11 20:49:46 +0200
commit683adc3c6adb00fcb54fa3fee43e9ae700063503 (patch)
tree91e57a73a8d3b3b32f6a3b3bc13721428ed92095 /games-util
parentdev-util/bpftool: Stabilize 6.2.1 amd64, #904182 (diff)
downloadgentoo-683adc3c6adb00fcb54fa3fee43e9ae700063503.tar.gz
gentoo-683adc3c6adb00fcb54fa3fee43e9ae700063503.tar.bz2
gentoo-683adc3c6adb00fcb54fa3fee43e9ae700063503.zip
games-util/sc-controller: enable python3.11
Closes: https://bugs.gentoo.org/896966 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
Diffstat (limited to 'games-util')
-rw-r--r--games-util/sc-controller/files/sc-controller-0.4.8.9-python3_11.patch24
-rw-r--r--games-util/sc-controller/sc-controller-0.4.8.9-r1.ebuild57
2 files changed, 81 insertions, 0 deletions
diff --git a/games-util/sc-controller/files/sc-controller-0.4.8.9-python3_11.patch b/games-util/sc-controller/files/sc-controller-0.4.8.9-python3_11.patch
new file mode 100644
index 000000000000..283dbba8be98
--- /dev/null
+++ b/games-util/sc-controller/files/sc-controller-0.4.8.9-python3_11.patch
@@ -0,0 +1,24 @@
+diff --git a/scc/lib/__init__.py b/scc/lib/__init__.py
+index 33d1486dd..0fe3141a5 100644
+--- a/scc/lib/__init__.py
++++ b/scc/lib/__init__.py
+@@ -1,3 +1,3 @@
+ #!/usr/bin/env python2
+
+-from enum import Enum, IntEnum, unique
++from .enum import Enum, IntEnum, unique
+diff --git a/tests/test_strings/test_keys.py b/tests/test_strings/test_keys.py
+new file mode 100644
+index 000000000..f118d373c
+--- /dev/null
++++ b/tests/test_strings/test_keys.py
+@@ -0,0 +1,8 @@
++from scc.uinput import Keys
++from scc.lib import IntEnum
++
++class TestKeys(object):
++ def test_up_str(self):
++ assert isinstance(Keys.KEY_UP, IntEnum)
++ assert Keys.KEY_UP.name == "KEY_UP"
++ assert str(Keys.KEY_UP) == "Keys.KEY_UP"
+\ No newline at end of file
diff --git a/games-util/sc-controller/sc-controller-0.4.8.9-r1.ebuild b/games-util/sc-controller/sc-controller-0.4.8.9-r1.ebuild
new file mode 100644
index 000000000000..6c49de8ca581
--- /dev/null
+++ b/games-util/sc-controller/sc-controller-0.4.8.9-r1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_SINGLE_IMPL=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{9..11} )
+inherit distutils-r1 linux-info xdg
+
+DESCRIPTION="User-mode driver and GTK-based GUI for Steam Controllers and others"
+HOMEPAGE="https://github.com/Ryochan7/sc-controller/"
+SRC_URI="https://github.com/Ryochan7/sc-controller/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+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"
+
+RDEPEND="
+ $(python_gen_cond_dep '
+ dev-python/pygobject[${PYTHON_USEDEP},cairo]
+ dev-python/pylibacl[${PYTHON_USEDEP}]
+ dev-python/python-evdev[${PYTHON_USEDEP}]
+ dev-python/vdf[${PYTHON_USEDEP}]')
+ gnome-base/librsvg[introspection]
+ virtual/libusb
+ x11-libs/gtk+:3[introspection]
+ udev? ( games-util/game-device-udev-rules )
+ wayland? ( gui-libs/gtk-layer-shell[introspection(+)] )
+"
+
+distutils_enable_tests pytest
+
+PATCHES=(
+ # https://github.com/Ryochan7/sc-controller/pull/82
+ "${FILESDIR}/${P}-python3_11.patch"
+)
+
+pkg_setup() {
+ local CONFIG_CHECK="~INPUT_UINPUT"
+
+ linux-info_pkg_setup
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ # This test fails. Don't know why but seems unimportant.
+ rm -v tests/test_glade.py || die
+}
+
+src_install() {
+ distutils-r1_src_install
+ rm -r "${ED}"/usr/lib/udev/ || die
+}