python2.5 has wrong value for distutils.sysconfig.get_config_var("PYTHON")
[oops, wasn't on mailing list the first time I tried to send this] Currently, MacPorts installs python2.4 as /opt/local/bin/python and Python 2.5 only as python2.5. However, the Python 2.5 install doesn't know this; in its makefile (which ends up installed as /opt/local/lib/python2.5/config/makefile), it still believes that PYTHON= python$(EXE) which means that distutils.sysconfig.get_config_var("PYTHON") returns "python" instead of "python2.5", which means that python programs that rely on this config var to be able to run python from the command line run the wrong version of python. Can we fix the build process so that python 2.5 is configured with PYTHON=python2.5, instead of tricking it into thinking it is called python and just deleting python in the post-destroot? --dave -- David Glasser | glasser@mit.edu | http://www.davidglasser.net/ -- David Glasser | glasser@mit.edu | http://www.davidglasser.net/
David Glasser wrote:
[oops, wasn't on mailing list the first time I tried to send this]
Currently, MacPorts installs python2.4 as /opt/local/bin/python and Python 2.5 only as python2.5. However, the Python 2.5 install doesn't know this; in its makefile (which ends up installed as /opt/local/lib/python2.5/config/makefile), it still believes that
PYTHON= python$(EXE)
which means that
distutils.sysconfig.get_config_var("PYTHON")
returns "python" instead of "python2.5", which means that python programs that rely on this config var to be able to run python from the command line run the wrong version of python.
Can we fix the build process so that python 2.5 is configured with PYTHON=python2.5, instead of tricking it into thinking it is called python and just deleting python in the post-destroot?
Hi David, Can you write a quick patch for the python2.5 Portfile to do what you're referring to here? Regards, Blair -- Blair Zajac, Ph.D. <blair@orcaware.com> Subversion training, consulting and support http://www.orcaware.com/svn/
On 5/1/07, Blair Zajac <blair@orcaware.com> wrote:
Can you write a quick patch for the python2.5 Portfile to do what you're referring to here?
Working on it. I've never been so good about understanding how to test my own Portfiles though --- I mean, I know I can just put Portfile in a random directory and type "port install", but how do I make it forget completely about my version and upgrade to the "real" version once my patch has been accepted by MacPorts? (About the issue itself: it looks like this actually requires patching the Makefile, since PYTHON is not actually a configure argument. Ugh.) (BTW Blair, this is to get David James' svn ctypes stuff working.) --dave -- David Glasser | glasser@mit.edu | http://www.davidglasser.net/
David Glasser wrote:
On 5/1/07, Blair Zajac <blair@orcaware.com> wrote:
Can you write a quick patch for the python2.5 Portfile to do what you're referring to here?
Working on it. I've never been so good about understanding how to test my own Portfiles though --- I mean, I know I can just put Portfile in a random directory and type "port install", but how do I make it forget completely about my version and upgrade to the "real" version once my patch has been accepted by MacPorts?
I use the port at the same revision number as the official port, then uninstall the current version, put my local port repository in $prefix/etc/ports/sources.conf as a file:/// before the rsync one, then use portindex. When I'm happy, I submit it upstream with a bump in revision and move the port out of my local repository (say into a retired ports directory that MacPorts doesn't nsee), since it shadows the main one.
(About the issue itself: it looks like this actually requires patching the Makefile, since PYTHON is not actually a configure argument. Ugh.)
(BTW Blair, this is to get David James' svn ctypes stuff working.)
Cool. That'll be nice to get in. Regards,
On 2 May 2007, at 03:12, Blair Zajac wrote:
David Glasser wrote:
On 5/1/07, Blair Zajac <blair@orcaware.com> wrote:
Can you write a quick patch for the python2.5 Portfile to do what you're referring to here? Working on it. I've never been so good about understanding how to test my own Portfiles though --- I mean, I know I can just put Portfile in a random directory and type "port install", but how do I make it forget completely about my version and upgrade to the "real" version once my patch has been accepted by MacPorts?
I use the port at the same revision number as the official port, then uninstall the current version, put my local port repository in $prefix/etc/ports/sources.conf as a file:/// before the rsync one, then use portindex. When I'm happy, I submit it upstream with a bump in revision and move the port out of my local repository (say into a retired ports directory that MacPorts doesn't nsee), since it shadows the main one.
(About the issue itself: it looks like this actually requires patching the Makefile, since PYTHON is not actually a configure argument. Ugh.) (BTW Blair, this is to get David James' svn ctypes stuff working.)
Cool. That'll be nice to get in.
o.k. - I've just submitted revision 1 of python25 that includes a fix for this - the PYTHON variable now points to @bindir@/python2.5 (e. g. /opt/local/bin/python2.5). Please let me know if this causes any troubles elsewhere and if it fixes the ctypes problem (or if we need to patch more stuff) salut, -Markus --- Markus W. Weissmann http://www.mweissmann.de/
On 5/4/07, Weissmann Markus <mww@macports.org> wrote:
o.k. - I've just submitted revision 1 of python25 that includes a fix for this - the PYTHON variable now points to @bindir@/python2.5 (e. g. /opt/local/bin/python2.5).
Please let me know if this causes any troubles elsewhere and if it fixes the ctypes problem (or if we need to patch more stuff)
Cool! For what it's worth, though, it was pointed out to me that I should probably just use sys.executable instead of distutils.sysconfig.get_config_var("PYTHON"). --dave -- David Glasser | glasser@mit.edu | http://www.davidglasser.net/
participants (3)
-
Blair Zajac
-
David Glasser
-
Weissmann Markus