How can variant B imply variant A?

Mojca Miklavec mojca.miklavec.lists at gmail.com
Tue Aug 21 06:53:08 PDT 2012


On Tue, Aug 21, 2012 at 3:27 PM, Jeremy Lavergne wrote:
>> How can I make variant B automatically turn the variant A on?
>
> variant A {}
> variant B requires A {}

Please excuse my blindness. I was starring at both
    http://guide.macports.org/chunked/reference.variants.html
    http://guide.macports.org/chunked/using.variants.html
probably for so long that I failed to spot the most obvious place
where it's documented. And I've actually known about the keyword
somewhere in my subconscious mind ;)

However, I'm still left with a tiny follow up (in case that it is
doable without too much hassle). Can the following be done (below is
just "pseudocode")?

    variant wxt description "Enable wxWidgets" {
        if {![variant_isset wxwidgets] && ![variant_isset wxwidgets_devel]} {
            if {[port_isinstalled wxWidgets-devel]} {
                variant-enable wxwidgets_devel
            } else {
                variant-enable wxwidgets
            }
        }
    }

Thank you,
    Mojca


More information about the macports-dev mailing list