I am trying to write a portfile for some software but I want to make sure that a particular variant of a dependency is installed. Is there some way that I can specify the variant within the portfile that I want to use? WOuld something like: depends_lib port:otherport+variantname work? (I'm away from the computer that is doing this at the moment so I can't experiment). If not, then I'll have to think of some other way of achieving my goal. Thanks Susan
On 25.9.2007, at 9.34, susanmackay@optusnet.com.au wrote:
I am trying to write a portfile for some software but I want to make sure that a particular variant of a dependency is installed. Is there some way that I can specify the variant within the portfile that I want to use? WOuld something like:
depends_lib port:otherport+variantname
work? (I'm away from the computer that is doing this at the moment so I can't experiment). If not, then I'll have to think of some other way of achieving my goal.
Thanks
Susan
Sorry, this is not possible at the moment. Specifying variants in dependencies has been debated somewhat with no agreement. ! ! Jyrki Wahlstedt ! http://www.wahlstedt.fi/jyrki/ ! ! Our life is no dream; but it ought to become one and perhaps will. ! PGP key ID: 0x139CC386 fingerprint: F355 B46F 026C B8C1 89C0 A780 6366 EFD9 139C C386
susanmackay@optusnet.com.au writes:
I am trying to write a portfile for some software but I want to make sure that a particular variant of a dependency is installed. Is there some way that I can specify the variant within the portfile that I want to use? WOuld something like:
depends_lib port:otherport+variantname
work? (I'm away from the computer that is doing this at the moment so I can't experiment). If not, then I'll have to think of some other way of achieving my goal.
There is a characteristic of MacPorts base that can accomplish this, though it should be used with some care. Variants are passed to dependents, so if you install a port with a variant foo, and a dependency also has a variant foo, then the dependency will get installed with variant foo. This is fine for ports where a dependency is only used with a given port, or rarely used with anything else, or where the dependency is almost always installed using the variant anyway. Caveats are that if a dependency is already installed, it won't help a bit. Another is that if the conditions I mentioned do not hold, you may shield the user from having to learn something they'll only have to learn later anyway. But I've done this for a couple of ports where I thought it was warranted. See the comments in the server variant of the nedi port for an example. Mark
participants (3)
-
Jyrki Wahlstedt
-
markd@macports.org
-
susanmackay@optusnet.com.au