Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
eceb87cec4
!12 [sync] PR-11: Package upgrade
From: @openeuler-sync-bot 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
2022-10-13 01:04:46 +00:00
xigaoxinyan
22910c2769 Package upgrade
(cherry picked from commit 79779ade142e84675f352ee9eb6a80b931bf7d8b)
2022-10-12 16:06:42 +08:00
openeuler-ci-bot
d4a3941198 !10 remove python2 dependency
From: @lei_ju
Reviewed-by: @small_leek
Signed-off-by: @small_leek
2020-10-30 11:48:01 +08:00
lei_ju
703906473d remove python2 dependency 2020-10-30 09:30:23 +08:00
openeuler-ci-bot
ab40180ac5 !7 Modify Source0 Url of package PyQt4
From: @wang--ge
Reviewed-by: @small_leek
Signed-off-by: @small_leek
2020-09-17 11:50:08 +08:00
wangge
484de8259e Modify Source0 Url on master branch 2020-09-15 20:10:45 +08:00
openeuler-ci-bot
7a6b85023a !2 add yaml file
Merge pull request !2 from sugarfillet/master
2020-05-21 10:35:40 +08:00
sugarfillet
02ac1ea862 add yaml file 2020-05-08 15:54:38 +08:00
openeuler-ci-bot
29685b467e !1 package init
Merge pull request !1 from bingo2008/bingoo2008
2020-02-28 11:13:06 +08:00
bingo2008
1f1c1de685 package init 2020-02-14 10:49:30 +08:00
4 changed files with 359 additions and 0 deletions

122
PyQt4.spec Normal file
View File

