Choosing default variant based on active variants of dependency

Mojca Miklavec mojca at macports.org
Fri Jan 3 05:19:30 PST 2014


Hello,

I would like to solve one issue with wxpython-2.8.

The port can be installed either with the variant +carbon or with
+gtk. In one case it depends on wxWidgets 2.8 (which is only possible
for 32-bit under XCode < 4.4) and in the other it depends on wxGTK 2.8
which can be installed everywhere (also as universal).

When XCode < 4.4 is installed, wxpython-2.8 is installed with +carbon
by default. This means that any port that depends on wxpython-2.8
needs to add
    universal_variant   no
    supported_archs     i386
(but only if +carbon is active) else the compilation fails with:

Error: Cannot install py26-robotframework-ride for the arch(s) 'x86_64' because
Error: its dependency py26-wxpython-2.8 only supports the arch(s) 'i386 ppc'.
DEBUG: architecture mismatch

see https://build.macports.org/builders/buildports-snowleopard-x86_64/builds/23694
for example.

Is there any simple way to write the port so that:
    if (py*-wxpytho-2.8 is installed with +carbon) or
        (py*-wxpython-2.8 is not installed and xcodeversion < 4.4) {
        supported_archs i386
    }

I could also add variants (+wxwidgets28 / +wxgtk28) if needed, but
selecting the default variant should follow the same logic: if
wxpython-2.8 is already installed, automatically choose the right
variant. If it's not yet installed (but maybe that never happens -
maybe it's always installed by the time this part of logic is
executed), use the same strategy for selecting the default variant as
for py-wxpython-2.8.

Thank you,
    Mojca


More information about the macports-dev mailing list