Implement QList<long> for SunOS 32-bit pid_t. Bump PKGREVISION.diff -r1.66 -r1.67 pkgsrc/x11/py-qt4/Makefile
(jperkin)
@@ -1,18 +1,18 @@ | @@ -1,18 +1,18 @@ | |||
1 | # $NetBSD: Makefile,v 1.66 2013/06/06 12:55:20 wiz Exp $ | 1 | # $NetBSD: Makefile,v 1.67 2013/06/10 15:37:36 jperkin Exp $ | |
2 | 2 | |||
3 | PKGNAME= ${PYPKGPREFIX}-qt4-${PYQT_VERSION} | 3 | PKGNAME= ${PYPKGPREFIX}-qt4-${PYQT_VERSION} | |
4 | PYQT_VERSION= 4.10.1 | 4 | PYQT_VERSION= 4.10.1 | |
5 | PKGREVISION= 3 | 5 | PKGREVISION= 4 | |
6 | CATEGORIES= x11 python | 6 | CATEGORIES= x11 python | |
7 | #MASTER_SITES= http://www.riverbankcomputing.com/static/Downloads/PyQt4/ | 7 | #MASTER_SITES= http://www.riverbankcomputing.com/static/Downloads/PyQt4/ | |
8 | MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=pyqt/} | 8 | MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=pyqt/} | |
9 | 9 | |||
10 | MAINTAINER= pkgsrc-users@NetBSD.org | 10 | MAINTAINER= pkgsrc-users@NetBSD.org | |
11 | COMMENT= Python binding for Qt4 | 11 | COMMENT= Python binding for Qt4 | |
12 | HOMEPAGE= http://www.riverbankcomputing.com/software/pyqt/intro | 12 | HOMEPAGE= http://www.riverbankcomputing.com/software/pyqt/intro | |
13 | 13 | |||
14 | USE_LIBTOOL= yes | 14 | USE_LIBTOOL= yes | |
15 | USE_TOOLS+= gmake pkg-config | 15 | USE_TOOLS+= gmake pkg-config | |
16 | USE_LANGUAGES= c c++ | 16 | USE_LANGUAGES= c c++ | |
17 | 17 | |||
18 | CONFIGURE_ARGS+= -b ${PREFIX}/bin | 18 | CONFIGURE_ARGS+= -b ${PREFIX}/bin |
@@ -1,6 +1,7 @@ | @@ -1,6 +1,7 @@ | |||
1 | $NetBSD: distinfo,v 1.28 2013/05/03 15:48:17 drochner Exp $ | 1 | $NetBSD: distinfo,v 1.29 2013/06/10 15:37:36 jperkin Exp $ | |
2 | 2 | |||
3 | SHA1 (PyQt-x11-gpl-4.10.1.tar.gz) = c7dad20194905d22f110c7d3ab905cd25d69e887 | 3 | SHA1 (PyQt-x11-gpl-4.10.1.tar.gz) = c7dad20194905d22f110c7d3ab905cd25d69e887 | |
4 | RMD160 (PyQt-x11-gpl-4.10.1.tar.gz) = 31cbb5a59accbee5a9c4e2dc4e5b0b07a5157905 | 4 | RMD160 (PyQt-x11-gpl-4.10.1.tar.gz) = 31cbb5a59accbee5a9c4e2dc4e5b0b07a5157905 | |
5 | Size (PyQt-x11-gpl-4.10.1.tar.gz) = 11279330 bytes | 5 | Size (PyQt-x11-gpl-4.10.1.tar.gz) = 11279330 bytes | |
6 | SHA1 (patch-aa) = 726a9be11f0fa8a275daa61358557cf37a6bf531 | 6 | SHA1 (patch-aa) = 726a9be11f0fa8a275daa61358557cf37a6bf531 | |
7 | SHA1 (patch-sip_QtCore_qlist.sip) = 4fb548d4ee755cbc955ec32a6b1702a71a9815f1 |
$NetBSD: patch-sip_QtCore_qlist.sip,v 1.1 2013/06/10 15:37:36 jperkin Exp $
Implement QList<long> for SunOS 32-bit pid_t.
--- sip/QtCore/qlist.sip.orig 2013-04-21 12:02:19.000000000 +0000
+++ sip/QtCore/qlist.sip
@@ -683,6 +683,68 @@ template<qreal, TYPE>
return sipGetState(sipTransferObj);
%End
};
+// QList<long> is implemented as a Python list of integers.
+%MappedType QList<long> /DocType="list-of-long"/
+{
+%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 = SIPLong_FromLong(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<long> *ql = new QList<long>;
+ SIP_SSIZE_T len = PySequence_Size(sipPy);
+
+ for (SIP_SSIZE_T i = 0; i < len; ++i)
+ {
+ PyObject *itm = PySequence_ITEM(sipPy, i);
+
+ if (!itm)
+ {
+ delete ql;
+ *sipIsErr = 1;
+
+ return 0;
+ }
+
+ ql->append(SIPLong_AsLong(itm));
+
+ Py_DECREF(itm);
+ }
+
+ *sipCppPtr = ql;
+
+ return sipGetState(sipTransferObj);
+%End
+};
// QList<unsigned> is implemented as a Python list of unsigned longs.
%MappedType QList<unsigned> /DocType="list-of-int"/
{