[PyQt] Build issues with sipconfiq
Phil Thompson
phil at riverbankcomputing.com
Fri Sep 13 15:57:35 BST 2019
On 13/09/2019 13:51, Hans-Peter Jansen wrote:
> Am Donnerstag, 12. September 2019, 17:49:31 CEST schrieb Hans-Peter
> Jansen:
>>
>> The build fails, because sipconfig doesn't expand some macros anymore,
>> but
>> nothing changed with sip and PyQt5 meanwhile (well, Qt was updated to
>> 5.13.1):
>
> Well, I not sure anymore, that this isn't related to some sip/PyQt5
> upgrade.
>
> What's for sure, that sipconfig.SIPModuleMakefile fails to properly
> expand
> $$[QT_INSTALL_LIBS]. Question is, where this came from in the first
> place.
>
> Except from the generated Makefile:
>
> LIBS = -L/home/abuild/rpmbuild/BUILD/PyQxtGlobalShortcut-0.2.3/build/
> temp.linux-x86_64-2.7 -L/usr/lib64 -L/usr/X11R6/lib -lQxtGlobalShortcut
> -
> lpython2.7 -lQt5Core -L$$[QT_INSTALL_LIBS] -lpthread -lQt5Gui -L$$
> [QT_INSTALL_LIBS] $$[QT_INSTALL_LIBS]/libQt5Core.so -lpthread
> -lQt5Widgets -
> lQt5PrintSupport -lXext -lX11 -lm -lpthread
>
> Interestingly, Qt5Core is there already, but then it's appearing again
> within
> the unexpanded macros, while the other Qt5 libraries arguments are
> dealt with
> just fine.
>
> sipconfig.Configuration is called with a config dict containing:
>
> [ 13s] cfg:
> [ 13s] {'pyqt_sip_dir': '/usr/share/sip/PyQt5',
> [ 13s] 'pyqt_sip_flags': '-n PyQt5.sip -t WS_X11 -t Qt_5_13_0',
> [ 13s] 'qt_data_dir': '/usr/share/qt5',
> [ 13s] 'qt_dir': '/usr',
> [ 13s] 'qt_edition': 'free',
> [ 13s] 'qt_framework': 0,
> [ 13s] 'qt_inc_dir': '/usr/include/qt5',
> [ 13s] 'qt_lib_dir': '/usr/lib64',
> [ 13s] 'qt_threaded': 1,
> [ 13s] 'qt_version': 331009,
> [ 13s] 'qt_winconfig': 'shared'}
>
> which looks like all properties are set up correctly.
>
> The QT_INSTALL_LIBS macro seems to stem from a qmake property:
>
> [ 13s] qmake_props:
> [...]
> [ 13s] 'QT_INSTALL_LIBS': '/usr/lib64',
>
> so it must be crept in somewhere internal to sipconfig.
>
> With this hack appended:
>
> with open('Makefile', 'r+') as fd:
> mf = fd.read()
> newmf = mf.replace('-L$$[QT_INSTALL_LIBS] ', '')
> newmf = newmf.replace('$$[QT_INSTALL_LIBS]/libQt5Core.so ', '')
> if mf != newmf:
> fd.seek(0)
> fd.write(newmf)
>
> to the configure script:
>
> https://github.com/frispete/PyQxtGlobalShortcut/blob/master/pyqxtgs/
> configure.py
>
> the build succeeds again. Hence, it looks like a sipconfig regression
> of some
> kind.
>
> The fixed linking command is now:
>
> g++ -shared -Wl,--version-script=QxtGlobalShortcut.exp -o
> QxtGlobalShortcut.so
> sipQxtGlobalShortcutcmodule.o sipQxtGlobalShortcutQxtGlobalShortcut.o
> -L/home/
> abuild/rpmbuild/BUILD/PyQxtGlobalShortcut-0.2.3/build/temp.linux-x86_64-3.7
> -
> L/usr/lib64 -L/usr/X11R6/lib -lQxtGlobalShortcut -lpython3.7m -lQt5Core
> -
> lpthread -lQt5Gui -lpthread -lQt5Widgets -lQt5PrintSupport -lXext -lX11
> -lm -
> lpthread
>
> Apart from repeated -lpthread arguments, it's looking sane again, and
> working
> fine.
>
> It would be nice to locate and fix the source of this issue properly in
> order
> to dispense with such gross hacks, wouldn't it?
sipconfig has long been deprecated and has never been used with PyQt5.
Sorry but this is a "won't fix".
Phil
More information about the PyQt
mailing list