dev-python/rencode: Support >=dev-python/cython-3.1.0_rc1

Closes: https://bugs.gentoo.org/955434
Signed-off-by: Sebastian Pipping <sping@gentoo.org>
This commit is contained in:
Sebastian Pipping
2025-05-11 22:23:51 +02:00
parent 7ab164157d
commit fd14f31a68
2 changed files with 70 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
From db3ad169c16e00e39ebc72dc2938828f24299d56 Mon Sep 17 00:00:00 2001
From: Sebastian Pipping <sebastian@pipping.org>
Date: Sun, 11 May 2025 22:17:27 +0200
Subject: [PATCH] rencode/rencode.pyx: Fix compilation for Cython 3.1.0
https://github.com/aresch/rencode/issues/31
---
rencode/rencode.pyx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rencode/rencode.pyx b/rencode/rencode.pyx
index 3db1180..494919b 100644
--- a/rencode/rencode.pyx
+++ b/rencode/rencode.pyx
@@ -275,7 +275,7 @@ cdef object MIN_SIGNED_LONGLONG = -MAX_SIGNED_LONGLONG
cdef encode(char **buf, unsigned int *pos, data):
t = type(data)
- if t == int or t == long:
+ if t == int:
if -128 <= data < 128:
encode_char(buf, pos, data)
elif -32768 <= data < 32768:
--
2.49.0

View File

@@ -0,0 +1,44 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_EXT=1
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{10..13} )
inherit distutils-r1
DESCRIPTION="similar to bencode from the BitTorrent project"
HOMEPAGE="
https://github.com/aresch/rencode/
https://pypi.org/project/rencode/
"
SRC_URI="
https://github.com/aresch/${PN}/archive/v${PV}.tar.gz
-> ${P}.gh.tar.gz
"
LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
BDEPEND="
dev-python/cython[${PYTHON_USEDEP}]
"
distutils_enable_tests pytest
PATCHES=(
# https://github.com/aresch/rencode/commit/16e61e1ff4294bddb7c881536d3d454355c78969
"${FILESDIR}/${P}-drop-wheel-dependency.patch"
# bug #812437
"${FILESDIR}/${P}-fix-CVE-2021-40839.patch"
# bug #955434
"${FILESDIR}"/${P}-cython-3.1.0.patch
)
python_test() {
rm -rf rencode || die
epytest
}