diff --git a/fix-building-error-with-python2.patch b/fix-building-error-with-python2.patch new file mode 100644 index 0000000..f9aac0d --- /dev/null +++ b/fix-building-error-with-python2.patch @@ -0,0 +1,74 @@ +From 7c376b485111183414ba4cb8a567bee8e56c888d Mon Sep 17 00:00:00 2001 +From: eaglegai +Date: Wed, 29 Jul 2020 10:44:33 +0800 +Subject: [PATCH] fix building error with python2 + +--- + docs/conf.py | 1 + + meson.build | 4 ++-- + setup.py | 8 +++++--- + 3 files changed, 8 insertions(+), 5 deletions(-) + +diff --git a/docs/conf.py b/docs/conf.py +index b3925ee..be0a886 100644 +--- a/docs/conf.py ++++ b/docs/conf.py +@@ -5,6 +5,7 @@ extensions = [ + 'sphinx.ext.extlinks', + ] + intersphinx_mapping = { ++ 'python': ('https://docs.python.org/2', None), + 'python3': ('https://docs.python.org/3', None), + } + source_suffix = '.rst' +diff --git a/meson.build b/meson.build +index c724096..25e2b1a 100644 +--- a/meson.build ++++ b/meson.build +@@ -14,8 +14,8 @@ pymod = import('python') + python = pymod.find_installation(get_option('python')) + + pyver = python.language_version() +-if pyver.version_compare('< 3.5') +- error('Requires Python >= 3.5') ++if pyver.version_compare('< 2.7') or (pyver.version_compare('>= 3.0') and pyver.version_compare('< 3.5')) ++ error('Requires Python 2.7 or Python >= 3.5') + endif + + configure_file( +diff --git a/setup.py b/setup.py +index 2046553..580260f 100755 +--- a/setup.py ++++ b/setup.py +@@ -531,8 +531,8 @@ class build(du_build): + + def main(): + +- if sys.version_info[0] < 3: +- raise Exception("Python 2 no longer supported") ++# if sys.version_info[0] < 3: ++# raise Exception("Python 2 no longer supported") + + cairo_ext = Extension( + name='cairo._cairo', +@@ -600,6 +600,8 @@ def main(): + }, + classifiers=[ + 'Operating System :: OS Independent', ++ 'Programming Language :: Python :: 2', ++ 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', +@@ -612,7 +614,7 @@ def main(): + 'License :: OSI Approved :: Mozilla Public License 1.1 (MPL 1.1)', + ], + cmdclass=cmdclass, +- python_requires='>=3.5, <4', ++ python_requires='>=2.7, <4', + ) + + +-- +1.8.3.1 + diff --git a/pycairo-1.18.2.tar.gz b/pycairo-1.18.2.tar.gz deleted file mode 100644 index 4fddb55..0000000 Binary files a/pycairo-1.18.2.tar.gz and /dev/null differ diff --git a/pycairo-1.19.1.tar.gz b/pycairo-1.19.1.tar.gz new file mode 100644 index 0000000..09025a4 Binary files /dev/null and b/pycairo-1.19.1.tar.gz differ diff --git a/pycairo.spec b/pycairo.spec index 670c5d1..0e60b1f 100644 --- a/pycairo.spec +++ b/pycairo.spec @@ -1,11 +1,14 @@ Name: pycairo -Version: 1.18.2 +Version: 1.19.1 Release: 1 Summary: A python module providing bindings for the cairo graphics library License: MPLv1.1 or LGPLv2 URL: https://cairographics.org/pycairo Source0: https://github.com/pygobject/pycairo/releases/download/v%{version}/pycairo-%{version}.tar.gz +#Just a temporary patch,after whole branch removing python2,remove it +Patch0001: fix-building-error-with-python2.patch + BuildRequires: cairo-devel gcc pkgconfig python2-devel python2-pytest python3-devel python3-pytest %description @@ -85,6 +88,12 @@ in order to interoperate with py3cairo. %{_libdir}/pkgconfig/py*.pc %changelog +* Wed Jul 29 2020 gaihuiying - 1.19.1-1 +- Type:requirement +- ID:NA +- SUG:NA +- DESC:update pycairo version to 1.19.1 + * Wed Jan 8 2020 openEuler Buildteam - 1.18.2-1 - update to 1.18.2