Where are we with simultaneous Python Framework installs

Rainer Müller raimue at macports.org
Wed May 14 20:33:51 PDT 2008


Rainer Müller wrote:
> See http://trac.macports.org/wiki/PythonFrameworkTransition and the 
> python-frameworks branch in svn. I tried to make python24 and python25 
> more similar and build both as frameworks.
> 
> Before this can be released we need an easy way for the transition as 
> described on the wiki page.
> 
> Also updates to the python port groups are necessary. Currently they are 
> shipped with base, so we can't update them at any time, only with 
> releases. See ticket #14553 [1] for more. Sure we could solve this issue 
> before (with a release) and then update the port groups whenever we like 
> without waiting for new releases.

So today I had time to play with the python25 port group a little bit. I 
thought we could just change
   --prefix=${prefix}
to
   --prefix=${prefix}/Library/Frameworks/Python.framework/Versions/2.5/
in order to achieve py25-* modules to get installed into the framework.

But it turned out that this will cause more problems than we gain.

There are other ports around using the python25 port group which are not 
  modules for python25, e.g. mercurial. So with this change, the hg 
binary will land at
   ${prefix}/Library/Frameworks/Python.framework/Versions/2.5/bin/hg
which is absolutely not what we want.

So, currently, I don't know a better solution than to stick with 
--prefix=${prefix}. The setup.py script does not seem allow to specify 
seperate lib or header directories and doing that manually in a custom 
post-destroot just adds unecessary complexity in my opinion.

Thomas, I don't know if you are around and reading this mail, but what 
is your opinion on this?

But after all, this means that we have yet again to change the direction 
of the symlinks. I wanted to avoid spreading the different files all 
over ${prefix} and have them all at one place in the framework, so the 
symlinks would always go from the "usual" place to the framework. Well, 
now it turned out that this does not work as expected, because 
apparently we never thought of non-modules and how they would get 
installed while planning the transition.

Okay, so we have the option to install the files at their "usual" 
location (like ${prefix}/lib/python2.5/ and ${prefix}/include/python2.5/ 
instead of somewhere in the framework). This also means the direction of 
the symlinks changes, so they are now created inside the framework 
pointing to the "usual" location (as shown below). These symlinks are 
necessary to avoid spreading files over multiple locations which should 
be at the same place (e.g. some files in the framework, some files at 
the "usual" place). The current python24 is patched (patch-Lib-site.py) 
to also look at the "usual" place for modules, but I think a symlink 
will also work and avoid splitting of files over these locations.

New symlinks would be like this (not exactly, you get the idea):
set ${framewdir} ${prefix}/Library/Frameworks/Python.framework

${framewdir}/Python.framework/Versions/2.5/lib/python2.5
     -> ${prefix}/lib/python2.5

${framewdir}/Python.framework/Versions/2.5/lib/libpython*.dylib
     -> ${prefix}/lib/libpython*.dylib

${framewdir}/Python.framework/Versions/2.5/include/python2.5
     -> ${prefix}/include/python2.5

${framewdir}/Python.framework/Versions/2.5/bin/$foo
     -> ${prefix}/bin/$foo


Maybe then we don't need a change to the python port groups at all and 
upgrading existing pyXX-* ports may be easier. Let's see, I did not yet 
investigate that...

I will update the PythonFrameworkTransition wiki page later, when I got 
together a more solid plan.

Rainer


More information about the macports-dev mailing list