Robin Candau pushed to branch main at Arch Linux / Packaging / Packages / 
pychess


Commits:
7cb8f9fc by Robin Candau at 2024-12-23T18:41:01+01:00
upgpkg: 1.0.5-5: Switch to a more transparent source + Add a temporary patch to 
remove telnetlib
- Switch to GitHub's autogenerated tarball instead of custom made tarball
- Add a temporary patch to remove telnetlib import (as it was removed in python 
3.13). Fixes 
https://gitlab.archlinux.org/archlinux/packaging/packages/pychess/-/issues/2

- - - - -


3 changed files:

- .SRCINFO
- PKGBUILD
- + remove_telnetlib.patch


Changes:

=====================================
.SRCINFO
=====================================
@@ -1,7 +1,7 @@
 pkgbase = pychess
        pkgdesc = Chess client
        pkgver = 1.0.5
-       pkgrel = 4
+       pkgrel = 5
        url = https://pychess.github.io
        arch = any
        license = GPL-3.0-only
@@ -18,7 +18,9 @@ pkgbase = pychess
        depends = python-sqlalchemy
        depends = python-pexpect
        depends = python-websockets
-       source = 
https://github.com/pychess/pychess/releases/download/1.0.5/pychess-1.0.5.tar.gz
-       sha256sums = 
2a5d90747d2d07e9a5a48b42c0e81e79677803f493c8bb8fc48388bd011da9b6
+       source = 
pychess-1.0.5.tar.gz::https://github.com/pychess/pychess/archive/refs/tags/1.0.5.tar.gz
+       source = remove_telnetlib.patch
+       sha256sums = 
3dda31117e5a18b0e0357aaafea6d498f64e717ad8beab82adcde00711be5638
+       sha256sums = 
196c875e40aa997d2f49fe138012734ef7337597137b22557ccdbbf93f60f7b1
 
 pkgname = pychess


=====================================
PKGBUILD
=====================================
@@ -5,17 +5,30 @@
 
 pkgname=pychess
 pkgver=1.0.5
-pkgrel=4
+pkgrel=5
 pkgdesc="Chess client"
-arch=('any')
 url="https://pychess.github.io";
+arch=('any')
 license=('GPL-3.0-only')
 depends=('gst-plugins-base' 'gtksourceview3' 'python-cairo' 'python-gobject'
          'python-ptyprocess' 'python-psutil' 'python-sqlalchemy' 
'python-pexpect'
          'python-websockets')
 makedepends=('python-build' 'python-installer' 'python-setuptools' 
'python-wheel')
-source=("https://github.com/pychess/pychess/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.gz";)
-sha256sums=('2a5d90747d2d07e9a5a48b42c0e81e79677803f493c8bb8fc48388bd011da9b6')
+source=("${pkgname}-${pkgver}.tar.gz::https://github.com/pychess/pychess/archive/refs/tags/${pkgver}.tar.gz";
+        remove_telnetlib.patch)
+sha256sums=('3dda31117e5a18b0e0357aaafea6d498f64e717ad8beab82adcde00711be5638'
+            '196c875e40aa997d2f49fe138012734ef7337597137b22557ccdbbf93f60f7b1')
+
+prepare() {
+       cd "${pkgname}-${pkgver}"
+       PYTHONPATH=lib python3 pgn2ecodb.py
+       PYTHONPATH=lib python3 create_theme_preview.py
+
+       # Temporary patch to remove telnetlib import
+       # as it was removed in Python 3.13
+       # See https://github.com/pychess/pychess/pull/2235
+       patch -Np1 < "${srcdir}/remove_telnetlib.patch"
+}
 
 build() {
        cd "${pkgname}-${pkgver}"


=====================================
remove_telnetlib.patch
=====================================
@@ -0,0 +1,38 @@
+From 8d8431c3e8023adbdffea9782b6f2370bb367673 Mon Sep 17 00:00:00 2001
+From: Adam Williamson <[email protected]>
+Date: Tue, 25 Jun 2024 11:19:53 -0700
+Subject: [PATCH] TimeSeal.py: make IAC_WONT_ECHO a literal as telnetlib is
+ gone (#2233) (#2235)
+
+telnetlib was removed in Python 3.13. As we only used it to
+create a bytestring from these constants, let's just make it a
+literal instead.
+
+Signed-off-by: Adam Williamson <[email protected]>
+---
+ lib/pychess/ic/TimeSeal.py | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/lib/pychess/ic/TimeSeal.py b/lib/pychess/ic/TimeSeal.py
+index 0d09ff1e1..1e99b7218 100644
+--- a/lib/pychess/ic/TimeSeal.py
++++ b/lib/pychess/ic/TimeSeal.py
+@@ -1,6 +1,5 @@
+ import asyncio
+ import sys
+-import telnetlib
+ import random
+ import time
+ import platform
+@@ -23,7 +22,9 @@
+ ENCODELEN = len(ENCODE)
+ G_RESPONSE = "\x029"
+ 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"
+ 
+ _DEFAULT_LIMIT = 2**16
+ 
+



View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/pychess/-/commit/7cb8f9fc3324379797b08780370d7667db908fac

-- 
View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/pychess/-/commit/7cb8f9fc3324379797b08780370d7667db908fac
You're receiving this email because of your account on gitlab.archlinux.org.


Reply via email to