internal-to-Portfile variable during upgrade?

Michael Dickens michaelld at macports.org
Thu Jul 8 14:11:18 PDT 2010


Taking into account that 'if' statements are processed in-order in the
main scope of the Portfile, while variants are processed after
everything else & in their own scope, I converted what I wrote before
into what's below, which it works and, amazingly, really isn't too ugly
even.  I don't even need the initial 'set qt_dir ""' or the use of
'global' since the 'set's are done in main scope of the Portfile. 
Anyway, thanks for your help; now, I'll go off and correct those ports
in which I implemented such variants and selection. - MLD

variant qt3 conflicts qt4 description {Use qt3-mac} {
    depends_lib-append  port:qt3-mac
}

variant qt4 conflicts qt3 description {Use qt4-mac} {
    depends_lib-append  port:qt4-mac
}

if {[variant_isset qt3]} {
    set qt_dir          ${prefix}/libexec/qt3-mac
} else {
    if {![variant_isset qt4]} {
        default_variants    +qt4
    }
    set qt_dir          ${prefix}/libexec/qt4-mac
}

configure.cmd       ${qt_dir}/bin/qmake


More information about the macports-dev mailing list