Callback registration mechanism

Joshua Root jmr at macports.org
Mon Apr 1 08:46:11 PDT 2013


On 2013-2-12 10:28 , Rainer Müller wrote:
> On 2013-02-11 03:01, cal at macports.org wrote:
>> Revision: 102932
>>           https://trac.macports.org/changeset/102932
>> Author:   cal at macports.org
>> Date:     2013-02-10 18:01:56 -0800 (Sun, 10 Feb 2013)
>> Log Message:
>> -----------
>> Automatically add dependency on MacPorts-provided compilers, if chosen as configure.compiler. Closes #32542.
>>
>> This also adds a generic machanism to register callbacks to be run after
>> sourcing the Portfile and evaluating the variants. This callback
>> mechanism can probably be used to simplify other parts of port1.0, e.g.
>> automatically adding a dependency on autoconf when use_autoreconf is set
>> to yes, automatically adding a dependency on bsdmake when build.type is
>> bsd, etc.
> 
> I like the idea, but I also have some bad feelings with this. The
> callbacks are run after the Portfile is evaluated, so the end result
> cannot be influenced or overridden anymore. However, I don't see any
> practical problems with it yet.

There is a problem in that if you build with a gcc port but don't end up
linking to any of its libs, you still get stuck with a lib dependency.
There are a number of ports that put gcc only in depends_build. Now,
maybe they are incorrect in doing that, but if not, it means that users
will be made to install a large gcc port unnecessarily in some cases.

- Josh


More information about the macports-dev mailing list