]> git.saurik.com Git - wxWidgets.git/blame - wxPython/distrib/mac/MacPython/build
Compilation fix for MSVC 6 and wxUSE_STL=1.
[wxWidgets.git] / wxPython / distrib / mac / MacPython / build
CommitLineData
1e4a197e
RD
1#!/bin/sh -e
2#----------------------------------------------------------------------
3# Build MacPython 2.3 and make an Installer package of it
4
5# TODO: Parameterize the versions, builddirs, etc...
6
7# Script configs
8PYVERSION=2.3a2
9PYVER=2.3
10BUILDNUM=3
11DOCLEANUP=no
12
13PROGDIR="`dirname \"$0\"`"
14TMPDIR=/tmp/_py
15#TMPDIR=/projects/_py
16
17BUILDROOT=$TMPDIR/build
18INSTALLROOT=$TMPDIR/install
19DMGDIR=$TMPDIR/dmg
20RESOURCEDIR=$PROGDIR/resources
21DESTDIR=/projects/wx/wxPython/dist
22PYTHONSRC=/projects/Python-$PYVERSION
23WASTEDIR=/projects/waste
24
25# Setup
26mkdir -p $BUILDROOT
27mkdir -p $INSTALLROOT
28rm -rf $DMGDIR
29mkdir -p $DMGDIR/root
30
31
32# Configure and build Python
33pushd $BUILDROOT
34
35# Check if we should build and install the docs, but only if it
36# doesn't appear to be done already. TODO: fix this path to be version independent
37if [ ! -e "build/temp.darwin-6.3-Power Macintosh-2.3/build-html/build-html idx" ]; then
38 read -p "Build the Python docs? (y/N)? " builddocs
39fi
40
41# If the filesystem is case-sensitive then "python" will be built, but
42# some parts of the install expect "python.exe which is what is built
43# on a case-insensitive filesystem. Make a link just in case it is
44# needed.
45if [ ! -e python.exe ]; then
46 ln -s python python.exe
47fi
48
49# Make a link to the waste dir so that lib can be found. This allows
50# the PythonIDE to be built
51if [ ! -e waste ]; then
52 ln -s $WASTEDIR waste
53fi
54
55$PYTHONSRC/configure --enable-framework=$INSTALLROOT/Library/Frameworks LDFLAGS=-Wl,-x
56make
57make frameworkinstall
58
59if [ "$builddocs" = "y" -o "$builddocs" = "Y" ]; then
60 ./python.exe $PYTHONSRC/Mac/OSX/setupDocs.py build
61 echo ""
62 read -p "When the help indexer is done press Enter..." ans
63 ./python.exe $PYTHONSRC/Mac/OSX/setupDocs.py install \
64 --prefix=$INSTALLROOT/Library/Frameworks/Python.framework/Versions/$PYVER
65fi
66
67popd
68
69
70
71# Make the Installer package:
72# First, remove the unix tools as their paths will be wrong. We'll recreate
73# them in the postinstall.
74rm -r $INSTALLROOT/usr
75
76# Next, remove the .pyc/.pyo files
77python $PROGDIR/../zappycfiles.py $INSTALLROOT/Library/Frameworks/Python.framework/Versions/$PYVER/lib/python$PYVER
78
79# Make the welcome message
80cat > $RESOURCEDIR/Welcome.txt <<EOF
81Welcome!
82
83This program will install Python $PYVERSION for Mac OS X as a Framework.
84
85Build number: $BUILDNUM
86Build date: `date`
87EOF
88
89
90# fix a bug in the IDLE install
91IDLERES=$INSTALLROOT/Applications/MacPython-2.3/IDLE.app/Contents/Resources
92mv $IDLERES/idlelib/idle $IDLERES
93
94
95# Finally, build the package...
96rm -rf MacPython-OSX.pkg
97python $PROGDIR/../buildpkg.py \
98 --Title=MacPython-OSX \
99 --Version=$PYVERSION-$BUILDNUM \
100 --Description="Python $PYVERSION for Mac OS X, framework based" \
101 --NeedsAuthorization="YES" \
102 --Relocatable="NO" \
103 --InstallOnly="YES" \
104 $INSTALLROOT \
105 $RESOURCEDIR
106
107## --RootVolumeOnly="YES" \
108
109# ...and then make a disk image containing the package.
110mv MacPython-OSX.pkg $DMGDIR/root
111$PROGDIR/../makedmg $DMGDIR/root $DMGDIR MacPython-OSX-$PYVERSION-$BUILDNUM
112
113echo Moving $DMGDIR/MacPython-OSX-$PYVERSION-$BUILDNUM to $DESTDIR
114mv $DMGDIR/MacPython-OSX-$PYVERSION-$BUILDNUM.dmg $DESTDIR
115
116
117# Cleanup build/install dirs
118if [ $DOCLEANUP = yes ]; then
119 echo "Cleaning up..."
120 rm -rf $BUILDROOT
121 rm -rf $INSTALLROOT
122 rm -rf $DMGDIR
123else
124 echo "Cleanup is disabled. You should remove these dirs when done:"
125 echo " $BUILDROOT"
126 echo " $INSTALLROOT"
127 echo " $DMGDIR"
128fi
129