Ticket #3924: trac_python_3924.patch

File trac_python_3924.patch, 3.8 KB (added by dphilp, 13 years ago)
  • SPKG.txt

    # HG changeset patch
    # User dphilp@ncephpc110.anu.edu.au
    # Date 1219808892 -36000
    # Node ID 3a3127588a6c60c8837a31c3339f5ba44377b1dd
    # Parent  ab19460e7ac9d3e060a7eaafeceb487f8390bbd3
    Created environment vars SAGE_PYTHON_FRAMEWORK and SAGE_PYTHON_UCS2 which allow framework build (on OS X) and UCS2 compatibility.
    
    diff -r ab19460e7ac9 -r 3a3127588a6c SPKG.txt
    a b  
    2727
    2828 * Remove src/Lib/distutils/command/wininst-6.exe and src/Lib/distutils/command/wininst-7.1.exe. Once we support Windows we will likely need to add them back in.
    2929 * We used to block parallel MAKE, but extensive testing [make -j64] showed that there is no longer any problem. Should it rear its ugly head again we will disable it again.
     30 * Framework builds: when changing python version, the hardcoded paths in spkg-install and sage.spkg/sagebuild.py, will have to be edited by hand.
    3031
    3132== Changelog ==
     33
     34=== python-2.5.2.p5 (David Philp, August 27th, 2008) ===
     35 * Modified spkg-install to allow framework builds on OS X (#3924)
     36 * Modified spkg-install to allow USC2 builds
    3237
    3338=== python-2.5.2.p4 (Michael Abshoff, August 25th, 2008) ===
    3439 * Set LDFLAGS and CPPFLAGS to pick up Sage's readline (#3947) 
  • spkg-install

    diff -r ab19460e7ac9 -r 3a3127588a6c spkg-install
    a b  
    4646 
    4747unset DISTUTILS_DEBUG
    4848
     49# (OS X only)  If SAGE_PYTHON_FRAMEWORK is set, compile python as a framework
     50if [ `uname` = "Darwin" -a "$SAGE_PYTHON_FRAMEWORK" = "yes" ] ; then
     51    echo "Building python as a framework with --enable-framework=$SAGE_LOCAL/Frameworks"
     52    FRAMEWORK_BUILD_OPTION="--enable-framework=$SAGE_LOCAL/Frameworks"
     53fi
     54
     55# If SAGE_PYTHON_UCS2 is set, compile sage with UCS2 support instead of UCS4 (default)
     56## NB UCS2 is probably only useful if you want some compatibility with OS X System Python.
     57if [ "$SAGE_PYTHON_UCS2" = "yes" ] ; then
     58    echo "Building python with UCS2 support instead of UCS4 support"
     59    UCS_BUILD_OPTION="--enable-unicode=ucs2"
     60else
     61    UCS_BUILD_OPTION="--enable-unicode=ucs4"
     62fi
     63
    4964
    5065cd src
    5166
     
    7085    if [ `uname` = "Darwin" -a "$SAGE64" = "yes" ]; then
    7186        echo "64 bit OSX 10.5 build enabled"
    7287        OPT="-g -O3 -m64 -Wall -Wstrict-prototypes"; export OPT
    73         ./configure $EXTRAFLAGS --prefix="$SAGE_LOCAL" --without-libpng --enable-unicode=ucs4 \
    74         --with-gcc="gcc -m64" --disable-toolbox-glue
     88        ./configure $EXTRAFLAGS --prefix="$SAGE_LOCAL" --without-libpng $UCS_BUILD_OPTION \
     89        --with-gcc="gcc -m64" --disable-toolbox-glue \
     90        $FRAMEWORK_BUILD_OPTION
    7591    else
    7692        if [ `uname -m` = "ia64" -a "`uname`" = "Linux" ]; then
    7793            echo "Setting special flags for Itanium"
    7894            OPT="-g -O3 -Wall -Wstrict-prototypes"; export OPT
    7995        fi
    80         ./configure $EXTRAFLAGS --prefix="$SAGE_LOCAL" --without-libpng --enable-unicode=ucs4
     96        ./configure $EXTRAFLAGS --prefix="$SAGE_LOCAL" --without-libpng $UCS_BUILD_OPTION \
     97        $FRAMEWORK_BUILD_OPTION
    8198    fi
    8299
    83100
     
    107124rm -rf python/python2.5 python/python python python2.4
    108125ln -s python2.5 python
    109126
     127# (OS X only)  If SAGE_PYTHON_FRAMEWORK the symlink created above will be left dangling
     128if [ "$SAGE_PYTHON_FRAMEWORK" = "yes" ] ; then
     129    ln -s ../Frameworks/Python.framework/Versions/2.5/lib/python2.5 python2.5
     130fi
     131
     132
     133cd $SAGE_LOCAL/include
     134
     135# (OS X only)  If SAGE_PYTHON_FRAMEWORK, the local/include/python2.5 directory has not
     136# been created, but we need it to point to the framework headers
     137if [ "$SAGE_PYTHON_FRAMEWORK" = "yes" ] ; then
     138    ln -s ../Frameworks/Python.framework/Versions/2.5/include/python2.5 python2.5
     139fi
     140
     141
    110142if [ `uname` = "Darwin" -a "$SAGE64" = "yes" ]; then
    111143    echo "Copying 64 bit OSX specific pymactoolbox.h"
    112144    cd $CUR