default_variants per platform

Ryan Schmidt ryandesign at macports.org
Thu Jul 12 15:27:42 PDT 2007


On Jul 12, 2007, at 07:14, Anders F Björklund wrote:

> Is it possible to set "default_variants" per platform ?
>
> Basically, I want to set +aqua for platform macosx,
> and +x11 for platform puredarwin or platform freebsd.
> I tried the most straight-forward approach, wrapping
> default_variants in platform, but it didn't work...
>
> For now I made due with "variant aqua requires macosx".

It should be possible. Off the top of my head:

platform macosx {
	default_variants +aqua
}

platform puredarwin {
	default_variants +x11
}


> I also seemed to have the misguided notion that the
> default variants would somehow go away when actually
> providing some variants ? Not so, I had to give an
> explicit "+x11 -aqua" to get rid of the defaults...

I noticed that too. See my solution in the e.g. the minivmac portfile:

if { ![variant_isset mac128k] && ![variant_isset mac512k] && ! 
[variant_isset mac512ke] && ![variant_isset macse] } {
	default_variants +macplus
}

It gives you the default variant only if you have not already  
selected another variant.





More information about the macports-dev mailing list