@ -0,0 +1,122 @@
%{!?python3_inc:%global python3_inc %(%{__python3} -c "from distutils.sysconfig import get_python_inc; print(get_python_inc(1))")}
%global python3_dbus_dir %(%{__python3} -c "import dbus.mainloop; print(dbus.mainloop.__path__[0])")
%global __provides_exclude_from ^(%{python3_sitearch}/.*\\.so|%{_qt4_plugindir}/.*\\.so)$
Name: PyQt4
Version: 4.12.3
Release: 1
Summary: Python bindings for Qt4
License: (GPLv3 or GPLv2 with exceptions) and BSD
Url: http://www.riverbankcomputing.com/software/pyqt/
Source0: http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-%{version}/PyQt4_gpl_x11-%{version}.tar.gz/download?use_mirror=ufpr#/PyQt4_gpl_x11-%{version}.tar.gz
Patch0001: qreal_float_support.diff
BuildRequires: chrpath dbus-python findutils gcc-c++ pkgconfig(dbus-1) pkgconfig(dbus-python) pkgconfig(phonon)
BuildRequires: pkgconfig(QtDBus) pkgconfig(QtDeclarative) pkgconfig(QtDesigner) pkgconfig(QtGui) pkgconfig(QtHelp)
BuildRequires: pkgconfig(QtMultimedia) pkgconfig(QtNetwork) pkgconfig(QtOpenGL) pkgconfig(QtScript) pkgconfig(QtScriptTools)
BuildRequires: pkgconfig(QtSql) pkgconfig(QtSvg) pkgconfig(QtTest) pkgconfig(QtXml) pkgconfig(QtXmlPatterns)
BuildRequires: python3-dbus python3-devel python3-sip python3-sip-devel >= 4.19
Buildrequires: qt-assistant-adp-devel
Requires: dbus-python qt4 >= %{_qt4_version}
Provides: python-qt4 = %{version}-%{release}
Provides: PyQt4-qsci-api = %{version}-%{release} PyQt4-assistant = %{version}-%{release} PyQt4-webkit = %{version}-%{release}
Provides: python-qt4-qsci-api = %{version}-%{release} python-qt4-assistant = %{version}-%{release} python-qt4-webkit = %{version}-%{release}
Provides: pyqt4-webkit = %{version}-%{release} pyqt4 = %{version}-%{release}
Obsoletes: PyQt4 < 4.11.4-8 pyqt4-devel < 4.10.3-6 python3-pyqt4-devel < 4.10.3-6
Obsoletes: PyQt4-qsci-api < %{version}-%{release} PyQt4-assistant < %{version}-%{release} PyQt4-webkit < %{version}-%{release}
%description
These are Python bindings for Qt4.
%package devel
Summary: Development files for the Qt4 library
Requires: PyQt4 = %{version}-%{release} qt4-devel
Provides: PyQt4-webkit-devel = %{version}-%{release} python-qt4-devel = %{version}-%{release}
Provides: pyqt4-devel = %{version}-%{release}
Obsoletes: PyQt4 < 4.11.4-8 PyQt4-devel < 4.10.3-6 PyQt4-webkit-devel < %{version}-%{release}
%description devel
The Qt4-devel package includes header files and libraries necessary for the Qt4 library.
%package help
Summary: This package contains help documents
BuildArch: noarch
Requires: PyQt4 = %{version}-%{release}
Provides: PyQt4-doc = %{version}-%{release} python-qt4-doc = %{version}-%{release}
Obsoletes: PyQt4-doc < %{version}-%{release} PyQt4-devel < 4.10.3-6 python3-PyQt4-devel < 4.10.3-6
%description help
Files for help with PyQt4.
%package -n python3-PyQt4
Summary: Python 3 bindings for Qt4
Requires: python3-dbus python3-PyQt4 = %{version}-%{release} python3-PyQt4 = %{version}-%{release}
Requires: qt4 >= %{_qt4_version} python3-sip-api(%{_sip_api_major}) >= %{_sip_api}
Provides: python3-qt4 = %{version}-%{release} python3-qt4-assistant = %{version}-%{release} python3-qt4-webkit = %{version}-%{release}
Provides: python3-PyQt4-assistant = %{version}-%{release} python3-PyQt4-webkit = %{version}-%{release}
Obsoletes: python3-PyQt4 < 4.11.4-8 python3-PyQt4-assistant < %{version}-%{release} python3-PyQt4-webkit < %{version}-%{release}
%description -n python3-PyQt4
These are Python 3 bindings for Qt4.
%package -n python3-PyQt4-devel
Summary: Python 3 bindings for Qt4
Provides: python3-PyQt4-webkit-devel = %{version}-%{release} python3-qt4-devel = %{version}-%{release}
Requires: python3-PyQt4 = %{version}-%{release} python3-sip-devel
Obsoletes: python3-PyQt4-devel < 4.10.3-6
%description -n python3-PyQt4-devel
The python3-PyQt4-devel package includes header files and libraries necessary for the python3 PyQt4 library.
%prep
%autosetup -n PyQt4_gpl_x11-%{version} -p1
install -D ./sip/QtGui/opengl_types.sip ./sip/QtGui/opengl_types.sip.orig
find examples/ -name "*.py" | xargs chmod a-x
%build
QT4DIR=%{_qt4_prefix}
PATH=%{_qt4_bindir}:$PATH ; export PATH
install -d %{_target_platform}-python3
cd %{_target_platform}-python3
%{__python3} ../configure.py --assume-shared --confirm-license --no-timestamp --qmake=%{_qt4_qmake} --no-qsci-api \
--sipdir=%{_datadir}/python3-sip/PyQt4 --verbose CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" LFLAGS="%{?__global_ldflags}"
%make_build
%install
%make_install INSTALL_ROOT=%{buildroot} -C %{_target_platform}-python3
rm -rfv %{buildroot}%{python3_sitearch}/PyQt4/uic/port_v2/
%check
diff -u ./sip/QtGui/opengl_types.sip.orig ./sip/QtGui/opengl_types.sip ||:
%files
%doc LICENSE
%{_qt4_plugindir}/designer/*
%files devel
%{_bindir}/*
%files help
%doc doc/* examples/ NEWS README
%files -n python3-PyQt4
%{python3_dbus_dir}/qt.so
%dir %{python3_sitearch}/PyQt4/
%{python3_sitearch}/PyQt4/*
%files -n python3-PyQt4-devel
%{_bindir}/*
%dir %{_datadir}/python3-sip/
%{_datadir}/python3-sip/PyQt4/
%changelog
* Thu Jun 23 2022 SimpleUpdate Robot <tc@openeuler.org> - 4.12.3-1
- Upgrade to version 4.12.3
* Tue Oct 27 2020 leiju <leiju4@huawei.com> - 4.12.1-14
- Remove python2 dependency
* Tue Sep 15 2020 Ge wang <wangge20@huawei.com> - 4.12.1-13
- Modify Source0 Url
* Fri Feb 14 2020 fengbing <fengbing7@huawei.com> - 4.12.1-12
- Pakcage init

4
PyQt4.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: pypi
src_repo: PyQt4
tag_prefix: ^
seperator: .

BIN
PyQt4_gpl_x11-4.12.3.tar.gz Normal file

Binary file not shown.

233
qreal_float_support.diff Normal file
View File

@ -0,0 +1,233 @@
## 03_qreal_float_support.dpatch by Michael Casadevall <sonicmctails@gmail.com>
Index: python-qt4-4.10.3/sip/QtCore/qlist.sip
===================================================================
--- python-qt4-4.10.3.orig/sip/QtCore/qlist.sip 2013-09-20 07:55:07.028033774 +0100
+++ python-qt4-4.10.3/sip/QtCore/qlist.sip 2013-09-20 07:55:07.024033774 +0100
@@ -819,3 +819,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