require PyQt5-sip-py* package [release 5.14.2-5mamba;Mon Apr 13 2020]

This commit is contained in:
Silvan Calarco 2024-01-05 17:52:29 +01:00
parent a7312a6f09
commit 9b63c4c0c4
4 changed files with 54 additions and 335 deletions

View File

@ -1,254 +0,0 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 03_qreal_float_support.dpatch by Michael Casadevall <sonicmctails@gmail.com>
##
## 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<QPair<double, double> > is implemented as a Python list of 2-element tuples.
+%MappedType QList<QPair<double, double> >
+{
+%TypeHeaderCode
+#include <qlist.h>
+#include <qpair.h>
+%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<double, double> &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<QPair<double, double> > *ql = new QList<QPair<double, double> >;
+ 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<double, double>(first, second));
+ }
+
+ *sipCppPtr = ql;
+
+ return sipGetState(sipTransferObj);
+%End
+};
+%End
+%If (Qt_4_3_0 -)
+// QList<QPair<double, TYPE> > is implemented as a Python list of 2-element tuples.
+template<double, TYPE>
+%MappedType QList<QPair<double, TYPE> >
+{
+%TypeHeaderCode
+#include <qlist.h>
+#include <qpair.h>
+%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<double, TYPE> &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<QPair<double, TYPE> > *ql = new QList<QPair<double, TYPE> >;
+ 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<TYPE *>(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<double, TYPE>(d, *t));
+
+ sipReleaseInstance(t, sipClass_TYPE, state);
+ }
+
+ *sipCppPtr = ql;
+
+ return sipGetState(sipTransferObj);
+%End
+};
+%End
+
+// QList<double> is implemented as a Python list of doubles.
+%MappedType QList<double>
+{
+%TypeHeaderCode
+#include <qlist.h>
+%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<double> *ql = new QList<double>;
+ 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

View File

@ -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

View File

@ -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);

View File

