variants vs separate ports

Ryan Schmidt ryandesign at macports.org
Mon May 24 11:30:35 PDT 2010


On May 24, 2010, at 12:38, Daniel J. Luke wrote:

> On May 24, 2010, at 1:30 PM, Ryan Schmidt wrote:
>> GraphicsMagick uses:
>> 
>> if {![variant_isset q16] && ![variant_isset q32]} {
>>   default_variants +q8
>> }
>> 
>> This ensures that if the user does not specify +q8, +q16 or +q32, it selects +q8. 
>> 
>> The one thing this does not handle is if the user specifically tries to install "GraphicsMagick -q8"; in this case no variant will be selected. I've never been entirely comfortable with that. Perhaps we should indeed be using variant_set instead:
>> 
>> if {![variant_isset q16] && ![variant_isset q32]} {
>>   variant_set q8
>> }
>> 
>> I'm not certain why we haven't been doing that.
> 
> I still don't understand why you set up some of your ports this way instead of the more straightforward method (have the +q8 configure args in the default configure args, and have the variants just remove the +q8 stuff and add their appropriate args).
> 
> To me, Portfiles are always clearer if they can avoid using variant_isset.

Because we are talking about a choice between three mutually-exclusive options, three settings: q8, q16, and q32. In a GUI, these would be represented as radio buttons. It makes no sense to me that two of these options should be implemented as variants and one of them would not be.




More information about the macports-dev mailing list