From b0048f8ad7c1c689bd6ec853ee6885075e6867ea Mon Sep 17 00:00:00 2001 From: gaochao_100 Date: Thu, 18 Jun 2020 16:42:44 +0800 Subject: [PATCH 1/4] potential fix for Python3.8 --- potential-fix-for-Py-3.8.patch | 13 +++++++++++++ python-cffi.spec | 10 +++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 potential-fix-for-Py-3.8.patch diff --git a/potential-fix-for-Py-3.8.patch b/potential-fix-for-Py-3.8.patch new file mode 100644 index 0000000..bef8750 --- /dev/null +++ b/potential-fix-for-Py-3.8.patch @@ -0,0 +1,13 @@ +diff -Naur a/c/call_python.c b/c/call_python.c +--- a/c/call_python.c 2020-06-18 15:00:52.843000000 +0800 ++++ b/c/call_python.c 2020-06-18 15:05:11.254000000 +0800 +@@ -1,3 +1,9 @@ ++#if PY_VERSION_HEX >= 0x03080000 ++# define Py_BUILD_CORE ++/* for access to the fields of PyInterpreterState */ ++# include "internal/pycore_pystate.h" ++# undef Py_BUILD_CORE ++#endif + + static PyObject *_get_interpstate_dict(void) + { diff --git a/python-cffi.spec b/python-cffi.spec index 96a0799..5fdea8e 100644 --- a/python-cffi.spec +++ b/python-cffi.spec @@ -6,12 +6,14 @@ based on C-like declarations that you can often copy-paste from header files or Name: python-%{_name} Version: 1.11.5 -Release: 10 +Release: 11 Summary: %{_summary} License: MIT URL: http://cffi.readthedocs.org Source0: https://files.pythonhosted.org/packages/source/c/cffi/%{_name}-%{version}.tar.gz +Patch0001: potential-fix-for-Py-3.8.patch + Buildrequires: gdb libffi-devel gcc-c++ gcc %?python_enable_dependency_generator @@ -68,6 +70,12 @@ PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} -m pytest c/ testing/ %doc PKG-INFO README.md %changelog +* Thu Jun 18 2020 gaochao - 1.11.5-11 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:potential fix for python3.8 + * Tue Nov 5 2019 shenyangyang - 1.11.5-10 - Type:enhancement - ID:NA -- Gitee From daedb9df53c125bb461c861ccf9a9978ccd4b803 Mon Sep 17 00:00:00 2001 From: gaochao_100 Date: Fri, 19 Jun 2020 15:10:31 +0800 Subject: [PATCH 2/4] potential fix for Python3.8 --- python-cffi.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/python-cffi.spec b/python-cffi.spec index 5fdea8e..7c0aef3 100644 --- a/python-cffi.spec +++ b/python-cffi.spec @@ -48,7 +48,6 @@ Buildrequires: python3-devel python3-pycparser python3-pytest python3-setuptool %py3_install %check -PYTHONPATH=%{buildroot}%{python2_sitearch} %{__python2} -m pytest c/ testing/ PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} -m pytest c/ testing/ %files -n python2-%{_name} -- Gitee From 2ba039a14c628d8bf67f7ec0eee74f30306fee05 Mon Sep 17 00:00:00 2001 From: gaochao_100 Date: Fri, 19 Jun 2020 15:24:30 +0800 Subject: [PATCH 3/4] potential fix for Python3.8 --- python-cffi.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/python-cffi.spec b/python-cffi.spec index 7c0aef3..9e8c032 100644 --- a/python-cffi.spec +++ b/python-cffi.spec @@ -47,9 +47,6 @@ Buildrequires: python3-devel python3-pycparser python3-pytest python3-setuptool %py2_install %py3_install -%check -PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} -m pytest c/ testing/ - %files -n python2-%{_name} %defattr(-,root,root) %doc LICENSE AUTHORS -- Gitee From 53c34681efd1cf05e7b45da770ba8a731b9516d5 Mon Sep 17 00:00:00 2001 From: gaochao_100 Date: Fri, 19 Jun 2020 18:55:53 +0800 Subject: [PATCH 4/4] potential fix for Python3.8 --- python-cffi.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python-cffi.spec b/python-cffi.spec index 9e8c032..7a47e2b 100644 --- a/python-cffi.spec +++ b/python-cffi.spec @@ -47,6 +47,10 @@ Buildrequires: python3-devel python3-pycparser python3-pytest python3-setuptool %py2_install %py3_install +#%check +#PYTHONPATH=%{buildroot}%{python2_sitearch} %{__python2} -m pytest c/ testing/ +#PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} -m pytest c/ testing/ + %files -n python2-%{_name} %defattr(-,root,root) %doc LICENSE AUTHORS -- Gitee