[PyQt] Having multiple SIP installations

Kovid Goyal kovid at kovidgoyal.net
Fri Apr 11 05:20:47 BST 2014


Hi Phil,

I have been investigating porting calibre to PyQt5/Qt5 and in order to
do that I needed to have a custom PyQt5/SIP build on my system alongside
the distribution provided one.

My requirements are that I need to use:
1) The system python interpreter
2) A custom compiled Qt5, SIP and PyQt5. The custom SIP version is
different from the system SIP version.

The problem is that the configure script for PyQt5 places the python
include dir before the sip include dir which causes the system sip.h to
be used, breaking the build. The relevant lines in configure.py are

    if target_config.py_inc_dir != target_config.sip_inc_dir:
        pro_lines.append('INCLUDEPATH += %s' % target_config.sip_inc_dir)

I can obviously patch it myself to do what I need, but I think it should
be changed to place the sip include dir before the python include dir,
if they differ. So the lines should be:

    if target_config.py_inc_dir != target_config.sip_inc_dir:
        pro_lines.insert(len(pro_lines)-1, 'INCLUDEPATH += %s' % target_config.sip_inc_dir)

As far as I can see, this is the only way to build PyQt5 successfully
using the system python interpreter and a custom SIP, when the custom
SIP and the system SIP are of different versions.

There may of course be other side effects that I do not realize.

Thanks,

Kovid.

-- 
_____________________________________

Dr. Kovid Goyal 
http://www.kovidgoyal.net
http://calibre-ebook.com
_____________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140411/5d031caf/attachment.pgp>


More information about the PyQt mailing list