python-qt5-sip/support-python3.6.patch
Benjamin Greiner f74a2a1694 - Add patch to fix license in setup.py and PKG-INFO files. I
contacted upstream (Phil Thompson) and he confirmed that
  pyqt6-sip is now licensed just as BSD-2-Clause and setup.py needs
  fixing. Considering the sources of pyqt6-sip and pyqt5-sip had
  the same license related changes, I added the following patch
  to fix this here too:
  * fix-license-in-setup_py.patch
- Rebase patch:
  * support-python3.6.patch

OBS-URL: https://build.opensuse.org/package/show/KDE:Qt:PyQt/python-qt5-sip?expand=0&rev=14
2025-01-22 12:31:18 +00:00

81 lines
2.5 KiB
Diff

diff -ur pyqt5_sip-12.16.1/PKG-INFO pyqt5_sip-12.16.1_fix/PKG-INFO
--- pyqt5_sip-12.16.1/PKG-INFO 2024-12-12 11:01:36.048525000 +0100
+++ pyqt5_sip-12.16.1_fix/PKG-INFO 2025-01-21 12:59:58.918060996 +0100
@@ -9,7 +9,7 @@
Platform: X11
Platform: macOS
Platform: Windows
-Requires-Python: >=3.9
+Requires-Python: >=3.6
License-File: LICENSE
sip Extension Module
diff -ur pyqt5_sip-12.16.1/PyQt5_sip.egg-info/PKG-INFO pyqt5_sip-12.16.1_fix/PyQt5_sip.egg-info/PKG-INFO
--- pyqt5_sip-12.16.1/PyQt5_sip.egg-info/PKG-INFO 2024-12-12 11:01:35.000000000 +0100
+++ pyqt5_sip-12.16.1_fix/PyQt5_sip.egg-info/PKG-INFO 2025-01-21 13:00:02.294780054 +0100
@@ -9,7 +9,7 @@
Platform: X11
Platform: macOS
Platform: Windows
-Requires-Python: >=3.9
+Requires-Python: >=3.6
License-File: LICENSE
sip Extension Module
diff -ur pyqt5_sip-12.16.1/setup.py pyqt5_sip-12.16.1_fix/setup.py
--- pyqt5_sip-12.16.1/setup.py 2024-12-12 11:01:35.000000000 +0100
+++ pyqt5_sip-12.16.1_fix/setup.py 2025-01-21 13:01:46.169725120 +0100
@@ -18,6 +18,6 @@
name='PyQt5_sip',
version='12.16.1',
license='BSD-2-Clause',
- python_requires='>=3.9',
+ python_requires='>=3.6',
ext_modules=[module]
)
diff -ur pyqt5_sip-12.16.1/sip.h pyqt5_sip-12.16.1_fix/sip.h
--- pyqt5_sip-12.16.1/sip.h 2024-12-12 11:01:35.000000000 +0100
+++ pyqt5_sip-12.16.1_fix/sip.h 2025-01-21 13:01:46.169725120 +0100
@@ -14,8 +14,8 @@
#include <Python.h>
/* Sanity check on the Python version. */
-#if PY_VERSION_HEX < 0x03090000
-#error "This version of PyQt5.sip requires Python v3.9 or later"
+#if PY_VERSION_HEX < 0x03060000
+#error "This version of PyQt5.sip requires Python v3.6 or later"
#endif
diff -ur pyqt5_sip-12.16.1/siplib.c pyqt5_sip-12.16.1_fix/siplib.c
--- pyqt5_sip-12.16.1/siplib.c 2024-12-12 11:01:35.000000000 +0100
+++ pyqt5_sip-12.16.1_fix/siplib.c 2025-01-21 13:01:46.173058506 +0100
@@ -1027,6 +1027,10 @@
PyObject *obj;
PyMethodDef *md;
+#if PY_VERSION_HEX < 0x03070000 && defined(WITH_THREAD)
+ PyEval_InitThreads();
+#endif
+
/* Add the SIP version number. */
obj = PyLong_FromLong(SIP_VERSION);
@@ -13335,12 +13339,16 @@
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step,
Py_ssize_t *slicelength)
{
+#if PY_VERSION_HEX >= 0x03070000
if (PySlice_Unpack(slice, start, stop, step) < 0)
return -1;
*slicelength = PySlice_AdjustIndices(length, start, stop, *step);
return 0;
+#else
+ return PySlice_GetIndicesEx(slice, length, start, stop, step, slicelength);
+#endif
}