@ -1,19 +1,17 @@
%define pythonsip_ver %(sip -V) %define pythonsip_ver %(sip -V)
Name: PyQt5 Name: PyQt5
Version: 5.13.1 Version: 5.14.2
Release: 1mamba Release: 5mamba
Summary: Python bindings for the Qt5 cross platform GUI toolkit Summary: Python bindings for the Qt5 cross platform GUI toolkit
Group: System/Libraries Group: System/Libraries
Vendor: openmamba Vendor: openmamba
Distribution: openmamba Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it> Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.riverbankcomputing.com/software/pyqt 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 #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 Patch3: PyQt5-5.3.2-python-sip-4.16.1.patch
License: GPL License: GPL
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
@ -28,20 +26,15 @@ BuildRequires: libstdc++6-devel
BuildRequires: chrpath BuildRequires: chrpath
BuildRequires: libXcursor-devel BuildRequires: libXcursor-devel
BuildRequires: libdbus-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 # WARNING: do not parametrize python-sip-devel version or it will be useless for ports
BuildRequires: python-sip-devel >= 4.19.18 BuildRequires: python-dbus-py3 >= 1.2.8-3mamba
%if "%?with_pyver" BuildRequires: python-sip-py3 >= 5.1.2
BuildRequires: python-dbus-py%{with_pyver} >= 1.2.8-3mamba BuildRequires: python-dbus-py36 >= 1.2.8-3mamba
BuildRequires: python-sip-py%{with_pyver}-devel >= 4.19.19 BuildRequires: python-sip-py36 >= 5.1.2
%endif
BuildRequires: libqt5-devel >= %{version} BuildRequires: libqt5-devel >= %{version}
%ifnarch arm %ifnarch arm
BuildRequires: libQt5WebEngine-devel >= %{version} BuildRequires: libQt5WebEngine-devel >= %{version}
%endif %endif
Requires: python-dbus
Requires: %{name}-qmlplugin
BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description %description
@ -61,6 +54,13 @@ PyQt5 is a comprehensive set of Python bindings for Nokia's Qt5 cross platform G
%package py%{pyver} %package py%{pyver}
Group: System/Libraries/Python Group: System/Libraries/Python
Summary: Python %{pyver} bindings for the Qt5 cross platform GUI toolkit 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 %py_requires
%description py%{pyver} %description py%{pyver}
@ -70,11 +70,11 @@ PyQt5 is a comprehensive set of Python bindings for Qt5 cross platform GUI toolk
%package devel %package devel
Summary: Development files for PyQt5 Summary: Development files for PyQt5
Group: Development/Libraries Group: Development/Libraries
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} Requires: %{name}-py3 = %{?epoch:%epoch:}%{version}-%{release}
Requires: %{name}-QtDesigner = %{?epoch:%epoch:}%{version}-%{release} #Requires: %{name}-QtDesigner = %{?epoch:%epoch:}%{version}-%{release}
%description devel %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. This package contains files needed for development.
@ -83,31 +83,30 @@ Summary: Qml plugin for PyQt5
Group: System/Libraries Group: System/Libraries
%description qmlplugin %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. This package contains the QML plugin.
%package %{?with_pyver:py%{pyver}-}QtDesigner %package QtDesigner%{?with_pyver:-py%{pyver}}
Summary: QtDesigner support components for PyQt4 Summary: QtDesigner support components for PyQt5
Group: System/Libraries 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 %description QtDesigner%{?with_pyver:-py%{pyver}}
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 QtDesigner support components for PyQt4. This package contains the QtDesigner support components for PyQt5.
%prep %prep
%setup -q -n PyQt5_gpl-%{version} %setup -q
#-D -T #-D -T
#:<< _EOF #:<< _EOF
#%patch0 -p0
#% ifarch arm
#% patch1 -p1
#% endif
#%ifarch x86_64
#%patch2 -p1
#%endif
#%patch3 -p1 #%patch3 -p1
%build %build
@ -130,14 +129,16 @@ sed -i "/generate_code(\"phonon\")/s:phonon\":&, extra_include_dirs=[\"%{_includ
# Fix documentation permissions # Fix documentation permissions
find examples/ -type f -exec chmod 0644 {} ';' find examples/ -type f -exec chmod 0644 {} ';'
%if "%{pyver}" != "3"
rm -f %{buildroot}%{_libdir}/qt5/plugins/PyQt5/libpyqt5qmlplugin.so
%endif
%clean %clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files %{?with_pyver:py%{pyver}} %files %{?with_pyver:py%{pyver}}
%defattr(-,root,root) %defattr(-,root,root)
#%if "%{?pyver}" != "3"
%{python_sitelib}/dbus/mainloop/pyqt5.so %{python_sitelib}/dbus/mainloop/pyqt5.so
#%endif
%dir %{python_sitearch}/PyQt5-%{version}.dist-info %dir %{python_sitearch}/PyQt5-%{version}.dist-info
%{python_sitearch}/PyQt5-%{version}.dist-info/* %{python_sitearch}/PyQt5-%{version}.dist-info/*
%dir %{python_sitearch}/PyQt5 %dir %{python_sitearch}/PyQt5
@ -146,9 +147,11 @@ find examples/ -type f -exec chmod 0644 {} ';'
%dir %{_qt5_plugindir}/PyQt5 %dir %{_qt5_plugindir}/PyQt5
%doc LICENSE* %doc LICENSE*
%if "%{pyver}" == "3"
%files qmlplugin %files qmlplugin
%defattr(-,root,root) %defattr(-,root,root)
%{_qt5_plugindir}/PyQt5/libpyqt5qmlplugin.so %{_qt5_plugindir}/PyQt5/libpyqt5qmlplugin.so
%endif
%files devel %files devel
%defattr(-,root,root) %defattr(-,root,root)
@ -159,12 +162,27 @@ find examples/ -type f -exec chmod 0644 {} ';'
%doc examples %doc examples
%doc NEWS README %doc NEWS README
%files %{?with_pyver:py%{pyver}-}QtDesigner %files QtDesigner%{?with_pyver:-py%{pyver}}
%defattr(-,root,root) %defattr(-,root,root)
%{python_sitearch}/PyQt5/QtDesigner.so %{python_sitearch}/PyQt5/QtDesigner.so
%{_qt5_plugindir}/designer/* %{_qt5_plugindir}/designer/*
%changelog %changelog
* Mon Apr 13 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 5.14.2-5mamba
- require PyQt5-sip-py* package
* Sun Apr 12 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 5.14.2-4mamba
- fix other internal requirements
* Sat Apr 11 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 5.14.2-3mamba
- PyQt5-devel: remove requirement for PyQt5-QtDesigner
* Sat Apr 11 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 5.14.2-2mamba
- PyQt5-devel: require PyQt5-py3
* Fri Apr 10 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 5.14.2-1mamba
- update to 5.14.2
* Sat Oct 26 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 5.13.1-1mamba * Sat Oct 26 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 5.13.1-1mamba
- update to 5.13.1 - update to 5.13.1