How to depend on a variant (or do I want subports)?

Jeremy Lavergne jeremy at lavergne.gotdns.org
Wed Oct 31 13:05:01 PDT 2012


Sorry about that empty reply. Here's what I meant to send :-)

>> Now to my question: xsnmp depends on the libnetsnmp and libnetsnmpagent
>> libraries and headers. They are provided by MacOS itself. But as an
>> alternative port I'd have to specify net-snmp. Unfortunately these libs
>> are only provided in the +server variant.
>> 
>> So how do I achieve the necessary dependency? I read some vague things
>> about subports but did not find any concrete documentation.
> 
> MacPorts doesn't let you declare a dependency on a variant of a port.

What you can do is make use of cal's active_variant's PortGroup.

It'll will let you error out if the variant of a given port isn't installed, among other useful abilities.

> It's issue #126. If the +server variant of net-snmp installs libraries, and other ports might want to use those libraries, then the +server variant of net-snmp should probably be turned into a net-snmp-server subport. net-snmp appears to be maintained by me :) but I don't really know much about it, so I wasn't aware that the +server variant installed any libraries. Can you think of any reason why we shouldn't delete the +server variant and just make the port install those parts always?



More information about the macports-dev mailing list