[PyQt] PyQt4 fails to build dbus.mainloop.qt extension with Python 3

Phil Thompson phil at riverbankcomputing.com
Fri Jan 27 10:42:04 GMT 2012


On Fri, 27 Jan 2012 07:38:49 +0100, Arfrever Frehtes Taifersar Arahesis
<arfrever.fta at gmail.com> wrote:
> dbus-python-1.0.0 was released on 2012-01-24 and introduced support for
> Python 3.
> 
> configure.py of PyQt4 needs to be fixed.
> iflags is b'-I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include 
> -ldbus-1 -lpthread -lrt'
> str(iflags) is "b'-I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include 
> -ldbus-1 -lpthread -lrt'"
> str(iflags).split() is ["b'-I/usr/include/dbus-1.0",
> '-I/usr/lib64/dbus-1.0/include', '-ldbus-1', '-lpthread', "-lrt'"]
> 
> --- configure.py
> +++ configure.py
> @@ -1377,8 +1377,10 @@
>          sipconfig.inform("DBus v1 does not seem to be installed.")
>          return
>  
> -    # Using str() means it will work with both Python v2 and v3.
> -    for f in str(iflags).split():
> +    if sys.hexversion >= 0x03000000:
> +        iflags = iflags.decode()
> +
> +    for f in iflags.split():
>          if f.startswith("-I"):
>              dbusincdirs.append(f[2:])
>          elif f.startswith("-L"):
> 
> The following errors occur during compilation:
> 
> x86_64-pc-linux-gnu-g++ -c -march=native -O2 -fPIC -Wall -W -D_REENTRANT
> -DNDEBUG -DQT_NO_DEBUG -DQT_CORE_LIB -I. -I/usr/include/dbus-1.0
> -I/usr/lib64/dbus-1.0/include -I/usr/include/python3.2
> -I/usr/mkspecs/linux-g++ -I/usr/include/qt4/QtCore -I/usr/include/qt4 -o
> dbus.o dbus.cpp
> dbus.cpp: In function ‘dbus_bool_t add_watch(DBusWatch*, void*)’:
> dbus.cpp:39:14: warning: ‘int dbus_watch_get_fd(DBusWatch*)’ is
deprecated
> (declared at /usr/include/dbus-1.0/dbus/dbus-connection.h:450)
> dbus.cpp:39:37: warning: ‘int dbus_watch_get_fd(DBusWatch*)’ is
deprecated
> (declared at /usr/include/dbus-1.0/dbus/dbus-connection.h:450)
> dbus.cpp: In function ‘void remove_watch(DBusWatch*, void*)’:
> dbus.cpp:72:14: warning: ‘int dbus_watch_get_fd(DBusWatch*)’ is
deprecated
> (declared at /usr/include/dbus-1.0/dbus/dbus-connection.h:450)
> dbus.cpp:72:37: warning: ‘int dbus_watch_get_fd(DBusWatch*)’ is
deprecated
> (declared at /usr/include/dbus-1.0/dbus/dbus-connection.h:450)
> dbus.cpp: In function ‘void toggle_watch(DBusWatch*, void*)’:
> dbus.cpp:104:14: warning: ‘int dbus_watch_get_fd(DBusWatch*)’ is
> deprecated (declared at
/usr/include/dbus-1.0/dbus/dbus-connection.h:450)
> dbus.cpp:104:37: warning: ‘int dbus_watch_get_fd(DBusWatch*)’ is
> deprecated (declared at
/usr/include/dbus-1.0/dbus/dbus-connection.h:450)
> dbus.cpp: In function ‘PyObject* DBusQtMainLoop(PyObject*, PyObject*,
> PyObject*)’:
> dbus.cpp:344:51: warning: deprecated conversion from string constant to
> ‘char*’
> dbus.cpp: In function ‘PyObject* initqt()’:
> dbus.cpp:399:9: error: return-statement with no value, in function
> returning ‘PyObject*’
> dbus.cpp:401:41: error: ‘Py_InitModule’ was not declared in this scope
> dbus.cpp:402:1: warning: no return statement in function returning
non-void
> make[1]: *** [dbus.o] Error 1

Try tonight's PyQt snapshot - completely untested.

Phil


More information about the PyQt mailing list