[73039] trunk/dports/_resources/port1.0/group/qt4-1.0.tcl

Michael Dickens michaelld at macports.org
Fri Nov 5 08:17:35 PDT 2010


On Nov 5, 2010, at 10:28 AM, Joshua Root wrote:
>> Another question related to this: what is the difference between a 'global' variable versus an 'options' one?
>
> The options proc sets up the proc with the same name as the variable
> that can be used to set it, and also the -append/-delete procs. Options
> can also have defaults. (As things stand 'default' would probably work
> on any variable, but that's an implementation detail that shouldn't be
> relied upon.)

Thank you, Joshua & Ryan, for explaining the difference between global and options; makes complete sense & I see the utility of both.

> On 2010-11-6 00:49 , Michael Dickens wrote:
>> I just updated to the latest SVN version of 'port', and "get_canonical_archs" no longer works for me (it did from 'port' just a few weeks old): it is always set to the native compile arch no matter if I specify +universal or anything else.  Any other suggestions on how to globally set arch types?  I can always revert back to using a 'proc' that is sets the option/global, which would then be correctly set & available for use.
>
> Seems like it's working as expected to me. Can you give an example
> portfile that demonstrates the problem?

I edited the installed ${prefix}/share/macports/Tcl/port1.0/portutil.tcl:2567, the "proc get_canonical_archs" to print a ui_msg before each return, with what is being returned ('universal', 'configure.build_arch', or 'os.arch').  Using this and a couple of ports that accomplish setting arches differently (phonon and qwtplot3d), it looks like it is ports that use "configure.pre_args" or the equivalent to set the arch type(s) via "CONFIG+=${qt_arch_types}", directly in the Portfile context (i.e., not in a stage context) that have the issues.  Those that set the arches in a stage seem to work.

0) phonon: uses 'configure.pre_args' directly in the Portfile context:

{{{
bash% sudo port -d configure phonon +universal
DEBUG: Changing to port directory: /opt/MacPorts/macports-trunk/dports/audio/phonon
DEBUG: OS darwin/10.4.0 (Mac OS X 10.6) arch i386
DEBUG: org.macports.load registered provides 'load', a pre-existing procedure. Target override will not be provided
DEBUG: org.macports.unload registered provides 'unload', a pre-existing procedure. Target override will not be provided
DEBUG: org.macports.distfiles registered provides 'distfiles', a pre-existing procedure. Target override will not be provided
DEBUG: Using group file /opt/MacPorts/macports-trunk/dports/_resources/port1.0/group/qt4-1.0.tcl
get_canonical_archs: configure.build_arch
[snip]
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_opt_MacPorts_macports-trunk_dports_audio_phonon/work/phonon-4.4.2" && /opt/local/bin/qmake CONFIG+="phonon phonon-backend x86_64" PHONON_MAJOR_VERSION=4 .......
[snip]
}}}

I would expect:
{{{
CONFIG+="phonon phonon-backend x86 x86_64"
}}}
and that the "get_canonical_archs: " would be between the pre-configure and configure stages.

1) qwtplot3d: OTOH, if I look at qwtplot3d, which, after patching a QMake build file to contain @ARCHES@, sets the arch types in post-patch via a reinplace of @ARCHES@ with ${qt_arch_types}:

{{{
bash% sudo port -d patch qwtplot3d +universal
[snip]
DEBUG: Environment: CPATH='/opt/local/include' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_MacPorts_macports-trunk_dports_graphics_qwtplot3d/work/.CC_PRINT_OPTIONS' LIBRARY_PATH='/opt/local/lib' CC_PRINT_OPTIONS='YES' MACOSX_DEPLOYMENT_TARGET='10.6'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_opt_MacPorts_macports-trunk_dports_graphics_qwtplot3d/work/qwtplot3d" && /usr/bin/patch -p0'
patching file qwtplot3d.pro
DEBUG: Executing proc-post-org.macports.patch-patch-0
get_canonical_archs: universal
[snip]
bash% grep CONFIG `port dir qwtplot3d`/work/qwtplot3d*/qwtplot3d.pro
CONFIG           += qt warn_on opengl thread zlib release x86 x86_64
[snip]
}}}

which is as expected / desired.

So, it seems as though the 'options' for qt_arch_types is being evaluated prematurely.

Any ideas how to correct this behavior? - MLD


More information about the macports-dev mailing list