commit:     25dc6f4a5273b6f2675caf81877376d39bc812b4
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 18 12:30:36 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Apr 18 12:38:06 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25dc6f4a

dev-python/cython: Backport upstream PyPy3 fix

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 ...0_beta1.ebuild => cython-3.1.0_beta1-r1.ebuild} |  2 ++
 .../cython/files/cython-3.1.0_beta1-pypy3.patch    | 36 ++++++++++++++++++++++
 2 files changed, 38 insertions(+)

diff --git a/dev-python/cython/cython-3.1.0_beta1.ebuild 
b/dev-python/cython/cython-3.1.0_beta1-r1.ebuild
similarity index 95%
rename from dev-python/cython/cython-3.1.0_beta1.ebuild
rename to dev-python/cython/cython-3.1.0_beta1-r1.ebuild
index f8d0544c7b27..c097ca9b2e3c 100644
--- a/dev-python/cython/cython-3.1.0_beta1.ebuild
+++ b/dev-python/cython/cython-3.1.0_beta1-r1.ebuild
@@ -35,6 +35,8 @@ BDEPEND="
 PATCHES=(
        "${FILESDIR}/${PN}-0.29.22-spawn-multiprocessing.patch"
        "${FILESDIR}/${PN}-0.29.23-pythran-parallel-install.patch"
+       # https://github.com/cython/cython/pull/6782
+       "${FILESDIR}/${P}-pypy3.patch"
 )
 
 distutils_enable_sphinx docs \

diff --git a/dev-python/cython/files/cython-3.1.0_beta1-pypy3.patch 
b/dev-python/cython/files/cython-3.1.0_beta1-pypy3.patch
new file mode 100644
index 000000000000..9884e1b84a64
--- /dev/null
+++ b/dev-python/cython/files/cython-3.1.0_beta1-pypy3.patch
@@ -0,0 +1,36 @@
+From c1e709dd260b7621f36737b585dac1fd45a7704c Mon Sep 17 00:00:00 2001
+From: da-woods <[email protected]>
+Date: Sun, 6 Apr 2025 08:43:34 +0100
+Subject: [PATCH] Fix __Pyx_Owned_Py_None usage as actual function (GH-6782)
+
+In the tracing code, we are using it like a function (i.e. casting to void to 
mark it unused) so it has to be a function, not just a macro.
+
+Fixes https://github.com/cython/cython/issues/6781
+---
+ Cython/Utility/TypeConversion.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/Cython/Utility/TypeConversion.c b/Cython/Utility/TypeConversion.c
+index b86125699c7..e085fae8eb3 100644
+--- a/Cython/Utility/TypeConversion.c
++++ b/Cython/Utility/TypeConversion.c
+@@ -103,7 +103,7 @@ static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject 
*obj) {
+ #endif
+ }
+ 
+-#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
++static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
+ static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
+ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+ static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
+@@ -420,6 +420,10 @@ static CYTHON_INLINE Py_hash_t 
__Pyx_PyIndex_AsHash_t(PyObject* o) {
+   }
+ }
+ 
++static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
++    CYTHON_UNUSED_VAR(b);
++    return __Pyx_NewRef(Py_None);
++}
+ 
+ static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
+   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);

Reply via email to