subport and dependency

Ryan Schmidt ryandesign at macports.org
Sun Jan 22 01:17:05 PST 2012


On Jan 22, 2012, at 02:48, Andrea D'Amore wrote:

> On Sun, Jan 22, 2012 at 02:07, Ryan Schmidt wrote:
> 
>> the stub port doesn't install any software of its own and doesn't need any dependencies.
> 
> This I didn't know.
> 
>> That could be a reason. Or, the reason could be that you did not include 24 in this port's list of python.versions, and you left python.default_version at its default value of 24; if so, fix one or the other.
> 
> I removed 24 support at first as I thought py24-simplejson was broken,
> then I realized the only the stub was broken as it was accessing
> $python.version in post-destroot and that didn't exist in stub.
> 
> Anyway since python.default_version is 24 in unified portgroup I guess
> it would have complain anyway, if I don't provide 24 subport I have to
> specify a different python.default_version, is this correct?

Yes. Either provide a python 2.4 version of the port, or if that is not possible, then change python.default_version to the highest python 2.x version you do support.


>> Also, you have this block in the port:
>>    if {${python.version} != 24} {
>>        depends_lib-append  port:py${python.version}-numpy
>>    } else {
>>        depends_lib-append  port:py-numpy
>>    }
>> This is wrong. It would be right if numpy weren't using the unified python portgroup. But because numpy is using the unified python portgroup, py-numpy isn't a real port; it's a stub port, and py24-numpy is the real python 2.4 port. So just always append dependency port:py${python.version}-numpy , regardless of the python version.
> 
> I took the very same code from r82241 [1] that is listed at 'Python'
> wiki page's bottom as reference example [2].

Well, that revision was 5 months ago. numpy was unified after that, in r83852.


> On the opposite I had the impression that default stub should include
> stub dependency, i.e. py-numpy rather than py24-numpy.
> I preferer to specift the version as it doesn't assume knowing
> anything about the dependency.

I don't understand what you're saying here. Perhaps the following remarks are helpful:

When using the unified python portgroup, py24-foo is the python 2.4 version of foo, and py-foo is a stub port that does nothing (other than declare a dependency on the default python version of that port). When using the old separate python24 portgroup, py-foo is the python 2.4 version of foo and there is no py24-foo port. This usage is being phased out in favor of the new unified python portgroup.

If you are writing a port using the unified portgroup, you must arrange to not add any dependencies or do anything with files from worksrcpath when in the stub port, by enclosing any such tasks in an "if {$name != $subport}" block.

The stub port's dependency on the default version of the port (i.e. in py-foo adding a dependency on py24-foo) is accomplished by the python portgroup itself.




More information about the macports-dev mailing list