specifying needs for qt ports

Marcus Calhoun-Lopez mcalhoun at macports.org
Thu Sep 7 07:32:42 UTC 2017

On Wed, Sep 6, 2017 at 8:27 AM, Ken Cunningham
<ken.cunningham.webuse at gmail.com> wrote:
> Hmm. Bit confusing, and these qt PortGroups are a little thin on documentation.
You are correct.
I will attempt to improve the situation as soon as I get a little time.

> ===========
> if {${os.platform} eq "darwin" && ${os.major} < 11} {
>    default_variants-append +qt4
> }
> variant qt4 description "Enable qt4 instead of qt5" {}
> if {[variant_isset qt4]} {
>    PortGroup             qmake 1.0
> } else {
>    PortGroup             qmake5 1.0
> }
> ===============
> 1. Does that look correct and sufficient? Will it pull in every component of qt5 on each system?
This looks correct, but it may not be sufficient.
By default, only qt5*-qtbase is added as a dependency.
If you need other Qt components, they can be added via
qt5.depends_component and qt5.depends_build_component.
For example, Qt creator has:
    qt5.depends_component  qtscript qtdeclarative qttools qtmacextras
qtquickcontrols qtsvg

> 2. What if the Port needs qt56 or greater, say? How would you do that?
Currently, there is no feature to do this, but it probably could be
added fairly easily.
The qmake5 PortGroup already queries the Qt version with
    set qt_version [exec ${prefix}/bin/pkg-config --modversion Qt5Core]

> 3. I don't even want to think about kde - that whole area totally loses me.
Unfortunately, that is currently a stalled effort.
On the bright side, using qt5.depends_component and
qt5.depends_build_component means that, if we ever got qt5-kde
integration working, no changes would be needed in Portfiles.
That is the theory, at least.


More information about the macports-dev mailing list