variant requires odd functionality

Michael Dickens michaelld at macports.org
Wed Oct 9 08:42:34 PDT 2013


I just pushed the new port for ticket #39327 <
https://trac.macports.org/ticket/39327 >, revision r112010 <
https://trac.macports.org/changeset/112010 >; it installs both static
and dynamic libraries, and works with +universal to boot!

In my testing I came upon something interesting with the way port
handles requires in variants; here's the comment I added to the Portfile
for itsol, augmented to make sense outside the Portfile's context:

{{{
atlas does not provide a +g95 variant, so if +g95 is used, +accelerate
must also be used.  +accelerate will work with +gccXY, so this is all a
bit complex to check for; normally I would set the +g95 variant to
"requires accelerate".  But, setting this 'requires' does not yet seem
to work with 'port' to get [+]accelerate as the default variant; leaving
it out does work, so doing that and checking for this condition later,
for now.  To be clear, port handles the requires correctly internally,
but not from the user's perspective -- for example, specifying "sudo
port install itsol -accelerate +g95" will result in +accelerate
implicitly being used, overriding the user's request but without
notifying the user.  Removing the 'requires' and putting in a manual
check works just fine for now.
}}}

I'm not sure if the above behavior is a feature or bug.  My fix is
simple, but I'd think this would be better handled within port itself. -
MLD


More information about the macports-dev mailing list