How to adapt ports to different versions of Python

Bryan Blackburn blb at macports.org
Fri Feb 20 15:55:12 PST 2009


On Fri, Feb 20, 2009 at 11:37:41PM +0000, Uldis Bojars said:
> On Fri, Feb 20, 2009 at 11:05 PM, Bryan Blackburn <blb at macports.org> wrote:
> >> > b) remove PortGroup from py-rdflib and add variants "python24" and
> >> > "python25" to it ?
> >>
> >> Some ports (for example [1]) use variants python24, python25, ...
> >> instead of PortGroups. Could you please tell what is wrong with the
> >> other approach (used by ports such as [1])?
> >
> > redland-bindings doesn't use a python port group; if you do use a port group
> > you have to break out the port into multiple (py-, py25-, etc).  This is
> > unfortunately the way it is for now, until ticket #16723 is implemented:
> 
> Why do you need port groups?

They simplify a port, as they allow centralization of the work into the one
file (the one implementing the given group).  For python* groups, they
aren't really too complicated, but for some groups they do quite a bit of
work, and drastically cut a Portfile in size.

> 
> If you create variants for different variants then you would need to
> remove port from a port group. Fine. What I am trying to understand
> here is if there is anything wrong with doing that - does a port break
> if changed this way?

You can do this, and would need to make sure to properly select the right
python bits the port needs in the +python* variant as needed.  But also note
that if you're looking at a port which is currently names py-something (or
py##-something), you should also rename it, as those prefixes have meaning.
Also note that renaming ports is messy as there's no way to ease into the
new name.

Otherwise, there are definitely ports which use variants instead of
duplication to do that, as these are unfortunately the only choices for now
(until #16723).  Note though that you can't then depend on the port
+python25 for example, as that is ticket #126 (and a blocker for #16723).
This is one of the useful bits of having py-something and py25-something, so
you can specifically depend on the python 2.5 one, for example.

Bryan


> 
> Thanks,
> Uldis
> 
> [ http://captsolo.net/info/ ]


More information about the macports-dev mailing list