Metaport

Ryan Schmidt ryandesign at macports.org
Mon Oct 19 10:47:46 PDT 2009


On Oct 19, 2009, at 12:36, vincent habchi wrote:

>> I don't believe that will be possible with the way the muniversal  
>> portgroup is written today. Looking in muniversal-1.0.tcl, I see  
>> its configure phase runs a loop over all requested architectures,  
>> and in that loop, it copies the worksrcpath to a new worksrcpath  
>> with a name based on the arch, sets up variables and flags, and  
>> then calls configure_main from MacPorts base. The muniversal  
>> portgroup doesn't do anything to change how pre-configure or post- 
>> configure are handled, so MacPorts base continues to handle this,  
>> which means pre-configure and post-configure only run once, not  
>> once per architecture. Also, since the actual worksrcdirs that will  
>> be used by configure are not created until the configure phase,  
>> they don't exist yet in pre-configure, so you can't do anything to  
>> them there.
>
> That's about the same thing I saw. I tried to add a pre-configure  
> phase in muniversal, but it seems it is not called by the main  
> interface, contrarily to other phases.

I don't know about that, but the other thing is that pre- and post-  
blocks can be defined multiple times. They don't override one another.  
So if the portgroup defines a pre-configure phase, and the portfile  
defines a pre-configure phase, MacPorts would happily call both of them.

> I had not thought about the configure phase creating directories,  
> but that can easily be switch from configure to some earlier phase.

Perhaps muniversal could do this in a post-extract phase. That way,  
you could write a (single) pre-configure phase, and in it, you would  
loop over the list of requested architectures and do your reinplacing  
in each one.

>> Are these C source files you're patching? If so, is there maybe a  
>> way to achieve what you want by using a patch which uses the  
>> __LP64__ #define?
>
> Have a look at the atlas portfile, you'll see. No, that's a Fortran  
> configuration file.

I haven't used fortran. Does fortran not offer something equivalent to  
C's preprocessor directives?



More information about the macports-dev mailing list