Using python before it is selected?
Craig Treleaven
ctreleaven at cogeco.ca
Sat May 19 05:57:34 PDT 2012
At 12:27 AM -0400 5/19/12, Jeremy Lavergne wrote:
> > So the port I'm working on uses Python and requires a bunch of
>modules as dependencies. That's working OK but then my port's
>configure _uses_ python to test if the dependencies are installed.
>If this is the first time installing python on a machine, no version
>of python is 'selected'. aka ...
>>
>>> AT-MBP12:mp WCT$ port select --list python
>>> Available versions for python:
>>> none (active)
>>> python25-apple
>>> python26
>>> python26-apple
>>> python27-apple
>>
>> It would seem to me that MacPorts ought to 'select' the first
>>version of python when it is installed, no? In my port, is there a
>>way to test for 'none' and then set the one I want? I wouldn't
>>change the version out from under the user if they've actually
>>selected one.
>
>Well, if your port is after a specific version the easy way would be
>check the modules with pythonX.Y. You should also lib-depend on this
>version of python, which means it WILL BE AVAILABLE when you build
>and install.
Sorry, I'm not following. The first time my port is installing, it
is using depends_lib to pull a bunch of py26-* modules. But the
"port select --set python python26" command hasn't happened so
effectively, there is no python available when configure for my port
starts running. The software is there but select hasn't done its
magic.
Is there a clean way around that? In my case, MythTV just disables
the python bindings. I could see users not noticing this while
installing Myth and then noticing later that certain functions aren't
available. Rather annoying.
Craig
More information about the macports-dev
mailing list