Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Aug 2007 18:04:57 GMT
From:      Scot Hetzel <swhetzel@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/115426: x11-toolkits/py-kde: Fails to build with Python 2.5
Message-ID:  <200708111804.l7BI4vlj027448@www.freebsd.org>
Resent-Message-ID: <200708111810.l7BIA130019280@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         115426
>Category:       ports
>Synopsis:       x11-toolkits/py-kde: Fails to build with Python 2.5
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug 11 18:10:00 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Scot Hetzel
>Release:        7.0-CURRENT
>Organization:
>Environment:
FreeBSD hp010 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Wed Aug  8 10:38:34 CDT 2007     root@hp010:/usr/src/7x/sys/amd64/compile/GENERIC.debug  amd64

>Description:
Python 2.5 changed several of its functions from using an int to Ps_ssize_t, this causes the py-kde port to fail with the recent change to having Python 2.5 being the default Python.
>How-To-Repeat:
Install Python 2.5, and then try to build x11-toolkits/py-kde:

cd /usr/ports/x11-toolkits/py-kde
make build
:
sip/kdecore/ktimezones.sip:217: note: 'binst' was declared here
c++ -c -Wno-deprecated-declarations -pipe -fPIC -O1 -pipe -Wall -W -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -I. -I../extra/kde353 -I/usr/local/include -I/usr/local/include/python2.5 -I/usr/local/mkspecs/freebsd-g++ -o sipkdecorepart1.o sipkdecorepart1.cpp
sipkdecorepart1.cpp: In function 'void release_Display(void*, int)':
sipkdecorepart1.cpp:8917: warning: possible problem detected in invocation of delete operator:
sipkdecorepart1.cpp:8917: warning: invalid use of incomplete type 'struct _XDisplay'
/usr/local/include/qwindowdefs.h:141: warning: forward declaration of 'struct _XDisplay'
sipkdecorepart1.cpp:8917: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined.
sipkdecorepart1.cpp: At global scope:
sipkdecorepart1.cpp:8923: warning: unused parameter 'sipPy'
sipkdecorepart1.cpp:8923: warning: unused parameter 'sipIsErr'
sipkdecorepart1.cpp: In function 'PyObject* convertFrom_Display(void*, PyObject*)':
sipkdecorepart1.cpp:8964: warning: unused variable 'sipCpp'
sipkdecorepart1.cpp: At global scope:
sipkdecorepart1.cpp:13779: warning: overflow in implicit constant conversion
sip/kdecore/kurl.sip: In function 'PyObject* slot_KURL_List___getitem__(PyObject*, PyObject*)':
sip/kdecore/kurl.sip:329: error: cannot convert 'int*' to 'Py_ssize_t*' for argument '3' to 'int PySlice_GetIndicesEx(PySliceObject*, Py_ssize_t, Py_ssize_t*, Py_ssize_t*, Py_ssize_t*, Py_ssize_t*)'
sip/kdecore/kurl.sip: In function 'int slot_KURL_List___delitem__(PyObject*, PyObject*)':
sip/kdecore/kurl.sip:297: error: cannot convert 'int*' to 'Py_ssize_t*' for argument '3' to 'int PySlice_GetIndicesEx(PySliceObject*, Py_ssize_t, Py_ssize_t*, Py_ssize_t*, Py_ssize_t*, Py_ssize_t*)'
sip/kdecore/kurl.sip: In function 'int slot_KURL_List___setitem__(PyObject*, PyObject*)':
sip/kdecore/kurl.sip:255: error: cannot convert 'int*' to 'Py_ssize_t*' for argument '3' to 'int PySlice_GetIndicesEx(PySliceObject*, Py_ssize_t, Py_ssize_t*, Py_ssize_t*, Py_ssize_t*, Py_ssize_t*)'
*** Error code 1

Stop in /usr/obj/usr/ports/x11-toolkits/py-kde/work/PyKDE-3.16.0/kdecore.
*** Error code 1

Stop in /usr/obj/usr/ports/x11-toolkits/py-kde/work/PyKDE-3.16.0.
*** Error code 1

Stop in /usr/ports/x11-toolkits/py-kde.
*** Error code 1

Stop in /usr/ports/x11-toolkits/py-kde.

>Fix:
Create the x11-toolkits/py-kde/files directory, then apply the attached patch:

Changed files:
  Makefile

New files:
  files/patch-sip::kio::kimetype.sip
  files/patch-sip::kdecore::kurl.sip


