[PyQt] sip snapshot problem with PyQwt

Hans-Peter Jansen hpj at urpla.net
Wed Nov 17 13:19:38 GMT 2010


On Monday 15 November 2010, 10:57:44 Phil Thompson wrote:
> On Mon, 15 Nov 2010 01:27:34 +0100, "Hans-Peter Jansen"
> <hpj at urpla.net>
>
> wrote:
> > On Sunday 14 November 2010, 13:13:55 Phil Thompson wrote:
> >> On Sun, 14 Nov 2010 00:33:38 +0100, "Hans-Peter Jansen"
> >> <hpj at urpla.net>
> >>
> >> wrote:
> >> > Hi Phil, hi Gerard,
> >> >
> >> > in an attempt to build PyQwt with the current sip snapshot
> >>
> >> (c38668e9dd93),
> >>
> >> > sip fails with a strange error:
> >> >
> >> > /usr/bin/sip -I /usr/share/sip/PyQt4 -b tmp-qwt5qt4/qwt5qt4.sbf
> >> > -c tmp-qwt5qt4
> >> >  -x VendorID -t WS_X11 -x PyQt_NoPrintRangeBug -t Qt_4_7_1 -x
> >> > Py_v3 -g -x HAS_PYQT_031105 -x HAS_QWT4 -x HAS_QWT_SVG -t
> >> > Qwt_5_2_0 ../sip/qwt5qt4/QwtModule.sip
> >> > sip: No %Module has been specified for module defined in
> >> > /usr/share/sip/PyQt4/QtSvg/QtSvgmod.sip
> >> > SIP failed to generate the C++ code.
> >> >
> >> > The PyQwt package is also a snapshot build, all files are
> >> > available
> >>
> >> here:
> >>
> >>
> >> https://build.opensuse.org/package/files?package=python-qwt5&proje
> >>ct= home%3Afrispete%3APyQt-next
> >>
> >> > The sip files (from PyQt-x11-gpl-snapshot-4.8.2-634f8a2612bf)
> >> > are installed
> >> > properly and /usr/share/sip/PyQt4/QtSvg/QtSvgmod.sip looks fine
> >> > to my untrained eye:
> >> >
> >> > cat /usr/share/sip/PyQt4/QtSvg/QtSvgmod.sip
> >> > // QtSvgmod.sip generated by MetaSIP on Thu Nov 11 03:43:29 2010
> >> > //
> >> > // This file is part of the QtSvg Python extension module.
> >> > //
> >> > // Copyright (c) 2010 Riverbank Computing Limited
> >> > <info at riverbankcomputing.com>
> >> > //
> >> > // This file is part of PyQt.
> >> > //
> >> > // This file may be used under the terms of the GNU General
> >> > Public // License versions 2.0 or 3.0 as published by the Free
> >> > Software // Foundation and appearing in the files LICENSE.GPL2
> >> > and LICENSE.GPL3 // included in the packaging of this file.
> >> > Alternatively you may (at // your option) use any later version
> >> > of the GNU General Public // License if such license has been
> >> > publicly approved by Riverbank // Computing Limited (or its
> >> > successors, if any) and the KDE Free Qt // Foundation. In
> >> > addition, as a special exception, Riverbank gives you // certain
> >> > additional rights. These rights are described in the
> >>
> >> Riverbank
> >>
> >> > // GPL Exception version 1.1, which can be found in the file
> >> > // GPL_EXCEPTION.txt in this package.
> >> > //
> >> > // Please review the following information to ensure GNU General
> >> > // Public Licensing requirements will be met:
> >> > //
> >> > http://trolltech.com/products/qt/licenses/licensing/opensource/.
> >> > If // you are unsure which license is appropriate for your use,
> >> > please // review the following information:
> >> > //
> >> > http://trolltech.com/products/qt/licenses/licensing/licensingove
> >> >rvi ew // or contact the sales department at
> >> > sales at riverbankcomputing.com. //
> >> > // This file is provided AS IS with NO WARRANTY OF ANY KIND,
> >> > INCLUDING
> >>
> >> THE
> >>
> >> > // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A
> >> > PARTICULAR PURPOSE.
> >> >
> >> >
> >> > %Module PyQt4.QtSvg 0
> >> >
> >> > %Import QtCore/QtCoremod.sip
> >> > %Import QtGui/QtGuimod.sip
> >> >
> >> > %Copying
> >> > Copyright (c) 2010 Riverbank Computing Limited
> >> > <info at riverbankcomputing.com>
> >> >
> >> > This file is part of PyQt.
> >> >
> >> > This file may be used under the terms of the GNU General Public
> >> > License versions 2.0 or 3.0 as published by the Free Software
> >> > Foundation and appearing in the files LICENSE.GPL2 and
> >> > LICENSE.GPL3 included in the packaging of this file. 
> >> > Alternatively you may (at your option) use any later version of
> >> > the GNU General Public License if such license has been publicly
> >> > approved by Riverbank Computing Limited (or its successors, if
> >> > any) and the KDE Free Qt Foundation. In addition, as a special
> >> > exception, Riverbank gives you certain additional rights. These
> >> > rights are described in the Riverbank GPL Exception version 1.1,
> >> > which can be found in the file GPL_EXCEPTION.txt in this
> >> > package.
> >> >
> >> > Please review the following information to ensure GNU General
> >> > Public Licensing requirements will be met:
> >> > http://trolltech.com/products/qt/licenses/licensing/opensource/.
> >> > If you are unsure which license is appropriate for your use,
> >> > please review the following information:
> >> > http://trolltech.com/products/qt/licenses/licensing/licensingove
> >> >rvi ew or contact the sales department at
> >> > sales at riverbankcomputing.com.
> >> >
> >> > This file is provided AS IS with NO WARRANTY OF ANY KIND,
> >> > INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
> >> > FOR A PARTICULAR
> >>
> >> PURPOSE.
> >>
> >> > %End
> >> >
> >> > %DefaultSupertype sip.simplewrapper
> >> >
> >> > %Include qgraphicssvgitem.sip
> >> > %Include qsvggenerator.sip
> >> > %Include qsvgrenderer.sip
> >> > %Include qsvgwidget.sip
> >> >
> >> >
> >> > OTOH, the rest of the project (including PyKDE4!) is building
> >> > just fine with the current sip and PyQt4 snapshots:
> >>
> >> https://build.opensuse.org/project/monitor?project=home%3Afrispete
> >>%3A PyQt-next
> >>
> >> > Do you have an idea, what's going wrong or how to debug such an
> >> > issue?
> >>
> >> There have been changes to the parsing of %Module. One change is
> >> that %Module is now affected by %If/%End. Could that be the source
> >> of the problem?
> >
> > I was able to fix a missing % from an End directive (attached), but
> > the problem persists.
> >
> > Phil, PyQwt does use "sip -x HAS_QWT_SVG" and defines
> > %If (HAS_QWT_SVG)
> > %Import QtSvg/QtSvgmod.sip
> > %End // HAS_QWT_SVG
> >
> > If I understand this correctly, this should exclude the QtSvg
> > module, but sip seems to use it anyway:
>
> %Import is not affected by %If/%End. The documentation lists those
> directives that are. I'm in the process of revising the directive
> syntax in preparation for SIP v5 and one element of that is to ensure
> that all directives respect %If/%End (so %Module now does).

