replaced_by multiple ports?

Ryan Schmidt ryandesign at
Tue Dec 11 13:47:35 PST 2012

On Dec 11, 2012, at 15:31, Leo Singer wrote:

> On Dec 11, 2012, at 1:21 PM, Ryan Schmidt wrote:
>> On Dec 11, 2012, at 14:59, Jeremy Lavergne wrote:
>>>> I would like to split an existing port (healpix) into two or more new ports (healpix-c, healpix-cxx). Is there a way to accomplish this with replaced_by, or are there any examples of ports for which something similar has happened in the past?
>>> I believe replaced-by only handles a one-to-one replacement.
>> Right.
>>> I'd recommend making healpix a virtual package (no real contents, just one file in to place into a ${prefix}/share/doc/${name}/) that depends on both healpix-c and healpix-cxx. 
>> Yes, but you'll have to add the "deactivate hack" to the virtual port (or meta port) to prevent activation failures on upgrades.

I misspoke; the "deactivate hack" needs to go into the subports, not the meta port.

>>> You could add a `notes` message indicating healpix no longer does anything: users can set healpix-c[xx] as requested and then uninstall healpix.
>> Yes, and any ports that depend on healpix should be updated to depend on the new port(s) as appropriate.
> Could I have healpix depend on healpix-c and healpix-cxx?


> The healpix-* ports would share distfiles and some build arguments. What I have in my working copy right now is a modified version of the healpix Portfile (see attached) that contains healpix-c and healpix-cxx subports, a little reminiscent of the Python ports. Is this setup reasonable?

Sounds good!

> What is the simplest way to make the main port a virtual port?

Do something in a "if {${name} == ${subport}}" block.

See attachment.

I tested healpix-c and it installs fine and deactivates old healpix properly.

healpix-cxx failed to build:

:info:build ld: library not found for -lgomp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Portfile
Type: application/octet-stream
Size: 3158 bytes
Desc: not available
URL: <>

More information about the macports-dev mailing list