Requiring a specific variant in depends_lib

Mojca Miklavec mojca at macports.org
Mon Dec 19 10:41:04 CET 2016


On 18 December 2016 at 02:28, Ryan Schmidt wrote:
> On Dec 17, 2016, at 09:06, Akim Demaille wrote:
>>
>> So my question is: how can I specify that requirement in the Portfile?
>> Currently it reads:
>>
>> depends_lib         port:boost \
>>                   path:bin/ccache:ccache \
>>                   port:gmp \
>>                   port:python${python_version}
>>
>> and I’d like to have something like "port:boost + python${python_version}",
>> but it does not work.
>
> Correct, MacPorts base doesn't have this controversial feature. You can fake it using the active_variants portgroup, which you're already doing. It prints the above error telling the user how to resolve the problem manually by installing the correct variant of the dependency, but it cannot be resolved automatically.
>
>> Or if I can’t say that, what can I do so that vcsn is properly built
>> on your buildfarm?
>
> You can't, unless you can eliminate the dependency variant requirement.

There is a limited number of alternatives (none of which apply at the moment).

(1.) Wait until the dependency calculations are polished and released:
    https://trac.macports.org/wiki/SummerOfCode2015Libsolv

I'm not sure about the status of this code though. From what I
understood there is still some work to be done before the code is
ready to be fully integrated and released.

(2.) It wouldn't work automatically, but one could probably build the
port manually if we implemented support for variants on the buildbot:
    https://trac.macports.org/ticket/52742

(3.) It might be possible to add some logic to install/activate "boost
+ python35" on the buildbot if we had slightly more advanced logic and
parsed which variants of dependencies are needed for the port in
question. But this would only put a patch on the wound. If another
port depends on vcsn, this "advanced poor-man's logic" would fail
again unless/until we fully implement full dependency tracking
mentioned in (1).

(4.) Figure out if there is a way to install python support for boost
separately from boost itself. And if there is a way to install that
support for each version of python individually. Then you could add a
dependency on py35-boost. Judging from
    https://packages.debian.org/wheezy/amd64/libboost-python1.49-dev/filelist
I would guess that Debian developers figured out how to do that.

If you have time, motivation and some basic skillset to do it, I would
suggest you to look at #4. (Or #1: with a greater impact, but probably
steeper learning curve.)

Mojca


More information about the macports-dev mailing list