Hmm, does this explain, why PyQwt builds now with this patch applied:

--- sip/qwt5qt4/QwtModule.sip.orig	2010-11-17 12:10:25.678771150 +0100
+++ sip/qwt5qt4/QwtModule.sip	2010-11-17 14:03:40.286833214 +0100
@@ -39,14 +39,10 @@
 %Feature HAS_NUMPY
 %Feature HAS_QWT5
 %Feature HAS_QWT4
-%Feature HAS_QWT_SVG
 
 
 %Import QtCore/QtCoremod.sip
 %Import QtGui/QtGuimod.sip
-%If (HAS_QWT_SVG)
-%Import QtSvg/QtSvgmod.sip
-%End // HAS_QWT_SVG
 
 
 %Include QwtTypes.sip
@@ -149,9 +145,6 @@ typedef QSizeF QwtDoubleSize;
 %Include qwt_plot_scaleitem.sip
 %End // (Qwt_5_1_0 - )
 %Include qwt_plot_spectrogram.sip
-%If (HAS_QWT_SVG)
-%Include qwt_plot_svgitem.sip
-%End // HAS_QWT_SVG
 %Include qwt_plot_zoomer.sip
 %Include qwt_raster_data.sip
 %If ( - Qwt_5_2_0)


I've checked all sips for any dangling %End directives, but cannot spot 
any more.. If I'm not mistaken, this patch forces, what -x HAS_QWT_SVG 
should have done logically. Please correct me, if I'm wrong.

Thanks,
Pete

PS.: As mentioned already, the whole build - logs, patches and all - can
     be fetched via the build service URL.


More information about the PyQt mailing list