commit:     fa85237976edd9714cd6758bcedb124d9c700241
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  5 00:53:32 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Oct  5 00:53:32 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa852379

games-util/nml: enable py3.13

Backport an upstream patch to fix py3.13 compat & enable it.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 games-util/nml/files/nml-0.7.5-regex-py313.patch | 20 ++++++++++++++++++++
 games-util/nml/nml-0.7.5.ebuild                  |  7 +++++--
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/games-util/nml/files/nml-0.7.5-regex-py313.patch 
b/games-util/nml/files/nml-0.7.5-regex-py313.patch
new file mode 100644
index 000000000000..bef0c1002e21
--- /dev/null
+++ b/games-util/nml/files/nml-0.7.5-regex-py313.patch
@@ -0,0 +1,20 @@
+https://github.com/OpenTTD/nml/issues/340
+https://github.com/OpenTTD/nml/pull/341
+
+From 0bebfe612d489a20fa5a71b06963ea3ee80379d0 Mon Sep 17 00:00:00 2001
+From: glx22 <[email protected]>
+Date: Sat, 5 Oct 2024 01:00:32 +0200
+Subject: [PATCH] Fix #340: Always use raw strings for token regex
+
+--- a/nml/tokens.py
++++ b/nml/tokens.py
+@@ -195,7 +195,7 @@ def t_ignore_comment(self, t):
+         self.increment_lines(t.value.count("\n"))
+ 
+     def t_ignore_whitespace(self, t):
+-        "[ \t\r]+"
++        r"[ \t\r]+"
+         pass
+ 
+     def t_line_directive1(self, t):
+

diff --git a/games-util/nml/nml-0.7.5.ebuild b/games-util/nml/nml-0.7.5.ebuild
index 26d49964053c..6754dea0b4c2 100644
--- a/games-util/nml/nml-0.7.5.ebuild
+++ b/games-util/nml/nml-0.7.5.ebuild
@@ -6,8 +6,7 @@ EAPI=8
 DISTUTILS_EXT=1
 DISTUTILS_SINGLE_IMPL=1
 DISTUTILS_USE_PEP517=setuptools
-# py3.13: https://github.com/OpenTTD/nml/issues/340
-PYTHON_COMPAT=( python3_{9..12} )
+PYTHON_COMPAT=( python3_{10..13} )
 inherit distutils-r1
 
 DESCRIPTION="Compiler of NML files into GRF/NFO files"
@@ -25,6 +24,10 @@ RDEPEND="
        ')
 "
 
+PATCHES=(
+       "${FILESDIR}"/${PN}-0.7.5-regex-py313.patch
+)
+
 src_prepare() {
        default
 }

Reply via email to