[Pp]honon & QCA issue in KDE ports

Ryan Schmidt ryandesign at macports.org
Thu Aug 12 17:28:11 PDT 2010


On Aug 12, 2010, at 15:01, Michael Dickens wrote:

> I think adding a couple bits of code to the KDE group file make sense,
> and I'm wondering what others think. - MLD
> 
> (1) I've encountered 3 KDE ports now that use #include <Phonon...>
> instead of #include <phonon...>.  For those of us who use a
> case-sensitive file system, installing this port will generate an error
> since Qt 4.6.3 (and 4.7.0b's) install them as the latter.  For now, I've
> added a quick patch routine to those ports' Portfile to do a
> 'reinplace'.  A quick internet search of "#include phonon" reveals that
> both ways (P and p) are used regularly -- so, I'm tempted to add in this
> patch routine to the overall kde group.

It seems like only one of these can be correct, and any uses of the other is a fatal bug that must be reported and fixed upstream. Anything we do other than that is just a workaround.


> Right now, the patch looks
> like:
> 
> post-extract {
>    # change #include ...Phonon... to ...phonon... in all files that
>    # contain that header.
>    foreach item [exec grep -lr "Phonon" ${workpath}/${distname}] {
>        reinplace "/#include/s at Phonon@phonon@" ${item}
>    }
> }
> 
> but I know that if 'grep' finds nothing it will generate an error (which
> is undesirable); hence this patch isn't correct for -all- KDE ports,
> just those that need it.

You could suppress the error with 2>/dev/null or something.


> I can do a 'fs-traverse' but that seems
> wasteful (though it certainly would work & make for concise coding).

Why wasteful? fs-traverse is the ideal MacPorts-approved method of traversing a directory and doing something with its contents.


> (2) Along the same lines, even though the KDE group specifies (for now)
> the 'qt4-mac' Port and the specific location of 'qmake', if any other
> ports have installed themselves into the Qt4 area (e.g., QCA) then their
> info will not be picked up unless
> 
> configure.pkg_config_path-append ${qt_dir}/lib/pkgconfig
> 
> is added to the Portfile (hard-wiring the library is dangerous, since
> most can be installed as library or framework).  Seems like this line is
> generic enough to add to the KDE group file.

That sounds reasonable.



If you're looking to make improvements to the kde4 portgroup my main complaint is that it overwrites worksrcdir (which overwrites worksrcpath), yet worksrcpath's original value of ${workpath}/${distname} is often required by the portgroup and ports that use it, leading to "${workpath}/${distname}" appearing frequently. It would be more pleasing for ports to be able to use the conventional ${worksrcpath} in these cases; seems like the portgroup should be setting configure.dir and/or build.dir instead of overwriting worksrcdir.




More information about the macports-dev mailing list