Patch attached with submission follows:

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/x11-toolkits/py-kde/Makefile,v
retrieving revision 1.45
diff -u -r1.45 Makefile
--- Makefile	19 May 2007 20:31:48 -0000	1.45
+++ Makefile	10 Aug 2007 15:04:06 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	kde
 PORTVERSION=	3.16.0
-PORTREVISION=	3
+PORTREVISION=	4
 PORTEPOCH=	1
 CATEGORIES=	x11-toolkits python kde
 MASTER_SITES=	http://www.riverbankcomputing.com/Downloads/PyKDE3/ \
@@ -69,9 +69,28 @@
 ARGS+=		-r
 .endif
 
+# files that need to change 'int' to SIP_SSIZE_T
+PYKDE_FILES=	sip/kdecore/bytearray.sip \
+		sip/kdecore/kaccel.sip \
+		sip/kdecore/kcompletion.sip \
+		sip/kdecore/kconfigdata.sip \
+		sip/kdecore/kconfig.sip \
+		sip/kdecore/kmacroexpander.sip \
+		sip/kdecore/ktimezones.sip \
+		sip/kdecore/kurl.sip \
+		sip/kdeui/kkeydialog.sip \
+		sip/kio/authinfo.sip \
+		sip/kio/global.sip \
+		sip/kio/kservicetype.sip \
+		sip/kmdi/kmdichildfrm.sip \
+		sip/kparts/browserextension.sip
+
 post-patch:
 	@${REINPLACE_CMD} -e 's|/usr/bin/python|${SETENV} python|' \
 		${WRKSRC}/postproc
+.for PYKDE_FILE in ${PYKDE_FILES}
+	@${REINPLACE_CMD} -e 's|int pos =|SIP_SSIZE_T pos =|g' ${WRKSRC}/${PYKDE_FILE}
+.endfor
 
 do-configure:
 	( cd ${WRKSRC} && ${PYTHON_CMD} configure.py ${ARGS} )
Index: files/patch-sip::kdecore::kurl.sip
===================================================================
RCS file: files/patch-sip::kdecore::kurl.sip
diff -N files/patch-sip::kdecore::kurl.sip
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-sip::kdecore::kurl.sip	10 Aug 2007 14:46:15 -0000
@@ -0,0 +1,29 @@
+--- sip/kdecore/kurl.sip-orig	2007-08-10 09:21:10.913826375 -0500
++++ sip/kdecore/kurl.sip	2007-08-10 09:22:48.753409478 -0500
+@@ -248,7 +248,7 @@
+ %MethodCode
+ //takes range | (a Python slice) | urlList | (KURL.List)
+ 
+-    int len, start, stop, step, slicelength;
++    SIP_SSIZE_T len, start, stop, step, slicelength;
+ 
+     len = sipCpp -> count();
+ 
+@@ -291,7 +291,7 @@
+         void                 __delitem__ (SIP_PYSLICE);
+ %MethodCode
+ //takes range | (a Python slice)
+-    int len, start, stop, step, slicelength;
++    SIP_SSIZE_T len, start, stop, step, slicelength;
+ 
+     len = sipCpp -> count();
+     if (sipConvertFromSliceObject(a0,len,&start,&stop,&step,&slicelength) < 0)
+@@ -322,7 +322,7 @@
+ %MethodCode
+ //returns (KURL.List)
+ //takes range | (a Python slice)
+-    int len, start, stop, step, slicelength;
++    SIP_SSIZE_T len, start, stop, step, slicelength;
+ 
+     len = sipCpp -> count();
+ 
Index: files/patch-sip::kio::kimetype.sip
===================================================================
RCS file: files/patch-sip::kio::kimetype.sip
diff -N files/patch-sip::kio::kimetype.sip
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-sip::kio::kimetype.sip	10 Aug 2007 07:06:59 -0000
@@ -0,0 +1,11 @@
+--- sip/kio/kmimetype.sip-orig	2006-09-22 18:41:53.000000000 +0530
++++ sip/kio/kmimetype.sip	2006-11-06 05:27:39.000000000 +0530
+@@ -101,7 +101,7 @@
+ %If ( KDE_3_2_0 -  )
+     static KMimeType::Ptr defaultMimeTypePtr ();
+     QString              parentMimeType () const;
+-    bool                 is (const QString&) const;
++    bool                 is (const QString&) const /PyName=is_/; //'is' is a reserved keyword in python
+     static KMimeType::Ptr diagnoseFileName (const QString&, QString&);
+ %End
+ 


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708111804.l7BI4vlj027448>