summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-python/cython/cython-3.0.0_beta3-r1.ebuild (renamed from dev-python/cython/cython-3.0.0_beta3.ebuild)2
-rw-r--r--dev-python/cython/files/cython-3.0.0_beta3-py312-long.patch28
2 files changed, 30 insertions, 0 deletions
diff --git a/dev-python/cython/cython-3.0.0_beta3.ebuild b/dev-python/cython/cython-3.0.0_beta3-r1.ebuild
index 4637fee3bed8..ca84314058cc 100644
--- a/dev-python/cython/cython-3.0.0_beta3.ebuild
+++ b/dev-python/cython/cython-3.0.0_beta3-r1.ebuild
@@ -43,6 +43,8 @@ PATCHES=(
"${FILESDIR}/${PN}-0.29.22-spawn-multiprocessing.patch"
"${FILESDIR}/${PN}-0.29.23-test_exceptions-py310.patch"
"${FILESDIR}/${PN}-0.29.23-pythran-parallel-install.patch"
+ # backport upstream fix e.g. for dev-python/pysimdjson on py3.12
+ "${FILESDIR}/${P}-py312-long.patch"
)
distutils_enable_sphinx docs \
diff --git a/dev-python/cython/files/cython-3.0.0_beta3-py312-long.patch b/dev-python/cython/files/cython-3.0.0_beta3-py312-long.patch
new file mode 100644
index 000000000000..fb849eca8666
--- /dev/null
+++ b/dev-python/cython/files/cython-3.0.0_beta3-py312-long.patch
@@ -0,0 +1,28 @@
+From d82e4e34582e908d315b912a60d81d5759850df5 Mon Sep 17 00:00:00 2001
+From: Stefan Behnel <stefan_ml@behnel.de>
+Date: Mon, 29 May 2023 21:58:15 +0200
+Subject: [PATCH] Fix the argument type passed into the new
+ "PyUnstable_Long_Compact*()" C-API functions in CPython 3.12.
+
+---
+ Cython/Utility/TypeConversion.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Cython/Utility/TypeConversion.c b/Cython/Utility/TypeConversion.c
+index efc5c1373..09e87d81c 100644
+--- a/Cython/Utility/TypeConversion.c
++++ b/Cython/Utility/TypeConversion.c
+@@ -149,8 +149,8 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
+ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
+
+ #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
+- #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact(x)
+- #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue(x)
++ #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
++ #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
+ #else
+ #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
+ #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
+--
+2.41.0
+