[PyQt] build fails for PyQt5 v5.6 in strange way
Hans-Peter Jansen
hpj at urpla.net
Mon Jul 4 08:45:20 BST 2016
On Sonntag, 3. Juli 2016 22:27:50 Phil Thompson wrote:
> On 2 Jul 2016, at 3:58 pm, Hans-Peter Jansen <hpj at urpla.net> wrote:
> > Hello Phil,
> >
> > an attempt to update the openSUSE PyQt5 build to version 5.6 fails in some
> > strange way:
> >
> > $ python3 configure.py --verbose --confirm-license --qsci-api -u --qmake
> > /usr/lib64/qt5/bin/qmake -c -j 10 --dbus /usr/include/dbus-1.0
> > LIBDIR_QT=/usr/lib64 STRIP="" MOC=/usr/bin/moc LIBS_OPENGL="" LIBS_X11=""
> > LIBS_THREAD="" QMAKE_CFLAGS+="${CFLAGS} ${CPPFLAGS}"
> > QMAKE_CXXFLAGS+="${CXXFLAGS} ${CPPFLAGS}" QMAKE_LFLAGS+="${LDFLAGS}"
> > [...]
> > Qt v5.6.1 (Open Source) is being used.
> > The qmake executable is /usr/lib64/qt5/bin/qmake.
> > Qt is built as a shared library.
> > SIP 4.18 is being used.
> > The sip executable is /usr/bin/sip.
> > These PyQt5 modules will be built: QtCore, QtGui, QtMultimedia,
> > QtMultimediaWidgets, QtNetwork, QtOpenGL, QtPrintSupport, QtQml, QtQuick,
> > QtSql, QtSvg, QtTest, QtWebKit, QtWebKitWidgets, QtWidgets, QtXml, QtDBus,
> > _QOpenGLFunctions_2_0, _QOpenGLFunctions_2_1, _QOpenGLFunctions_4_1_Core,
> > QtSensors, QtX11Extras, QtBluetooth, QtPositioning, QtQuickWidgets,
> > QtWebSockets, QtWebChannel, QtWebEngineWidgets, QtLocation, QtNfc,
> > QtWebEngineCore.
> > The PyQt5 Python package will be installed in
> > /usr/lib64/python3.4/site-packages.
> > PyQt5 is being built with generated docstrings.
> > PyQt5 is being built with 'protected' redefined as 'public'.
> > The Designer plugin will be installed in /usr/lib64/qt5/plugins/designer.
> > The qmlscene plugin will be installed in /usr/lib64/qt5/plugins/PyQt5.
> > The QScintilla API file will be installed in
> > /usr/share/qt5/qsci/api/python. The dbus support module will be installed
> > in
> > /usr/lib/python3.4/site-packages/dbus/mainloop.
> > The PyQt5 .sip files will be installed in /usr/share/sip/PyQt5.
> > pyuic5, pyrcc5 and pylupdate5 will be installed in /usr/bin.
> > The interpreter used by pyuic5 is /usr/bin/python3.
> > Generating the C++ source for the QtCore module...
> > /usr/bin/sip -w -f -t WS_X11 -t Qt_5_6_1 -B Qt_6_0_0 -o -P -j 10 -a
> > QtCore.api -c
> > /home/hp/src/obs/home:frispete:PyQt5/python3-qt5/PyQt5_gpl-5.6/QtCore -I
> > sip -I /home/hp/src/obs/home:frispete:PyQt5/python3-qt5/PyQt5_gpl-5.6/sip
> > /home/hp/src/obs/home:frispete:PyQt5/python3-qt5/PyQt5_gpl-5.6/sip/QtCore
> > /QtCoremod.sip sip: Deprecation warning: the -T flag is ignored and
> > deprecated
> > Error: Unable to create the C++ code.
> >
> > Any idea, what's going wrong here?
> >
> > An strace revealed, that sip tries to access QtCore/sipAPIQtCore.h, but
> > QtCore is an empty directory.
>
> The -f flag to sip means the warning about the -T flag is treated as an
> error. However, from the above, I can't see how the -T flag is being set.
Ahh, the openSUSE sip module carried this patch in order to avoid churn in the
build system:
--- sipgen/main.c
+++ sipgen/main.c
@@ -78,7 +78,7 @@
kwArgs = NoKwArgs;
protHack = FALSE;
docs = FALSE;
- timestamp = TRUE;
+ timestamp = FALSE;
/* Parse the command line. */
optnr = 1;
Now, that you officially deprecated the timestamp option, and test explicitly for
truth, that patch in counteracting your endeavour. IOW, the package maintainer,
that updated to sip 4.18 didn't hear the bells ringing...
Fixed, thanks.
While at it, there's another issue related to the PyQt5 dbus module:
$ pkg-config --cflags-only-I --libs dbus-1
-I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -ldbus-1
In order to build this module successfully, both includes must be provided, but
the auto detection code reduces this list to the first include, resulting in a
build failure.
Here's a minimum invasive patch, that I've applied. It should cover all intends
without suffering from the mentioned issue:
--- PyQt5_gpl-5.6/configure.py.orig 2016-04-24 12:55:08.000000000 +0200
+++ PyQt5_gpl-5.6/configure.py 2016-07-04 09:05:08.656670560 +0200
@@ -2131,22 +2131,15 @@ def check_dbus(target_config, verbose):
target_config.pydbus_module_dir = dbus.mainloop.__path__[0]
- # Try and find dbus-python.h. We don't use pkg-config because it is broken
+ # Try and find dbus-python.h. We don't rely on pkg-config because it is broken
# for dbus-python (at least for versions up to and including v0.81.0).
# Instead we look where DBus itself is installed - which in most cases will
# be where dbus-python is also installed.
if target_config.pydbus_inc_dir != '':
- dlist = [target_config.pydbus_inc_dir]
- else:
- dlist = target_config.dbus_inc_dirs
-
- target_config.dbus_inc_dirs = []
+ target_config.dbus_inc_dirs.append(target_config.pydbus_inc_dir)
- for d in dlist:
+ for d in target_config.dbus_inc_dirs:
if os.access(os.path.join(d, 'dbus', 'dbus-python.h'), os.F_OK):
- if d not in target_config.dbus_inc_dirs:
- target_config.dbus_inc_dirs.append(d)
-
break
else:
inform(
Pete
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pyqt5-fix-dbus-config.diff
Type: text/x-patch
Size: 1202 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20160704/91a872b7/attachment.bin>
More information about the PyQt
mailing list