diff --git a/srcpkgs/python3-cypari2/patches/python-3.11.patch b/srcpkgs/python3-cypari2/patches/python-3.11.patch new file mode 100644 index 00000000000..02f4f9fb8ca --- /dev/null +++ b/srcpkgs/python3-cypari2/patches/python-3.11.patch @@ -0,0 +1,28 @@ +--- a/cypari2/convert.pyx ++++ b/cypari2/convert.pyx +@@ -59,8 +59,7 @@ cdef extern from *: + ctypedef struct PyLongObject: + digit* ob_digit + +- Py_ssize_t* Py_SIZE_PTR "&Py_SIZE"(object) +- ++ void __Pyx_SET_SIZE(object, Py_ssize_t) + + ######################################################################## + # Conversion PARI -> Python +@@ -450,13 +449,10 @@ cdef PyLong_FromINT(GEN g): + if d: + sizedigits_final = i+1 + +- # Set correct size (use a pointer to hack around Cython's +- # non-support for lvalues). +- cdef Py_ssize_t* sizeptr = Py_SIZE_PTR(x) + if signe(g) > 0: +- sizeptr[0] = sizedigits_final ++ __Pyx_SET_SIZE(x, sizedigits_final); + else: +- sizeptr[0] = -sizedigits_final ++ __Pyx_SET_SIZE(x, -sizedigits_final); + + return x + diff --git a/srcpkgs/python3-cypari2/template b/srcpkgs/python3-cypari2/template index 18755ec020b..9ded61101e8 100644 --- a/srcpkgs/python3-cypari2/template +++ b/srcpkgs/python3-cypari2/template @@ -13,7 +13,9 @@ homepage="https://github.com/sagemath/cypari2" distfiles="${PYPI_SITE}/c/cypari2/cypari2-${version}.tar.gz" checksum=03cd45edab8716ebbfdb754e65fea72e873c73dc91aec098fe4a01e35324ac7a -do_check() { - PYTHONPATH="$(cd build/lib* && pwd)" \ - make check +post_extract() { + local _f + for _f in cypari2/*.pyx; do + rm -f ${_f%.pyx}.c + done }