port callback example

Daniel J. Luke dluke at geeklair.net
Tue Feb 8 15:12:51 PST 2011


On Feb 8, 2011, at 5:55 PM, James Gregurich wrote:
> 
>> muniversal just runs the configure (build, and destroot) phase multiple times. If you really need to, you can probably inspect the variables and do what you need to inside of the configure phase
> 
> Correct me if my understanding is wrong, but my analysis is that if I overrode configure in port using the muniversal portgroup, I would have to supply a new version of the entire configure function.  Is this incorrect?

Oh, no, you're right.

> 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?

> Is my analysis wrong? If not, what is the recommended course of action if adding additional call-backs is undesirable?

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 ;)

--
Daniel J. Luke                                                                   
+========================================================+                        
| *---------------- dluke at geeklair.net ----------------* |                          
| *-------------- http://www.geeklair.net -------------* |                          
+========================================================+                        
|   Opinions expressed are mine and do not necessarily   |                          
|          reflect the opinions of my employer.          |                          
+========================================================+



More information about the macports-dev mailing list