From 9b63c4c0c48842cb1bb70aeca476e2bc4de530b1 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 17:52:29 +0100 Subject: [PATCH] require PyQt5-sip-py* package [release 5.14.2-5mamba;Mon Apr 13 2020] --- PyQt4-4.7.3-qreal_float_support.patch | 254 -------------------------- PyQt4-4.9.4-x86_64.patch | 29 --- PyQt4-egl.patch | 16 -- PyQt5.spec | 90 +++++---- 4 files changed, 54 insertions(+), 335 deletions(-) delete mode 100644 PyQt4-4.7.3-qreal_float_support.patch delete mode 100644 PyQt4-4.9.4-x86_64.patch delete mode 100644 PyQt4-egl.patch diff --git a/PyQt4-4.7.3-qreal_float_support.patch b/PyQt4-4.7.3-qreal_float_support.patch deleted file mode 100644 index 958fe56..0000000 --- a/PyQt4-4.7.3-qreal_float_support.patch +++ /dev/null @@ -1,254 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 03_qreal_float_support.dpatch by Michael Casadevall -## -## DP: Corrects a configure test, and adds explicate double handling -## to qlist.sip on architectures where qreal != double - -@DPATCH@ -Index: python-qt4-4.7.2/configure.py -=================================================================== ---- python-qt4-4.7.2.orig/configure.py 2010-03-17 19:29:19.000000000 +0100 -+++ python-qt4-4.7.2/configure.py 2010-03-25 23:53:55.468631945 +0100 -@@ -1915,8 +1915,9 @@ - out << "PyQt_NoOpenGLES\\n"; - #endif - -- if (sizeof (qreal) != sizeof (double)) -+#if defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) - out << "PyQt_qreal_double\\n"; -+#endif - - return 0; - } -Index: python-qt4-4.7.2/sip/QtCore/qlist.sip -=================================================================== ---- python-qt4-4.7.2.orig/sip/QtCore/qlist.sip 2010-03-17 19:29:26.000000000 +0100 -+++ python-qt4-4.7.2/sip/QtCore/qlist.sip 2010-03-25 23:53:55.468631945 +0100 -@@ -749,3 +749,227 @@ - return sipGetState(sipTransferObj); - %End - }; -+ -+// If we're on an architecture where qreal != double, then we need to also -+// explicately handle doubles. On architectures where qreal == double, they -+// will automaticially be cast upwards -+ -+%If (!PyQt_qreal_double) -+ -+%If (Qt_4_3_0 -) -+// QList > is implemented as a Python list of 2-element tuples. -+%MappedType QList > -+{ -+%TypeHeaderCode -+#include -+#include -+%End -+ -+%ConvertFromTypeCode -+ // Create the list. -+ PyObject *l; -+ -+ if ((l = PyList_New(sipCpp->size())) == NULL) -+ return NULL; -+ -+ // Set the list elements. -+ for (int i = 0; i < sipCpp->size(); ++i) -+ { -+ const QPair &p = sipCpp->at(i); -+ PyObject *pobj; -+ -+ if ((pobj = Py_BuildValue((char *)"dd", p.first, p.second)) == NULL) -+ { -+ Py_DECREF(l); -+ -+ return NULL; -+ } -+ -+ PyList_SET_ITEM(l, i, pobj); -+ } -+ -+ return l; -+%End -+ -+%ConvertToTypeCode -+ SIP_SSIZE_T len; -+ -+ // Check the type if that is all that is required. -+ if (sipIsErr == NULL) -+ { -+ if (!PySequence_Check(sipPy) || (len = PySequence_Size(sipPy)) < 0) -+ return 0; -+ -+ for (SIP_SSIZE_T i = 0; i < len; ++i) -+ { -+ PyObject *tup = PySequence_ITEM(sipPy, i); -+ -+ if (!PySequence_Check(tup) || PySequence_Size(tup) != 2) -+ return 0; -+ } -+ -+ return 1; -+ } -+ -+ QList > *ql = new QList >; -+ len = PySequence_Size(sipPy); -+ -+ for (SIP_SSIZE_T i = 0; i < len; ++i) -+ { -+ PyObject *tup = PySequence_ITEM(sipPy, i); -+ -+ double first = PyFloat_AsDouble(PySequence_ITEM(tup, 0)); -+ double second = PyFloat_AsDouble(PySequence_ITEM(tup, 1)); -+ -+ ql->append(QPair(first, second)); -+ } -+ -+ *sipCppPtr = ql; -+ -+ return sipGetState(sipTransferObj); -+%End -+}; -+%End -+%If (Qt_4_3_0 -) -+// QList > is implemented as a Python list of 2-element tuples. -+template -+%MappedType QList > -+{ -+%TypeHeaderCode -+#include -+#include -+%End -+ -+%ConvertFromTypeCode -+ // Create the list. -+ PyObject *l; -+ -+ if ((l = PyList_New(sipCpp->size())) == NULL) -+ return NULL; -+ -+ // Set the list elements. -+ for (int i = 0; i < sipCpp->size(); ++i) -+ { -+ const QPair &p = sipCpp->at(i); -+ TYPE *t = new TYPE(p.second); -+ PyObject *pobj; -+ -+ if ((pobj = sipBuildResult(NULL, "(dB)", p.first, t, sipClass_TYPE, sipTransferObj)) == NULL) -+ { -+ Py_DECREF(l); -+ delete t; -+ -+ return NULL; -+ } -+ -+ PyList_SET_ITEM(l, i, pobj); -+ } -+ -+ return l; -+%End -+ -+%ConvertToTypeCode -+ SIP_SSIZE_T len; -+ -+ // Check the type if that is all that is required. -+ if (sipIsErr == NULL) -+ { -+ if (!PySequence_Check(sipPy) || (len = PySequence_Size(sipPy)) < 0) -+ return 0; -+ -+ for (SIP_SSIZE_T i = 0; i < len; ++i) -+ { -+ PyObject *tup = PySequence_ITEM(sipPy, i); -+ -+ if (!PySequence_Check(tup) || PySequence_Size(tup) != 2) -+ return 0; -+ -+ if (!sipCanConvertToInstance(PySequence_ITEM(tup, 1), sipClass_TYPE, SIP_NOT_NONE)) -+ return 0; -+ } -+ -+ return 1; -+ } -+ -+ QList > *ql = new QList >; -+ len = PySequence_Size(sipPy); -+ -+ for (SIP_SSIZE_T i = 0; i < len; ++i) -+ { -+ PyObject *tup = PySequence_ITEM(sipPy, i); -+ double d; -+ int state; -+ -+ d = PyFloat_AsDouble(PySequence_ITEM(tup, 0)); -+ TYPE *t = reinterpret_cast(sipConvertToInstance(PySequence_ITEM(tup, 1), sipClass_TYPE, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr)); -+ -+ if (*sipIsErr) -+ { -+ sipReleaseInstance(t, sipClass_TYPE, state); -+ -+ delete ql; -+ return 0; -+ } -+ -+ ql->append(QPair(d, *t)); -+ -+ sipReleaseInstance(t, sipClass_TYPE, state); -+ } -+ -+ *sipCppPtr = ql; -+ -+ return sipGetState(sipTransferObj); -+%End -+}; -+%End -+ -+// QList is implemented as a Python list of doubles. -+%MappedType QList -+{ -+%TypeHeaderCode -+#include -+%End -+ -+%ConvertFromTypeCode -+ // Create the list. -+ PyObject *l; -+ -+ if ((l = PyList_New(sipCpp->size())) == NULL) -+ return NULL; -+ -+ // Set the list elements. -+ for (int i = 0; i < sipCpp->size(); ++i) -+ { -+ PyObject *pobj; -+ -+ if ((pobj = PyFloat_FromDouble(sipCpp->value(i))) == NULL) -+ { -+ Py_DECREF(l); -+ -+ return NULL; -+ } -+ -+ PyList_SET_ITEM(l, i, pobj); -+ } -+ -+ return l; -+%End -+ -+%ConvertToTypeCode -+ // Check the type if that is all that is required. -+ if (sipIsErr == NULL) -+ return (PySequence_Check(sipPy) && PySequence_Size(sipPy) >= 0); -+ -+ QList *ql = new QList; -+ SIP_SSIZE_T len = PySequence_Size(sipPy); -+ -+ for (SIP_SSIZE_T i = 0; i < len; ++i) -+ ql->append(PyFloat_AsDouble(PySequence_ITEM(sipPy, i))); -+ -+ *sipCppPtr = ql; -+ -+ return sipGetState(sipTransferObj); -+%End -+}; -+ -+%End diff --git a/PyQt4-4.9.4-x86_64.patch b/PyQt4-4.9.4-x86_64.patch deleted file mode 100644 index b268598..0000000 --- a/PyQt4-4.9.4-x86_64.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff -Nru PyQt-x11-gpl-4.9.4/configure.py PyQt-x11-gpl-4.9.4.buono/configure.py ---- PyQt-x11-gpl-4.9.4/configure.py 2012-09-26 10:57:20.302056510 +0000 -+++ PyQt-x11-gpl-4.9.4.buono/configure.py 2012-09-26 10:56:12.418802710 +0000 -@@ -966,6 +966,7 @@ - else: - # Use distutils to get the additional configuration. - from distutils.sysconfig import get_config_vars -+ from distutils.sysconfig import get_python_lib - ducfg = get_config_vars() - - config_args = ducfg.get("CONFIG_ARGS", "") -@@ -980,16 +981,7 @@ - dynamic_pylib = "--enable-shared" in config_args - - if dynamic_pylib: -- if glob.glob("%s/lib/libpython%d.%d*" % (ducfg["exec_prefix"], py_major, py_minor)): -- lib_dir_flag = quote("-L%s/lib" % ducfg["exec_prefix"]) -- elif glob.glob("%s/libpython%d.%d*" % (ducfg["LIBDIR"], py_major, py_minor)): -- lib_dir_flag = quote("-L%s" % ducfg["LIBDIR"]) -- else: -- sipconfig.inform("Qt Designer plugin disabled because Python library couldn't be found") -- lib_dir_flag = '' -- opts.designer_plugin = False -- -- link = "%s -lpython%d.%d%s" % (lib_dir_flag, py_major, py_minor, abi) -+ link = "-L%s -lpython%d.%d" % (get_python_lib(plat_specific=1, standard_lib=1), py_major, py_minor) - else: - sipconfig.inform("Qt Designer plugin disabled because Python library is static") - opts.designer_plugin = False diff --git a/PyQt4-egl.patch b/PyQt4-egl.patch deleted file mode 100644 index dcbe773..0000000 --- a/PyQt4-egl.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- sip/QtOpenGL/qgl.sip 2010-12-04 17:15:10.497601234 +0200 -+++ sip/QtOpenGL/qgl.sip 2010-12-04 17:15:46.138746235 +0200 -@@ -255,13 +255,6 @@ - %End - GLuint bindTexture(const QString &); - --protected: --%If (WS_X11) --%If (PyQt_NoOpenGLES) -- virtual void *chooseVisual(); --%End --%End -- - public: - void deleteTexture(GLuint); - static void setTextureCacheLimit(int); diff --git a/PyQt5.spec b/PyQt5.spec index a95d7b8..ba3c33e 100644 --- a/PyQt5.spec +++ b/PyQt5.spec @@ -1,19 +1,17 @@ %define pythonsip_ver %(sip -V) Name: PyQt5 -Version: 5.13.1 -Release: 1mamba +Version: 5.14.2 +Release: 5mamba Summary: Python bindings for the Qt5 cross platform GUI toolkit Group: System/Libraries Vendor: openmamba Distribution: openmamba Packager: Silvan Calarco URL: http://www.riverbankcomputing.com/software/pyqt -Source: https://www.riverbankcomputing.com/static/Downloads/PyQt5/%{version}/PyQt5_gpl-%{version}.tar.gz +Source: https://pypi.debian.net/PyQt5/PyQt5-%{version}.tar.gz +#Source: https://www.riverbankcomputing.com/static/Downloads/PyQt5/%{version}/PyQt5_gpl-%{version}.tar.gz #Source: http://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-%{version}/PyQt5_gpl-%{version}.tar.gz -Patch0: PyQt4-egl.patch -Patch1: PyQt4-4.7.3-qreal_float_support.patch -Patch2: PyQt4-4.9.4-x86_64.patch Patch3: PyQt5-5.3.2-python-sip-4.16.1.patch License: GPL ## AUTOBUILDREQ-BEGIN @@ -28,20 +26,15 @@ BuildRequires: libstdc++6-devel BuildRequires: chrpath BuildRequires: libXcursor-devel BuildRequires: libdbus-devel -BuildRequires: python-dbus -BuildRequires: python-dbus-devel # WARNING: do not parametrize python-sip-devel version or it will be useless for ports -BuildRequires: python-sip-devel >= 4.19.18 -%if "%?with_pyver" -BuildRequires: python-dbus-py%{with_pyver} >= 1.2.8-3mamba -BuildRequires: python-sip-py%{with_pyver}-devel >= 4.19.19 -%endif +BuildRequires: python-dbus-py3 >= 1.2.8-3mamba +BuildRequires: python-sip-py3 >= 5.1.2 +BuildRequires: python-dbus-py36 >= 1.2.8-3mamba +BuildRequires: python-sip-py36 >= 5.1.2 BuildRequires: libqt5-devel >= %{version} %ifnarch arm BuildRequires: libQt5WebEngine-devel >= %{version} %endif -Requires: python-dbus -Requires: %{name}-qmlplugin BuildRoot: %{_tmppath}/%{name}-%{version}-root %description @@ -61,6 +54,13 @@ PyQt5 is a comprehensive set of Python bindings for Nokia's Qt5 cross platform G %package py%{pyver} Group: System/Libraries/Python Summary: Python %{pyver} bindings for the Qt5 cross platform GUI toolkit +Requires: python-dbus-py%{pyver} +Requires: %{name}-qmlplugin +Requires: PyQt5-sip-py%{pyver} +%if "%{pyver}" == "3" +Provides: PyQt5 +Obsoletes: PyQt5 +%endif %py_requires %description py%{pyver} @@ -70,11 +70,11 @@ PyQt5 is a comprehensive set of Python bindings for Qt5 cross platform GUI toolk %package devel Summary: Development files for PyQt5 Group: Development/Libraries -Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} -Requires: %{name}-QtDesigner = %{?epoch:%epoch:}%{version}-%{release} +Requires: %{name}-py3 = %{?epoch:%epoch:}%{version}-%{release} +#Requires: %{name}-QtDesigner = %{?epoch:%epoch:}%{version}-%{release} %description devel -PyQt4 is a comprehensive set of Python bindings for Nokia's Qt4 cross platform GUI toolkit. +PyQt5 is a comprehensive set of Python bindings for Nokia's Qt5 cross platform GUI toolkit. This package contains files needed for development. @@ -83,31 +83,30 @@ Summary: Qml plugin for PyQt5 Group: System/Libraries %description qmlplugin -PyQt4 is a comprehensive set of Python bindings for Nokia's Qt4 cross platform GUI toolkit. +PyQt5 is a comprehensive set of Python bindings for Nokia's Qt5 cross platform GUI toolkit. This package contains the QML plugin. -%package %{?with_pyver:py%{pyver}-}QtDesigner -Summary: QtDesigner support components for PyQt4 +%package QtDesigner%{?with_pyver:-py%{pyver}} +Summary: QtDesigner support components for PyQt5 Group: System/Libraries -Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} +Requires: PyQt5%{?with_pyver:-py%{pyver}} = %{?epoch:%epoch:}%{version}-%{release} +Provides: PyQt5%{?with_pyver:-py%{pyver}}-QtDesigner +Obsoletes: PyQt5%{?with_pyver:-py%{pyver}}-QtDesigner +%if "%{pyver}" == "3" +Provides: PyQt5-QtDesigner +Obsoletes: PyQt5-QtDesigner +%endif -%description %{?with_pyver:py%{pyver}-}QtDesigner -PyQt4 is a comprehensive set of Python bindings for Nokia's Qt4 cross platform GUI toolkit. +%description QtDesigner%{?with_pyver:-py%{pyver}} +PyQt5 is a comprehensive set of Python bindings for Nokia's Qt5 cross platform GUI toolkit. -This package contains the QtDesigner support components for PyQt4. +This package contains the QtDesigner support components for PyQt5. %prep -%setup -q -n PyQt5_gpl-%{version} +%setup -q #-D -T #:<< _EOF -#%patch0 -p0 -#% ifarch arm -#% patch1 -p1 -#% endif -#%ifarch x86_64 -#%patch2 -p1 -#%endif #%patch3 -p1 %build @@ -130,14 +129,16 @@ sed -i "/generate_code(\"phonon\")/s:phonon\":&, extra_include_dirs=[\"%{_includ # Fix documentation permissions find examples/ -type f -exec chmod 0644 {} ';' +%if "%{pyver}" != "3" +rm -f %{buildroot}%{_libdir}/qt5/plugins/PyQt5/libpyqt5qmlplugin.so +%endif + %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %files %{?with_pyver:py%{pyver}} %defattr(-,root,root) -#%if "%{?pyver}" != "3" %{python_sitelib}/dbus/mainloop/pyqt5.so -#%endif %dir %{python_sitearch}/PyQt5-%{version}.dist-info %{python_sitearch}/PyQt5-%{version}.dist-info/* %dir %{python_sitearch}/PyQt5 @@ -146,9 +147,11 @@ find examples/ -type f -exec chmod 0644 {} ';' %dir %{_qt5_plugindir}/PyQt5 %doc LICENSE* +%if "%{pyver}" == "3" %files qmlplugin %defattr(-,root,root) %{_qt5_plugindir}/PyQt5/libpyqt5qmlplugin.so +%endif %files devel %defattr(-,root,root) @@ -159,12 +162,27 @@ find examples/ -type f -exec chmod 0644 {} ';' %doc examples %doc NEWS README -%files %{?with_pyver:py%{pyver}-}QtDesigner +%files QtDesigner%{?with_pyver:-py%{pyver}} %defattr(-,root,root) %{python_sitearch}/PyQt5/QtDesigner.so %{_qt5_plugindir}/designer/* %changelog +* Mon Apr 13 2020 Silvan Calarco 5.14.2-5mamba +- require PyQt5-sip-py* package + +* Sun Apr 12 2020 Silvan Calarco 5.14.2-4mamba +- fix other internal requirements + +* Sat Apr 11 2020 Silvan Calarco 5.14.2-3mamba +- PyQt5-devel: remove requirement for PyQt5-QtDesigner + +* Sat Apr 11 2020 Silvan Calarco 5.14.2-2mamba +- PyQt5-devel: require PyQt5-py3 + +* Fri Apr 10 2020 Silvan Calarco 5.14.2-1mamba +- update to 5.14.2 + * Sat Oct 26 2019 Silvan Calarco 5.13.1-1mamba - update to 5.13.1