[KDE/Mac] phonon vs qtmultimedia

Ian Wadham iandw.au at gmail.com
Thu Jan 15 20:23:26 UTC 2015


On 16/01/2015, at 1:07 AM, René J.V. Bertin wrote:
> On Thursday January 15 2015 14:40:25 Christoph Cullmann wrote:
>  
> >They have relative paths and no KDE application will launch without segfault,
> >because KF5Notifications will try to load lib/<somethingphonon> and fail.
>  
> You mean it does a dlopen without checking that it received a valid handle and then gets a SIGSEGV when using it??
> If so, that's a bug.
>  
> You'll need something like the following post-install to get the "rpaths" right:
>  
> install_name_tool -id ${prefix}/lib/${LPH}.4.dylib ${destroot}${prefix}/lib/${LPH}.dylib
> install_name_tool -id ${prefix}/lib/${LPH}experimental.4.dylib ${destroot}${prefix}/lib/${LPH}experimental.dylib
>  
> install_name_tool -change lib/${LPH}.4.dylib ${prefix}/lib/${LPH}.4.dylib ${destroot}${prefix}/lib/${LPH}experimental.dylib
> install_name_tool -change lib/${LPH}.4.dylib ${prefix}/lib/${LPH}.4.dylib ${destroot}${qt_plugins_dir}/designer/libphononwidgets.dylib"
> install_name_tool -id libphononwidgets.dylib ${destroot}${qt_plugins_dir}/designer/libphononwidgets.dylib

I believe that is to fix things up in Phonon *after* the build, but why does
Phonon not build right for Apple OS X and MacPorts in the first place, as
other KDE 4 packages do?  That's a rhetorical question.

When getting kdesrc-build to build KDE modules independently of MacPorts,
I found I needed, in every build, some CMake options like:

    -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
    -DCMAKE_INSTALL_RPATH=/kdedev/kde4m/kde4/lib

I think those options came from MacPorts' portgroup file for cmake.  It is
applied to every package in MacPorts that requires CMake.

The options made all modules except KDE's Phonon build, with full library
paths in all binary files and libraries, as is required on Apple OS X.  I do not
know why Phonon is the exception, but as René already said...

> I'm not sure why this isn't required on Linux, but there appears to be
> something clearly incomplete (if not wrong) here.

The following article explains the issues reasonably well, for Linux and OS X,
but becomes rather hard going after the first fifty lines or so… :-(

    http://www.cmake.org/Wiki/CMake_RPATH_handling

I do not know why Apple OS X requires full paths for libraries, but I imagine
it could be a security measure.  With relative paths, it would be easier for one
library to masquerade as another and contain a Trojan horse.  Brandon Allbery,
on the MacPorts mailing lists, is a fount of knowledge on stuff like this, as are
several others on those lists --- all of them very helpful.

Re "otool": I find it an easy command-name to remember, from the actor Peter
O'Toole.  "man otool" does the rest, whenever I need to use that command.

Cheers, Ian W.

P.S. Phonon would be a huge overkill if all it is doing is playing notification sounds.
        We certainly found that it was an overkill for KDE games --- and slow to respond
        when tenths of a second matter.  "Using cannons to shoot sparrows" comes to
        mind (a German saying, I believe).



More information about the kde-mac mailing list