commit:     fe47ea3e821613aafebc5b5b510f8011dc84bb9e
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 16 08:49:52 2025 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Wed Apr 16 10:56:41 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe47ea3e

games-board/pychess: enable py3.13

Needs a minor backport due to (removed in 3.13) telnetlib usage,
but otherwise "seems" fine (no tests).

Closes: https://bugs.gentoo.org/952478
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 games-board/pychess/files/pychess-1.0.5-python3.13.patch | 16 ++++++++++++++++
 games-board/pychess/pychess-1.0.5.ebuild                 | 14 ++++++++++----
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/games-board/pychess/files/pychess-1.0.5-python3.13.patch 
b/games-board/pychess/files/pychess-1.0.5-python3.13.patch
new file mode 100644
index 000000000000..6d690082ec67
--- /dev/null
+++ b/games-board/pychess/files/pychess-1.0.5-python3.13.patch
@@ -0,0 +1,16 @@
+https://bugs.gentoo.org/952478
+https://github.com/pychess/pychess/issues/2233
+https://github.com/pychess/pychess/commit/8d8431c3e8023adbdffea9782b6f2370bb367673
+--- a/lib/pychess/ic/TimeSeal.py
++++ b/lib/pychess/ic/TimeSeal.py
+@@ -2,3 +2,2 @@
+ import sys
+-import telnetlib
+ import random
+@@ -25,3 +24,5 @@
+ FILLER = b"1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+-IAC_WONT_ECHO = b"".join([telnetlib.IAC, telnetlib.WONT, telnetlib.ECHO])
++# was: b"".join([telnetlib.IAC, telnetlib.WONT, telnetlib.ECHO])
++# but telnetlib was removed in Python 3.13
++IAC_WONT_ECHO = b"\xff\xfc\x01"
+ 

diff --git a/games-board/pychess/pychess-1.0.5.ebuild 
b/games-board/pychess/pychess-1.0.5.ebuild
index 1c65ba188c72..3e30063c9a0e 100644
--- a/games-board/pychess/pychess-1.0.5.ebuild
+++ b/games-board/pychess/pychess-1.0.5.ebuild
@@ -1,11 +1,11 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 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..12} )
+PYTHON_COMPAT=( python3_{10..13} )
 PYTHON_REQ_USE="sqlite"
 inherit distutils-r1 xdg
 
@@ -26,14 +26,20 @@ RDEPEND="
                dev-python/pygobject:3[${PYTHON_USEDEP},cairo]
                >=dev-python/sqlalchemy-2[${PYTHON_USEDEP},sqlite]
                dev-python/websockets[${PYTHON_USEDEP}]
-               gstreamer? ( dev-python/gst-python:1.0[${PYTHON_USEDEP}] )')
+               gstreamer? ( dev-python/gst-python:1.0[${PYTHON_USEDEP}] )
+       ')
        gnome-base/librsvg:2[introspection]
        x11-libs/gtk+:3[introspection]
        x11-libs/gtksourceview:3.0[introspection]
        x11-libs/pango[introspection]
-       x11-themes/adwaita-icon-theme"
+       x11-themes/adwaita-icon-theme
+"
 BDEPEND="${RDEPEND}" # setup.py fails if introspection deps not found
 
+PATCHES=(
+       "${FILESDIR}"/${P}-python3.13.patch
+)
+
 src_install() {
        distutils-r1_src_install
 

Reply via email to