Skip to content

Commit

Permalink
games-util/sc-controller: Bump to 0.4.8.15, drop old 0.4.8.11
Browse files Browse the repository at this point in the history
There is a new upstream (again).

Closes: https://bugs.gentoo.org/929599
Signed-off-by: James Le Cuirot <[email protected]>
  • Loading branch information
chewi committed Jun 22, 2024
1 parent efa1712 commit 304c9eb
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 5 deletions.
2 changes: 1 addition & 1 deletion games-util/sc-controller/Manifest
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DIST sc-controller-0.4.8.11.tar.gz 2566642 BLAKE2B 64e910e27ceb93938d6250ae058a5df102922f36f4e1e7aa5d2f761b93bbcf34296eefabb10145b4e1b7030c05af341ccb6cbe01df7ce891c69f8d8fceefdb30 SHA512 e591e1c44763c38a18f09f8d5d9fcdb7f46c60d8f4dc040d82e48617d0f960abb6ec608188724838060dbe532589453b0be2c1d94686decef657205f8e8efcec
DIST sc-controller-0.4.8.15.tar.gz 2570427 BLAKE2B 23fe2de5557457162fccd3c88c5bc15149229ccfee2d6b473d93ddd0e747d8700a2454d32db753293bc70a95aab43d1959e93bc34f1a153b152aa9fbc1d73676 SHA512 a9b38270aaf761e0a62b690d64c64e07539292ffe7d724a31b7989afdacbf64dc1074805d34f07dfe0767cf5bdfc14e5000050782f310ea7f439f5f2af9faf07
89 changes: 89 additions & 0 deletions games-util/sc-controller/files/sc-controller-0.4.8.15-py12.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
From 51dda4b98aac878bdbf84aa9715f7ecc9802ba1d Mon Sep 17 00:00:00 2001
From: James Le Cuirot <[email protected]>
Date: Sat, 22 Jun 2024 14:24:01 +0100
Subject: [PATCH 1/2] Fix parser to handle new non-terminating newline NL token
in Python 3.12

---
scc/parser.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/scc/parser.py b/scc/parser.py
index 78633f0e..9e77de04 100644
--- a/scc/parser.py
+++ b/scc/parser.py
@@ -136,7 +136,7 @@ class ActionParser(object):
def _parse_parameter(self):
""" Parses single parameter """
t = self._next_token()
- while t.type == TokenType.NEWLINE or t.value == "\n":
+ while t.type in (TokenType.NL, TokenType.NEWLINE) or t.value == "\n":
if not self._tokens_left():
raise ParseError("Expected parameter at end of string")
t = self._next_token()
@@ -236,7 +236,7 @@ class ActionParser(object):
parameters.append(self._parse_parameter())
# Check if next token is either ')' or ','
t = self._peek_token()
- while t.type == TokenType.NEWLINE or t.value == "\n":
+ while t.type in (TokenType.NL, TokenType.NEWLINE) or t.value == "\n":
self._next_token()
if not self._tokens_left():
raise ParseError("Expected ',' or end of parameter list after parameter '%s'" % (parameters[-1],))
@@ -310,8 +310,8 @@ class ActionParser(object):
action1 = self._create_action(action_class, *parameters)
action2 = self._parse_action()
return MultiAction(action1, action2)
-
- if t.type == TokenType.NEWLINE or t.value == "\n":
+
+ if t.type in (TokenType.NL, TokenType.NEWLINE) or t.value == "\n":
# Newline can be used to join actions instead of 'and'
self._next_token()
if not self._tokens_left():
@@ -324,11 +324,11 @@ class ActionParser(object):
action1 = self._create_action(action_class, *parameters)
action2 = self._parse_action()
return MultiAction(action1, action2)
-
+
if t.type == TokenType.OP and t.value == ';':
# Two (or more) actions joined by ';'
self._next_token()
- while self._tokens_left() and self._peek_token().type == TokenType.NEWLINE:
+ while self._tokens_left() and self._peek_token().type in (TokenType.NL, TokenType.NEWLINE):
self._next_token()
if not self._tokens_left():
# Having ';' at end of string is not actually error
--
2.45.1


From e8cc68cb17effa413c3ffde2bce5f8dd1798b0c3 Mon Sep 17 00:00:00 2001
From: James Le Cuirot <[email protected]>
Date: Sat, 22 Jun 2024 14:34:48 +0100
Subject: [PATCH 2/2] Address Python ast deprecations that will be removed in
3.14

---
scc/cheader.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scc/cheader.py b/scc/cheader.py
index d151d637..f84319f1 100644
--- a/scc/cheader.py
+++ b/scc/cheader.py
@@ -59,8 +59,8 @@ def eval_expr(expr):
""" Eval and expression inside a #define using a suppart of python grammar """

def _eval(node):
- if isinstance(node, ast.Num):
- return node.n
+ if isinstance(node, ast.Constant):
+ return node.value
elif isinstance(node, ast.BinOp):
return OPERATORS[type(node.op)](_eval(node.left), _eval(node.right))
elif isinstance(node, ast.UnaryOp):
--
2.45.1

2 changes: 1 addition & 1 deletion games-util/sc-controller/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
<name>Gentoo Games Project</name>
</maintainer>
<upstream>
<remote-id type="github">Ryochan7/sc-controller</remote-id>
<remote-id type="github">C0rn3j/sc-controller</remote-id>
</upstream>
</pkgmetadata>
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ EAPI=8
DISTUTILS_EXT=1
DISTUTILS_SINGLE_IMPL=1
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{10..11} )
PYTHON_COMPAT=( python3_{10..12} )
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"
HOMEPAGE="https://github.com/C0rn3j/sc-controller/"
SRC_URI="https://github.com/C0rn3j/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"
Expand All @@ -32,6 +32,10 @@ RDEPEND="
wayland? ( gui-libs/gtk-layer-shell[introspection(+)] )
"

PATCHES=(
"${FILESDIR}"/${P}-py12.patch
)

distutils_enable_tests pytest

pkg_setup() {
Expand Down

0 comments on commit 304c9eb

Please sign in to comment.