diff --git a/python-cypari2-python310.patch b/python-cypari2-python310.patch new file mode 100644 index 0000000..5e5f9b4 --- /dev/null +++ b/python-cypari2-python310.patch @@ -0,0 +1,28 @@ +--- cypari2/convert.pyx.orig 2020-11-01 11:52:56.000000000 -0700 ++++ cypari2/convert.pyx 2020-11-15 09:35:18.481436232 -0700 +@@ -59,7 +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) + + + ######################################################################## +@@ -450,13 +450,11 @@ 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) ++ # Set correct size + 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/python-cypari2.spec b/python-cypari2.spec index 7ed5e57..ca9c271 100644 --- a/python-cypari2.spec +++ b/python-cypari2.spec @@ -3,7 +3,7 @@ Name: python-%{modname} Version: 2.1.2 -Release: 0.1.%{prerel}%{?dist} +Release: 0.2.%{prerel}%{?dist} Summary: A Python interface to the number theory library pari License: GPLv2+ URL: https://github.com/sagemath/%{modname} @@ -12,6 +12,9 @@ Source0: https://github.com/sagemath/%{modname}/archive/%{version}%{?prerel}/%{m Patch0: %{name}-pari.patch # Fix building with cython language level 3 Patch1: %{name}-cython.patch +# Adapt to python 3.10 +# https://github.com/sagemath/cypari2/pull/103 +Patch2: %{name}-python310.patch BuildRequires: gcc BuildRequires: gmp-devel @@ -99,6 +102,9 @@ export PATH PYTHONPATH %{_docdir}/%{name}/html %changelog +* Mon Nov 16 2020 Jerry James - 2.1.2-0.2.b1 +- Add -python310 patch to adapt to python 3.10 + * Mon Nov 9 2020 Jerry James - 2.1.2-0.1.b1 - Update to 2.1.2b1 for pari 2.13.0 support - Drop upstreamed -literal-block patch