[kdebindings] fix build with newer sip/PyQt

Rex Dieter rdieter at fedoraproject.org
Fri Sep 10 00:20:48 UTC 2010


commit 1641dda93d67b9c2c1ff1ec9881c9e93bf376e50
Author: Rex Dieter <rdieter at fedoraproject.org>
Date:   Thu Sep 9 19:25:28 2010 -0500

    fix build with newer sip/PyQt

 kdebindings-4.5.1-sip_api_8.patch |   65 +++++++++++++++++++++++++++++++++++++
 kdebindings.spec                  |    5 +++
 2 files changed, 70 insertions(+), 0 deletions(-)
---
diff --git a/kdebindings-4.5.1-sip_api_8.patch b/kdebindings-4.5.1-sip_api_8.patch
new file mode 100644
index 0000000..fa44602
--- /dev/null
+++ b/kdebindings-4.5.1-sip_api_8.patch
@@ -0,0 +1,65 @@
+diff -up kdebindings-4.5.1/python/pykde4/sip/kdecore/typedefs.sip.sip_api_8 kdebindings-4.5.1/python/pykde4/sip/kdecore/typedefs.sip
+--- kdebindings-4.5.1/python/pykde4/sip/kdecore/typedefs.sip.sip_api_8	2010-01-20 10:25:59.000000000 -0600
++++ kdebindings-4.5.1/python/pykde4/sip/kdecore/typedefs.sip	2010-09-09 19:20:27.502436770 -0500
+@@ -733,61 +733,6 @@ template <TYPE1,TYPE2>
+ };
+ 
+ 
+-%MappedType QList<uint>
+-{
+-%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 PY_MAJOR_VERSION >= 3
+-        if ((pobj = PyLong_FromLong(sipCpp->value(i))) == NULL) {
+-#else
+-        if ((pobj = PyInt_FromLong(sipCpp->value(i))) == NULL) {
+-#endif
+-            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 PyList_Check(sipPy);
+-
+-    QList<uint> *ql = new QList<uint>;
+- 
+-    for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) {
+-#if PY_MAJOR_VERSION >= 3
+-        ql->append(PyLong_AsLong(PyList_GET_ITEM(sipPy, i)));
+-#else
+-        ql->append(PyInt_AsLong(PyList_GET_ITEM(sipPy, i)));
+-#endif        
+-    }
+-    
+-    *sipCppPtr = ql;
+- 
+-    return sipGetState(sipTransferObj);
+-%End
+-};
+-
+-
+ template <TYPE*>
+ %MappedType QStack<TYPE*>
+ {
diff --git a/kdebindings.spec b/kdebindings.spec
index 265924a..7e5180f 100644
--- a/kdebindings.spec
+++ b/kdebindings.spec
@@ -51,6 +51,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 ## upstreamable patches
 Patch50: kdebindings-4.5.1-RUBY_VERSION.patch
+# fix build with newer sip/PyQt (borrowed from opensuse)
+Patch51: kdebindings-4.5.1-sip_api_8.patch
 
 ## upstream patches
 
@@ -260,6 +262,9 @@ Falcon plugin for the Kross archtecture in KDE4.
 %setup -q -n kdebindings-%{version}%{?alphatag}
 
 %patch50 -p1 -b .RUBY_VERSION
+%if "%{?_%{_sip_api}" >= "8.0"
+%patch51 -p1 -b .sip_api_8
+%endif
 
 
 %build


More information about the scm-commits mailing list