From 7c82c1dbc54fca9ee6549c005d7135ea333c5c77 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 30 May 2022 08:06:30 +0200 Subject: [PATCH] Initial package Resolves: bz#2090327 --- .gitignore | 1 + README.md | 3 +++ python-pyqt5-sip.spec | 53 +++++++++++++++++++++++++++++++++++++++++++ python3.11.patch | 18 +++++++++++++++ sources | 1 + 5 files changed, 76 insertions(+) create mode 100644 README.md create mode 100644 python-pyqt5-sip.spec create mode 100644 python3.11.patch create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..2ae621a 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/PyQt5_sip-12.9.1.tar.gz diff --git a/README.md b/README.md new file mode 100644 index 0000000..fbbbcb0 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# python-pyqt5-sip + +The python-pyqt5-sip package diff --git a/python-pyqt5-sip.spec b/python-pyqt5-sip.spec new file mode 100644 index 0000000..8c2bd53 --- /dev/null +++ b/python-pyqt5-sip.spec @@ -0,0 +1,53 @@ +%global pkg_name pyqt5-sip +%global pypi_name PyQt5_sip +%global _sip_api_major 12 +%global _sip_api_minor 9 +%global _sip_api %{_sip_api_major}.%{_sip_api_minor} + +Name: python-%{pkg_name} +Version: 12.9.1 +Release: 1%{?dist} +Summary: The sip module support for PyQt5 + +License: GPLv2 or GPLv3 +URL: https://www.riverbankcomputing.com/software/sip/ +Source0: %{pypi_source} +Patch0: python3.11.patch + +BuildRequires: gcc +BuildRequires: python3-devel +BuildRequires: %{py3_dist setuptools} >= 30.3 +BuildRequires: %{py3_dist wheel} + +%global _description %{expand: +The sip extension module provides support for the PyQt5 package. +} + +%description %_description + +%package -n python3-%{pkg_name} +Summary: %{summary} +%{?python_provide:%python_provide python3-%{pkg_name}} +Provides: python3-pyqt5-sip-api(%{_sip_api_major}) = %{_sip_api} +Provides: python3-pyqt5-sip-api(%{_sip_api_major})%{?_isa} = %{_sip_api} + +%description -n python3-%{pkg_name} %_description + +%prep +%autosetup -n %{pypi_name}-%{version} + +%build +%py3_build + +%install +%py3_install + +%files -n python3-%{pkg_name} +%doc README +%{python3_sitearch}/PyQt5_sip* +%{python3_sitearch}/PyQt5/ + +%changelog +* Thu May 26 2022 Jan Grulich - 12.9.1-1 +- Initial package + Resolves: bz#2090327 diff --git a/python3.11.patch b/python3.11.patch new file mode 100644 index 0000000..914159b --- /dev/null +++ b/python3.11.patch @@ -0,0 +1,18 @@ +diff -up PyQt5_sip-12.9.1/siplib.c.py311 PyQt5_sip-12.9.1/siplib.c +--- PyQt5_sip-12.9.1/siplib.c.py311 2022-02-01 08:29:23.000000000 -0500 ++++ PyQt5_sip-12.9.1/siplib.c 2022-03-11 20:46:19.056212494 -0500 +@@ -12750,7 +12750,14 @@ static struct _frame *sip_api_get_frame( + + while (frame != NULL && depth > 0) + { ++#if PY_VERSION_HEX < 0x03090000 + frame = frame->f_back; ++#else ++ frame = PyFrame_GetBack(frame); ++ ++ /* Historically we return a borrowed reference. */ ++ Py_XDECREF(frame); ++#endif + --depth; + } + diff --git a/sources b/sources new file mode 100644 index 0000000..b7bcbb0 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (PyQt5_sip-12.9.1.tar.gz) = b8fbb6123d8ddf604dfa4ff5ae17a79b89cfae08f9320fd8cab223c4186350831ee2445ed6d2a1d920146fcfc927f3df00b616f15fd3bfabca3f094f66e142df