How to add universal support to a portfile?

Joshua Root jmr at macports.org
Sat Jan 16 20:09:48 PST 2010


On 2010-1-17 14:44 , Scott Haneda wrote:
> I asked this on the users list, either I missed the rely, or my post got missed, but I am genuinely curious..
> 
> How do I adjust portfiles to be able to support +universal?
> 
>    $port info php5-mcrypt
>    Variants:             debug, universal
> 
> I do not see anything in that Portfile that has debug or universal.  When I compare that to a simple Portfile of my own, memtester:

The debug variant is added in the php5extension portgroup.

>    $port info memtester
>    memtester @4.1.2 (sysutils)
> 
>    Description:          A userspace utility for testing the memory subsystem for 
>                          faults.
>    Homepage:             http://pyropus.ca/software/memtester/
> 
>    Platforms:            darwin
>    License:              unknown
> 
> I am not sure how you get universal and debug into your Portfile, since there is no explicit code that is offering it.
> 
> I would like to allow memtester to be built as universal, I just do not know what to add to the Portfile to make that a variant option.

For memtester, debug mode says:
DEBUG: not using configure, so not adding the default universal variant

The default universal variant can only work if the port uses a configure
script (or xcodebuild). Exactly what needs to be done to make a port
build universal varies greatly, but usually boils down to somehow
getting the build system to use the right flags:

<http://guide.macports.org/chunked/reference.phases.html#reference.phases.configure.universal>

You add the code to make it do this in a universal variant.

- Josh


More information about the macports-dev mailing list