[Python-modules-commits] r25466 - in packages/pyqt5/trunk/debian (3 files)
mitya57-guest at users.alioth.debian.org
mitya57-guest at users.alioth.debian.org
Fri Aug 9 14:56:25 UTC 2013
Date: Friday, August 9, 2013 @ 14:56:23
Author: mitya57-guest
Revision: 25466
Update qreal_float_support.diff with latest upstream changes, and
re-enable it.
Modified:
packages/pyqt5/trunk/debian/changelog
packages/pyqt5/trunk/debian/patches/qreal_float_support.diff
packages/pyqt5/trunk/debian/patches/series
Modified: packages/pyqt5/trunk/debian/changelog
===================================================================
--- packages/pyqt5/trunk/debian/changelog 2013-08-09 14:32:29 UTC (rev 25465)
+++ packages/pyqt5/trunk/debian/changelog 2013-08-09 14:56:23 UTC (rev 25466)
@@ -5,8 +5,10 @@
* Install files to python3-dbus.mainloop.pyqt5{,-dbg} directly instead of
generating .install files. This fixes a problem of the -dbg package being
not installable because of unwanted debug-id files (closes: #718551).
+ * Update qreal_float_support.diff with latest upstream changes, and
+ re-enable it.
- -- Dmitry Shachnev <mitya57 at gmail.com> Tue, 30 Jul 2013 16:44:16 +0400
+ -- Dmitry Shachnev <mitya57 at gmail.com> Fri, 09 Aug 2013 18:50:42 +0400
pyqt5 (5.0-1) experimental; urgency=low
Modified: packages/pyqt5/trunk/debian/patches/qreal_float_support.diff
===================================================================
--- packages/pyqt5/trunk/debian/patches/qreal_float_support.diff 2013-08-09 14:32:29 UTC (rev 25465)
+++ packages/pyqt5/trunk/debian/patches/qreal_float_support.diff 2013-08-09 14:56:23 UTC (rev 25466)
@@ -1,257 +1,275 @@
-## 03_qreal_float_support.dpatch by Michael Casadevall <sonicmctails at gmail.com>
+Description: make PyQt5 compile on platforms where qreal is float
+Origin: upstream, changesets d1bfba006b28..5353ace04cdf
+Last-Update: 2013-08-09
+
--- a/configure.py
+++ b/configure.py
-@@ -2163,8 +2163,9 @@
+@@ -406,8 +406,10 @@
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";
+- out << "PyQt_qreal_double\\n";
++// This is the test used in qglobal.h.
++#if defined(QT_NO_FPU) || defined(Q_PROCESSOR_ARM) || defined(Q_OS_WINCE)
++ out << "PyQt_qreal_double\\n";
+#endif
return 0;
}
--- a/sip/QtCore/qlist.sip
+++ b/sip/QtCore/qlist.sip
-@@ -807,3 +807,227 @@
+@@ -402,216 +402,6 @@
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
---- a/configure-ng.py
-+++ b/configure-ng.py
-@@ -504,8 +504,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;
- }
+-// QList<QPair<qreal, qreal> > is implemented as a Python list of 2-element tuples.
+-%MappedType QList<QPair<qreal, qreal> > /DocType="list-of-tuple-of-float-float"/
+-{
+-%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<qreal, qreal> &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 *seq = PySequence_ITEM(sipPy, i);
+-
+- if (!seq || !PySequence_Check(seq) || PySequence_Size(seq) != 2)
+- {
+- Py_XDECREF(seq);
+- return 0;
+- }
+- }
+-
+- return 1;
+- }
+-
+- QList<QPair<qreal, qreal> > *ql = new QList<QPair<qreal, qreal> >;
+- len = PySequence_Size(sipPy);
+-
+- for (SIP_SSIZE_T i = 0; i < len; ++i)
+- {
+- PyObject *seq = PySequence_ITEM(sipPy, i);
+- PyObject *itm0 = PySequence_ITEM(seq, 0);
+- PyObject *itm1 = PySequence_ITEM(seq, 1);
+-
+- Py_DECREF(seq);
+-
+- if (!itm0 || !itm1)
+- {
+- Py_XDECREF(itm0);
+- Py_XDECREF(itm1);
+-
+- delete ql;
+- *sipIsErr = 1;
+-
+- return 0;
+- }
+-
+- qreal first = PyFloat_AsDouble(itm0);
+- qreal second = PyFloat_AsDouble(itm1);
+-
+- Py_DECREF(itm0);
+- Py_DECREF(itm1);
+-
+- ql->append(QPair<qreal, qreal>(first, second));
+- }
+-
+- *sipCppPtr = ql;
+-
+- return sipGetState(sipTransferObj);
+-%End
+-};
+-// QList<QPair<qreal, TYPE> > is implemented as a Python list of 2-element tuples.
+-template<qreal, TYPE>
+-%MappedType QList<QPair<qreal, TYPE> > /DocType="list-of-tuple-of-float-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<qreal, TYPE> &p = sipCpp->at(i);
+- TYPE *t = new TYPE(p.second);
+- PyObject *pobj;
+-
+- if ((pobj = sipBuildResult(NULL, "(dN)", p.first, t, sipType_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 *seq = PySequence_ITEM(sipPy, i);
+-
+- if (!seq || !PySequence_Check(seq) || PySequence_Size(seq) != 2)
+- {
+- Py_XDECREF(seq);
+- return 0;
+- }
+-
+- PyObject *itm1 = PySequence_ITEM(seq, 1);
+- bool ok = (itm1 && sipCanConvertToType(itm1, sipType_TYPE, SIP_NOT_NONE));
+-
+- Py_XDECREF(itm1);
+- Py_DECREF(seq);
+-
+- if (!ok)
+- return 0;
+- }
+-
+- return 1;
+- }
+-
+- QList<QPair<qreal, TYPE> > *ql = new QList<QPair<qreal, TYPE> >;
+- len = PySequence_Size(sipPy);
+-
+- for (SIP_SSIZE_T i = 0; i < len; ++i)
+- {
+- PyObject *seq = PySequence_ITEM(sipPy, i);
+- PyObject *itm0 = PySequence_ITEM(seq, 0);
+- PyObject *itm1 = PySequence_ITEM(seq, 1);
+-
+- Py_DECREF(seq);
+-
+- if (!itm0)
+- {
+- Py_DECREF(itm1);
+-
+- delete ql;
+- *sipIsErr = 1;
+-
+- return 0;
+- }
+-
+- qreal d;
+- int state;
+-
+- d = PyFloat_AsDouble(itm0);
+- TYPE *t = reinterpret_cast<TYPE *>(sipConvertToType(itm1, sipType_TYPE, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
+-
+- Py_DECREF(itm0);
+- Py_DECREF(itm1);
+-
+- if (*sipIsErr)
+- {
+- sipReleaseType(t, sipType_TYPE, state);
+-
+- delete ql;
+- return 0;
+- }
+-
+- ql->append(QPair<qreal, TYPE>(d, *t));
+-
+- sipReleaseType(t, sipType_TYPE, state);
+- }
+-
+- *sipCppPtr = ql;
+-
+- return sipGetState(sipTransferObj);
+-%End
+-};
+ // QList<int> is implemented as a Python list of integers.
+ %MappedType QList<int> /DocType="list-of-int"/
+ {
+--- a/sip/QtGui/qpainterpath.sip
++++ b/sip/QtGui/qpainterpath.sip
+@@ -154,8 +154,8 @@
+ void setCurveThreshold(qreal threshold);
+ qreal curveThreshold() const;
+ void setDashPattern(Qt::PenStyle);
+- void setDashPattern(const QVector<double> &dashPattern);
+- QVector<double> dashPattern() const;
++ void setDashPattern(const QVector<qreal> &dashPattern);
++ QVector<qreal> dashPattern() const;
+ QPainterPath createStroke(const QPainterPath &path) const;
+ void setDashOffset(qreal offset);
+ qreal dashOffset() const;
+--- a/sip/QtGui/qpen.sip
++++ b/sip/QtGui/qpen.sip
+@@ -88,8 +88,8 @@
+ void setCapStyle(Qt::PenCapStyle pcs);
+ Qt::PenJoinStyle joinStyle() const;
+ void setJoinStyle(Qt::PenJoinStyle pcs);
+- QVector<double> dashPattern() const;
+- void setDashPattern(const QVector<double> &pattern);
++ QVector<qreal> dashPattern() const;
++ void setDashPattern(const QVector<qreal> &pattern);
+ qreal miterLimit() const;
+ void setMiterLimit(qreal limit);
+ bool operator==(const QPen &p) const;
+--- a/sip/QtGui/qtextoption.sip
++++ b/sip/QtGui/qtextoption.sip
+@@ -64,7 +64,7 @@
+ QFlags<QTextOption::Flag> flags() const;
+ qreal tabStop() const;
+ void setTabArray(const QList<qreal> &tabStops);
+- QList<double> tabArray() const;
++ QList<qreal> tabArray() const;
+ void setUseDesignMetrics(bool b);
+ bool useDesignMetrics() const;
+ void setAlignment(Qt::Alignment aalignment);
Modified: packages/pyqt5/trunk/debian/patches/series
===================================================================
--- packages/pyqt5/trunk/debian/patches/series 2013-08-09 14:32:29 UTC (rev 25465)
+++ packages/pyqt5/trunk/debian/patches/series 2013-08-09 14:56:23 UTC (rev 25466)
@@ -1,2 +1,3 @@
mainloop_rename.diff
fix-example-shebang
+qreal_float_support.diff
More information about the Python-modules-commits
mailing list