port callback example
bayoubengal at mac.com
Tue Feb 8 15:37:06 PST 2011
On Feb 8, 2011, at 3:12 PM, Daniel J. Luke wrote:
> I also note that pre-configure and post-configure are only called once...not once-per-arch.
> I wonder if maybe it would be easier/better to modify muniversal to call them once per arch?
I don't think I want to do that because that might break existing ports. I'm trying to layer this stuff on top of the existing system for the sake of backwards-compatibility. I can certainly tack on new handers to the API without breaking existing stuff.
> I think the pattern for callbacks is to implement a stub that does nothing and then the port can override it with a different definition if necessary.
> You could probably even dynamically generate pre_muniversal_arch/post_muniversal_arch procs that would go before/after the configure/build/destroot phase if that seems like a good idea...
> It's been a while since I've looked at base/ though, so you'll probably get better input from someone else ;)
I need some direction on this point. I need syntax for the following:
1) set up the default stub in muniversal
2) provide for overriding the stub in the portfile
3) invoke the stub taking
4) all of the above taking namespace requirements into consideration.
If you can get me pointed in the right direction so I know where to go, I can probably figure out the details on my own. My knowledge of TCL is very limited and I'm not sure where to begin.
More information about the macports-dev