internal-to-Portfile variable during upgrade?

Michael Dickens michaelld at macports.org
Wed Jul 7 13:37:43 PDT 2010


For many of the Qt-dependent ports (e.g., qwt, qwt52, etc.), I currently
need to specify which ${qt_dir} to use, e.g.,
"${prefix}/libexec/qt4-mac" or "${prefix}/libexec/qt4-mac-devel" or
"${prefix}/libexec/qt4-x11", which is dependent on the variant selected
by the user (e.g., +qt4, +qt3, +x11, etc.).  I'm working towards a
"generic" Qt install that can be selected dynamically, which should
overcome the immediate issue, but that's still a ways off.  In the mean
time, I'm trying to figure out a solution to this problem.

I can set up the Portfile to default to using, say, "qt4-mac" by either
(1) setting variable defaults such that this is the case, and then
changing those variables when variants are selected; or (2) by creating
a bunch of variants and then setting "default_variants".  I can convince
'port' to do either of the those properly -- except solely during
'upgrade', which seems to ignore anything except the default settings
(i.e., variants are not fully executed).  Looking through the debug
output, I can see comments such as "Merging existing variants '+qt4'
into variants" and "Executing variant qt4 provides qt4" ... but the
variants do not seem to be being honored, at least with respect to
setting my ${qt_dir} variable -- it always comes out as the default
setting (which, because of the way I've written the Portfile, is "").

I do not know if this is a bug or feature.  Thanks for any thoughts on
this behavior & how to correct or get around it. - MLD


More information about the macports-dev mailing list