in-Portfile variant removal (not default)?

Ryan Schmidt ryandesign at macports.org
Fri Jul 23 18:17:06 PDT 2010


On Jul 23, 2010, at 17:37, Joshua Root wrote:
> On 2010-7-24 06:11 , Michael Dickens wrote:
>> For qt4-4.6.3, if I configure as +framework and +debug, 'configure' will
>> internally change the latter into +combined (meaning: debug and
>> release); in 4.7.0b2 with these variants, 'configure' prints an error
>> and exits.  I'm inserting some "ui_msg"s into the qt4-* Portfiles to
>> explain what's going on -- warning the user and/or providing info as to
>> how to use features of the install (e.g., getting access to the
>> FOO_debug libraries when executables are linked to FOO framework).  So,
>> what I'd like to do is change variants inside the Portfile from +debug
>> to +combined; I'm sure it's possible, I just don't know how & quick
>> search of Portfiles and the MacPorts Guide have come up empty (and, it's
>> possible I was too quick in looking).  I've tested the addition of
>> +combined and that works (via "default_variants" in side "if"
>> statements).  But how do I remove the user-specified +debug variant? 
>> Thanks! - MLD
> 
> Why not just declare debug as conflicting with framework? Silently
> giving the user different variants than they requested isn't good UI.
> Maybe also have combined require debug, since you do get debug versions
> with it. Or have a variant like no_optimized instead (that requires
> debug), and have the behaviour be that no variants builds an optimized
> version, +debug adds a debug version, and +no_optimized turns off the
> optimized version leaving you with just the debug one. (Framework should
> then conflict with no_optimized.)

I would say you should have just variants "framework" and "debug". If the user selects both, make these variants realize that both have been selected together and then send the correct value (wherever it is that you need to specify "combined") to the configure script, e.g.

variant framework {
    if {[variant_isset debug]} {
        ...combined...
    } else {
        ...framework only...
    }
}

variant debug {
    if {![variant_isset framework]} {
        ...debug only...
    }
}




More information about the macports-dev mailing list