python install anomalies - tcl code to set paths

Darren Weber dweber at macports.org
Fri May 22 12:07:41 PDT 2009


The python 2.x installs contain can variations in paths for the include and
lib installations (python2.6 deviates from the prior patterns set by 2.4 and
2.5).

The following tcl code should work for python 2.4, 2.5, and 2.6 (as of May
2009).  The nice thing about this tcl code is that a port can use it to set
a python dependency for configuration that will be specific to a python
version.  This proc can be called from within variants to set or reset a
python dependency easily (e.g., say you want more than one python variant to
depend on a specific python install).

proc setPython { pyVer } {
    global pyVer python pyPort pyFrame pyLib pyBin pySite pyInc
    #set pyVer       2.5
    set python      python${pyVer}
    set pyPort      [join [split $python .] ""]
    set pyFrame
${prefix}/Library/Frameworks/Python.framework/Versions/${pyVer}
    set pyLib       ${pyFrame}/Python
    set pyBin       ${prefix}/bin/${python}
    set pySite      ${prefix}/lib/${python}/site-packages
    set pyInc       ${prefix}/include/${python}
    if [string match "2.6" ${pyVer}] {
        # python2.6 is a true framework installation; whereas installs for
2.4
        # and 2.5 contain symlinks in the framework path to the prefix path;
and
        # those symlinks can break the file_map stage of port activation.
        set pyBin       ${pyFrame}/bin/${python}
        set pySite      ${pyFrame}/lib/${python}/site-packages
        set pyInc       ${pyFrame}/include/${python}
    }
}
# Init the python variables
setPython 2.5


Regards, Darren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20090522/83bb6bbe/attachment.html>


More information about the macports-dev mailing list