How can variant B imply variant A?

Clemens Lang cal at macports.org
Tue Aug 21 12:47:05 PDT 2012


Hi,

On Tue, Aug 21, 2012 at 03:53:08PM +0200, Mojca Miklavec wrote:
> 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
>             }
>         }
>     }

I've done somthing similar in the gobject-introspection port (see lines
63 and follwing); to avoid the variant_isset checks you can simply set
default_variant depending on whether wxWidgets-devel is installed. To
check whether a port is installed and active, use
	if {[catch {registry_active wxWidgets-devel}] == 0} {
		default_variants +wxwidgets_devel
	}

HTH,
-- 
Clemens Lang



More information about the macports-dev mailing list