]> git.saurik.com Git - wxWidgets.git/blame - wxPython/distrib/mac/MacPython/resources/postflight
Compilation fix for MSVC 6 and wxUSE_STL=1.
[wxWidgets.git] / wxPython / distrib / mac / MacPython / resources / postflight
CommitLineData
1e4a197e
RD
1#!/bin/sh
2#----------------------------------------------------------------------
3# Create the unix tools and compile the .py files after Python has been
4# installed.
5#----------------------------------------------------------------------
6
7PYVER=2.3
8
9PKG=$1
10DEST=$2
11
12
13# if destination is / then use usr/local/bin, otherwise just bin
14if [ "$DEST" = "/" ]; then
15 TOOLDIR=/usr/local/bin
16 DEST=
17else
18 TOOLDIR=$DEST/bin
19fi
20
21# Make sure the dir exists
22mkdir -p $TOOLDIR
23
24# Make some links to the python executable
25if [ -e $TOOLDIR/python$PYVER ]; then
26 rm $TOOLDIR/python$PYVER
27fi
28ln -fs $DEST/Library/Frameworks/Python.framework/Versions/$PYVER/bin/python $TOOLDIR/python$PYVER
29
30if [ -e $TOOLDIR/python ]; then
31 rm $TOOLDIR/python
32fi
33ln -fs python$PYVER $TOOLDIR/python
34
35
36# make the pythonw script
37cat > $TOOLDIR/pythonw <<EOF
38#!/bin/sh
39exec "$DEST/Library/Frameworks/Python.framework/Versions/$PYVER/Resources/Python.app/Contents/MacOS/python" "\$@"
40EOF
41chmod +x $TOOLDIR/pythonw
42
43
44# Compile the .py files in the Python library to .pyc's and then .pyo's
45$TOOLDIR/python -Wi -tt \
46 $DEST/Library/Frameworks/Python.framework/Versions/$PYVER/lib/python$PYVER/compileall.py \
47 -x badsyntax -x site-packages $DEST/Library/Frameworks/Python.framework/Versions/$PYVER/lib/python$PYVER
48
49$TOOLDIR/python -Wi -tt -O \
50 $DEST/Library/Frameworks/Python.framework/Versions/$PYVER/lib/python$PYVER/compileall.py \
51 -x badsyntax -x site-packages $DEST/Library/Frameworks/Python.framework/Versions/$PYVER/lib/python$PYVER
52
53
54# Make the site-packages and other dirs writable by the admin.
55for d in $DEST/Library/Frameworks/Python.framework/Versions/$PYVER/lib/python$PYVER/site-packages \
56 $DEST/Library/Frameworks/Python.framework/Versions/$PYVER/bin \
57 $DEST/Applications/MacPython-$PYVER; do
58 chgrp -R admin $d
59 chmod -R g+w $d
60done
61
62
63# The link in the app bundles needs updated.
64for app in BuildApplet IDLE PackageManager PythonIDE; do
65 ln -s $DEST/Library/Frameworks/Python.framework/Versions/$PYVER/Resources/Python.app/Contents/MacOS/python \
66 $DEST/Applications/MacPython-$PYVER/$app.app/Contents/MacOS
67done