Bug 306261 - current phonon from git breaks phonon module in PyQt4
Summary: current phonon from git breaks phonon module in PyQt4
Status: CONFIRMED
Alias: None
Product: Phonon
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 4.7.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Harald Sitter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-04 18:54 UTC by Franz Trischberger
Modified: 2021-03-09 22:37 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
inject phonon include dirs from 'pkg-config --cflags-only-I phonon' output (1.49 KB, patch)
2013-11-14 20:26 UTC, Rex Dieter
Details
another try to inject 'pkg-config --cflags-only-I phonon' flags (1.59 KB, patch)
2013-11-14 22:02 UTC, Rex Dieter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Franz Trischberger 2012-09-04 18:54:22 UTC
videowidget.h includes <QWidget>, phonon-4.6.0 included <QtGui/QWidget>. As configure.py in PyQt4 seems to not add includes/qt4/QtGui to the includedirs this breaks detection of phonon, hence will never build the python module.
Downstream report:
https://bugs.gentoo.org/show_bug.cgi?id=433944

Reproducible: Always
Comment 1 Franz Trischberger 2012-09-29 07:00:37 UTC
Any progress here?
Re-Assigning to "kde-bindings" is IMHO useless, as PyQt4 is no kde-product. They stick to phonon supplied with Qt, and there is the #include <QtGui/QWidget>:
http://qt.gitorious.org/qt/qt/blobs/4.8/src/3rdparty/phonon/phonon/videowidget.h

Even in the qtphonon-repo (Qt5) there is no plain "#include <QWidget>" but <QtWidgets/QWidget>:
http://qt.gitorious.org/qt/qtphonon/blobs/master/src/3rdparty/phonon/phonon/videowidget.h

Nevertheless, as mentioned in the gentoo-bug, the mediaobject.sip shipped with PyKDE4 is completely outdated (or buggy) - e.g. it does not contain a MediaObject-constructor. This should be fixed nevertheless. But this won't fix building of PyQt4.

And grepping through the phonon-sources (kde), there are many includes in the style of <QtModule/header>.
If you want I can create a patch that changes all includes, so that PyQt4 finally builds phonon, again.
Comment 2 Franz Trischberger 2013-01-02 13:48:35 UTC
I asked Phil Thompson (PyQt4 developer) and I got a quite clear answer:

Sorry but KDE's phonon isn't supported by PyQt so I'm not going to
implement workarounds for problems with it.
Comment 3 Raphael Kubo da Costa 2013-11-12 19:05:41 UTC
This is more of a Phonon problem than a kdebindings one, even though I'm not sure there's much the Phonon team can do since commit b51f5bf2 seems to be needed for the Qt5 support.

It's sad that PyQt is consciously only supporting an ancient version of Phonon, though.

On FreeBSD, instead of adding QtGui to PyQt's path when building the Phonon program, I've instead used a different header that has compatible includes in it.
Comment 4 Harald Sitter 2013-11-12 23:26:08 UTC
How is it a phonon problem that pyqt doesn't manage to add the qtgui includes when including a qwidget derivate? Oo
Comment 5 Rex Dieter 2013-11-14 20:26:00 UTC
Created attachment 83567 [details]
inject phonon include dirs from 'pkg-config --cflags-only-I phonon' output

Here's a quick-n-dirty patch I came up with to inject extra phonon-related includes in configure.py.  I borrowed from the dbusincdirs code in configure.py, though likely there are cleaner/easier ways to do it.
Comment 6 Rex Dieter 2013-11-14 22:02:49 UTC
Created attachment 83570 [details]
another try to inject 'pkg-config --cflags-only-I phonon' flags

This version is python3 friendly
Comment 7 Luca Beltrame 2013-11-14 22:39:02 UTC
The logic looks fine, although indeed there might be a better way to get these includes.
Comment 8 Raphael Kubo da Costa 2013-11-21 15:22:14 UTC
If the idea is to patch PyQt itself, something like this is less intrusive:

@@ -371,8 +371,8 @@
         check_module("QtTest", "QtTest", "QTest::qSleep(0)")
         check_module("QtWebKit", "qwebpage.h", "new QWebPage()")
         check_module("QtXmlPatterns", "qxmlname.h", "new QXmlName()")
-        check_module("phonon", "phonon/videowidget.h",
-                "new Phonon::VideoWidget()")
+        check_module("phonon", "phonon/mediacontroller.h",
+                "new Phonon::MediaController(0)")
         check_module("QtAssistant", "qassistantclient.h",
                 "new QAssistantClient(\"foo\")", extra_lib_dirs=ass_lib_dirs,
                 extra_libs=ass_libs)
Comment 9 Hrvoje Senjan 2013-11-21 15:28:21 UTC
We have this now in openSUSE:

@@ -1278,6 +1278,8 @@ def compile_qt_program(name, mname, extr
     qt = [mname]
     if mname in ("QtAssistant", "QtHelp", "QtOpenGL", "QtWebKit"):
         qt.append("QtCore")
+    if mname in ("phonon"):
+        qt.append("QtGui")
Comment 10 Rex Dieter 2013-11-21 15:38:34 UTC
could have sworn I'd tried that approach (in comment #9), but must've done it wrong.  I concur it is a better and simpler way to solve the problem.
Comment 11 Justin Zobel 2021-03-09 22:37:01 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.