Bug 327633

Summary: PyKDE4 doesn't build if PyQt4 is configured with configure-ng.py
Product: [Unmaintained] bindings Reporter: Joe Mulloy <jdmulloy>
Component: pykdeAssignee: Raphael Kubo da Costa <rakuco>
Status: RESOLVED FIXED    
Severity: normal CC: hrvoje.senjan, rakuco, scarpino
Priority: NOR    
Version: 4.11.2   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 4.14.0
Sentry Crash Report:

Description Joe Mulloy 2013-11-15 03:23:03 UTC
PyQt4 has switched to a new build system that no longer produces the PyQt4.pyqtconfig module, so if PyQt4 is configured with the new configure script, configure-ng.py, PyKDE can not be built as this module does not exist. At the moment the old build system is still supported but it has issues and it will eventually be replaced.

http://pyqt.sourceforge.net/Docs/PyQt4/installation.html#configuring-pyqt4

"Note that the pyqtconfig module is only created if you use configure.py and not if you use configure-ng.py." - http://pyqt.sourceforge.net/Docs/PyQt4/build_system.html

Reproducible: Always
Comment 1 Hrvoje Senjan 2013-11-16 01:04:31 UTC
I guess an excerpt from fail log would be helpful ;-)
Comment 2 Andrea Scarpino 2014-07-15 11:03:04 UTC
The issue is in /usr/share/apps/cmake/modules/FindPyQt.py (ship by kdelibs) which uses PyQt4.pyqtconfig.
Comment 3 Andrea Scarpino 2014-07-15 11:21:22 UTC
pykdeconfig.py.in references pyqtconfig too, so it has to be migrated to PyQt4.QtCore too.
Comment 4 Andrea Scarpino 2014-07-15 11:25:19 UTC
I reported the kdelibs BUG#337462
Comment 5 Raphael Kubo da Costa 2014-07-24 11:40:56 UTC
Finding PyQt itself when pyqtconfig is not present has been solved in bug 337462 as Andrea mentioned.

Fixing PyKDE itself involves making it behave similarly to PyQt and only install pykdeconfig it pyqtconfig exists, and then fixing FindPyKDE4.cmake to handle the case of pykdeconfig not existing. I've submitted https://git.reviewboard.kde.org/r/119453/ and https://git.reviewboard.kde.org/r/119454/ to handle the kdebindings and the kdelibs sides, respectively.
Comment 6 Raphael Kubo da Costa 2014-07-29 17:07:12 UTC
Git commit 0459dba097bcdc4ab08bd1b0b6de985693b228c4 by Raphael Kubo da Costa.
Committed on 19/07/2014 at 18:08.
Pushed by rkcosta into branch 'KDE/4.14'.

Support PyQt installations without pyqtconfig.py.

PyQt's pyqtconfig was deprecated in version 4.10, and is not installed
if PyQt's new build system is used.

PyKDE itself provides a pykdeconfig module that inherits from pyqtconfig
and allows users of the SIP build system to obtain information about how
PyKDE was configured and generate Makefiles from it. It is also used by
kdelibs's FindPyKDE4.cmake for the same purposes.

Even though the information provided by PyKDE exists regardless of
pyqtconfig, insisting on pykdeconfig goes against the design of PyQt's
new build system.

Instead, we now do something similar to PyQt itself: while it provides a
PYQT_CONFIGURATION dict with (at the moment) a single key with the SIP
flags used to build PyQt, we provide PyKDE4.kdecore.PYKDE_CONFIGURATION,
a dict containing the SIP flags used to build PyKDE and, in addition to
that, the directory where PyKDE's SIP files have been installed. This
new dict exists regardless of how PyQt was built.

Finally, this commit does not remove pykdeconfig.py, but rather makes
its installation depend on whether pyqtconfig.py has been found at
configuration time.
REVIEW: 119453

M  +14   -47   CMakeLists.txt
A  +57   -0    PyKDEConfigurationInformation.cmake
M  +3    -0    sip/kdecore/kdecoremod.sip
A  +56   -0    sip/kdecore/pykde_config.sip.in

http://commits.kde.org/pykde4/0459dba097bcdc4ab08bd1b0b6de985693b228c4
Comment 7 Raphael Kubo da Costa 2014-07-29 17:10:02 UTC
Git commit 4d29cf84de2f914c401fc41bcbea3ba7628abd1f by Raphael Kubo da Costa.
Committed on 29/07/2014 at 17:09.
Pushed by rkcosta into branch 'KDE/4.14'.

Make FindPyKDE4 work with PyQt's new build system.

Since PyQt 4.10, PyQt.pyqtconfig is deprecated and not available unless
PyQt is built using the old configure script.

PyKDE4 itself has recently been adjusted to mimic PyQt itself and only
install its pykdeconfig module if pyqtconfig is present. Additionally,
information such as SIP flags and the directory where PyKDE's SIP files
are installed are now also provided in the
PyKDE4.kdecore.PYKDE_CONFIGURATION dict.

This commit completely rewrites FindPyKDE4.py to make it look like
FindPyQt.cmake after commit a7e4743: most of the information used by
FindPyKDE4.cmake is fetched from PyKDE4.kdecore, and we first try to
obtain the SIP flags and directory from pykdeconfig and, if it fails, we
use PYKDE_CONFIGURATION.

Furthermore, FindPyKDE4.py now only prints the variables that are
actually consumed by FindPyKDE4.cmake -- it is not possible to obtain
all the data provided by pykdeconfig in PYKDE_CONFIGURATION. We've also
stopped reading and setting PYKDE4_VERSION_TAG, since PyKDE4 stopped
setting a KDE tag in 2008 (and its value was 3_92_0 at the time).
REVIEW: 119454

M  +0    -1    cmake/modules/FindPyKDE4.cmake
M  +19   -43   cmake/modules/FindPyKDE4.py

http://commits.kde.org/kdelibs/4d29cf84de2f914c401fc41bcbea3ba7628abd1f