commit 01e026f3c83779504592509b07768bcb4b4aeedb Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 11:14:22 2019 -0400 Package init diff --git a/71c81741495cdce132b6f45a0f596d70909c1e4d.patch b/71c81741495cdce132b6f45a0f596d70909c1e4d.patch new file mode 100644 index 0000000..c3831f5 --- /dev/null +++ b/71c81741495cdce132b6f45a0f596d70909c1e4d.patch @@ -0,0 +1,26 @@ +From 71c81741495cdce132b6f45a0f596d70909c1e4d Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Sat, 15 Jun 2019 16:07:00 +0200 +Subject: [PATCH] enum: explicitely set enum.__str__ + +Python 3.8 has removed the int.__str__ implementation. So we don't fall +back to object.__str__ and thus enum.__repr__ set __str__ to int.__repr__ +instead. This gives us the same behaviour with all python versions. + +See https://github.com/python/cpython/commit/96aeaec64738b730 +--- + cairo/enums.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/cairo/enums.c b/cairo/enums.c +index 08fbaf3..4273232 100644 +--- a/cairo/enums.c ++++ b/cairo/enums.c +@@ -257,6 +257,7 @@ init_enums (PyObject *module) { + PyObject *ev; + + Pycairo_IntEnum_Type.tp_repr = (reprfunc)int_enum_repr; ++ Pycairo_IntEnum_Type.tp_str = PYCAIRO_PyLong_Type.tp_repr; + Pycairo_IntEnum_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; + Pycairo_IntEnum_Type.tp_methods = int_enum_methods; + Pycairo_IntEnum_Type.tp_base = &PYCAIRO_PyLong_Type; diff --git a/pycairo-1.18.1.tar.gz b/pycairo-1.18.1.tar.gz new file mode 100644 index 0000000..cc8b79f Binary files /dev/null and b/pycairo-1.18.1.tar.gz differ diff --git a/pycairo.spec b/pycairo.spec new file mode 100644 index 0000000..e5d7bf6 --- /dev/null +++ b/pycairo.spec @@ -0,0 +1,90 @@ +Name: pycairo +Version: 1.18.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 +Patch0: 71c81741495cdce132b6f45a0f596d70909c1e4d.patch + +BuildRequires: cairo-devel gcc pkgconfig python2-devel python2-pytest python3-devel python3-pytest + +%description +Pycairo is a Python module providing bindings for the cairo graphics library. + +%package -n python2-cairo +Summary: Provide python2 support for the cairo graphics library +%{?python_provide:%python_provide python2-cairo} +Obsoletes: pycairo +Provides: pycairo = %{version}-%{release} + +%description -n python2-cairo +Provide python2 support for the cairo graphics library. + +%package -n python3-cairo +Summary: Provide python3 support for the cairo graphics library +%{?python_provide:%python_provide python3-cairo} + +%description -n python3-cairo +Provide python3 support for the cairo graphics library. + +%package -n python2-cairo-devel +Summary: Provide libraries and header files for pycairo +Requires: python2-cairo = %{version}-%{release} +Requires: python2-devel +Obsoletes: pycairo-devel +Provides: pycairo-devel = %{version}-%{release} + +%description -n python2-cairo-devel +This package contains files required to build wrappers for cairo add-on +libraries so that they interoperate with pycairo. + +%package -n python3-cairo-devel +Summary: Provide libraries and headers for py3cairo +Requires: python3-cairo% = %{version}-%{release} +Requires: python3-devel + +%description -n python3-cairo-devel +Provide files for the use of building wrappers for cairo add-on libraries +in order to interoperate with py3cairo. + +%prep +%autosetup -n %{name}-%{version} -p1 + +%build +%py2_build +%py3_build + +%install +%py2_install +%py3_install + +%check +%{__python2} setup.py test +%{__python3} setup.py test + +%files -n python2-cairo +%defattr(-,root,root) +%license COPYING* +%{python2_sitearch}/cairo/* +%{python2_sitearch}/pycairo*.egg-info/* + +%files -n python3-cairo +%defattr(-,root,root) +%license COPYING* +%{python3_sitearch}/cairo/* +%{python3_sitearch}/pycairo*.egg-info/* + +%files -n python2-cairo-devel +%defattr(-,root,root) +%{_includedir}/pycairo/pycairo.h +%{_libdir}/pkgconfig/py*.pc + +%files -n python3-cairo-devel +%defattr(-,root,root) +%{_includedir}/pycairo/py3cairo.h +%{_libdir}/pkgconfig/py*.pc + +%changelog +* Tue Sep 10 2019 openEuler Buildteam - 1.18.1-1 +- Package init