Add -addzero patch to fix bogus results in sympy.

This commit is contained in:
Jerry James 2018-06-26 17:39:58 -06:00
parent 93da608214
commit 3b8948bc2c
2 changed files with 17 additions and 1 deletions

10
gmpy2-addzero.patch Normal file
View File

@ -0,0 +1,10 @@
--- src/gmpy2_mpz_inplace.c.orig 2018-04-14 12:27:51.000000000 -0600
+++ src/gmpy2_mpz_inplace.c 2018-06-26 17:33:30.402427832 -0600
@@ -50,6 +50,7 @@ GMPy_MPZ_IAdd_Slot(PyObject *self, PyObj
mpz_sub_ui(result->z, MPZ(self), ((PyLongObject*)other)->ob_digit[0]);
return (PyObject*)result;
case 0:
+ return (PyObject*)result;
case 1:
mpz_add_ui(result->z, MPZ(self), ((PyLongObject*)other)->ob_digit[0]);
return (PyObject*)result;

View File

@ -6,7 +6,7 @@
Name: python-%{srcname}
Version: 2.1.0
Release: 0.2.a2%{?dist}
Release: 0.3.a2%{?dist}
Summary: Python interface to GMP, MPFR, and MPC
License: LGPLv3+
@ -14,6 +14,8 @@ URL: https://pypi.python.org/pypi/gmpy2
Source0: https://github.com/aleaxit/gmpy/archive/%{srcname}-%{version}a2.tar.gz
# Fix an import issue; git commit cb0d591
Patch0: %{srcname}-import.patch
# Fix adding by zero in place; https://github.com/aleaxit/gmpy/issues/200
Patch1: %{srcname}-addzero.patch
BuildRequires: gcc
BuildRequires: gmp-devel
@ -70,6 +72,7 @@ Provides: bundled(jquery)
mv gmpy-%{srcname}-%{version}a2 python2
pushd python2
%patch0
%patch1
# Fix file encodings. First the easy one.
iconv -f ISO8859-1 -t UTF-8 src/gmpy2.c > src/gmpy2.c.utf8
@ -147,6 +150,9 @@ popd
%endif
%changelog
* Tue Jun 26 2018 Jerry James <loganjerry@gmail.com> - 2.1.0-0.3.a2
- Add -addzero patch to fix bogus results in sympy
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 2.1.0-0.2.a2
- Rebuilt for Python 3.7