subport and dependency

Ryan Schmidt ryandesign at macports.org
Sat Jan 21 17:07:14 PST 2012


On Jan 21, 2012, at 18:03, Andrea D'Amore wrote:

> In r89246 [1], if I move "depends_lib     port:gdal" out of the if
> {$subport …} it's not honored, I tried by deactivating gdal and then
> installing 'py-gdal'.
> Is there a  reason for this?

For the unified python portgroup, dependencies belong inside the {$subport != $name} block. Do not move them outside the block. Additionally, append to, don't overwrite, the dependencies. When $subport == $name, you're in the stub port; the stub port doesn't install any software of its own and doesn't need any dependencies.


> Also is still 24 a safe default, i.e. not too old, as of today?

If you convert an existing python module port to the unified python portgroup, and there existed a python 2.4 version of that module before, keep the default python version at its default value of 24. Otherwise (if converting a module that did not have a 2.4 version, or if creating a new module), set the default python version to 27 (or the newest 2.x version you offer).


> I moved a few python port to python-1.0 portgroup, and for them I got
> a lint report saying py24- dependency was unknown. I remember
> stumbling into this and I figure this is due to portindex not indexing
> the default port at the time of commit. Is this correct or if not can
> anyone enlight me?


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.


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.




More information about the macports-dev mailing list