2003-03-25 01:35:27 -05:00
#!/bin/sh -e
#----------------------------------------------------------------------
# Build wxMac and wxPythonOSX from the tarball and then make an
# Installer package out of it.
2006-07-05 01:23:28 -04:00
#set -o xtrace
2005-04-04 19:11:25 -04:00
2003-03-25 01:35:27 -05:00
spectemplate=distrib/wxPythonFull.spec.in
if [ ! -d wxPython -o ! -e ${spectemplate} ]; then
echo "Please run this script from the root wxPython directory."
exit 1
fi
2004-06-11 18:50:25 -04:00
if [ "$UID" != "0" ]; then
2004-06-09 03:10:57 -04:00
echo "-------------------------------------------------------"
2005-04-01 20:52:09 -05:00
echo " WARNING: I will be unable to change ownership of files"
2004-06-09 03:10:57 -04:00
echo " unless this script is run as root or via sudo"
echo "-------------------------------------------------------"
fi
2003-03-25 01:35:27 -05:00
#----------------------------------------------------------------------
# Check Parameters
function usage {
echo ""
2006-07-05 01:23:28 -04:00
echo "Usage: $0 PYVER [command flags...]"
2005-04-01 20:52:09 -05:00
echo ""
2006-07-05 01:23:28 -04:00
echo " PYVER Python version to use to do the build. A"
echo " matching python\$PYVER must be found on the PATH"
2004-01-17 18:20:49 -05:00
echo ""
echo "optional command flags:"
2003-03-25 01:35:27 -05:00
echo " skiptar Don't unpack the tarball"
2004-06-11 18:50:25 -04:00
echo " inplace Don't use the tarball, build from the CVS tree instead"
echo " (The Docs and Demo tarballs are still required for a full build.)"
2006-01-27 21:11:22 -05:00
echo " reswig Regenerate SWIG wrappers"
echo " universal Generate Universal wxWidgets binary (requires Universal Python "
echo " to general Universal wxPython)."
2004-10-21 22:50:05 -04:00
echo " unicode Make a unicode build"
2003-03-25 01:35:27 -05:00
echo " skipconfig Don't run configure"
2004-03-12 20:56:23 -05:00
echo " skipbuild Don't build wxWidgets or wxPython"
2003-03-25 01:35:27 -05:00
echo " skipinstall Don't do the installation step"
echo " skipdmg Don't make the package or diskimage"
echo " skipclean Don't do the cleanup at the end"
2004-01-17 18:20:49 -05:00
echo ""
2003-03-25 01:35:27 -05:00
}
2005-04-01 20:52:09 -05:00
PYVER=$1
2006-07-05 01:23:28 -04:00
if [ "$PYVER" != "" ] && which python$PYVER && which pythonw$PYVER; then
2005-04-01 20:52:09 -05:00
PYTHON=`which python$PYVER`
PYTHONW=`which pythonw$PYVER`
else
usage;
exit 1
fi
2006-07-05 01:23:28 -04:00
shift
2003-03-25 01:35:27 -05:00
2004-06-11 18:50:25 -04:00
skiptar=no
skipconfig=no
skipbuild=no
skipinstall=no
skipdmg=no
skipclean=no
inplace=no
2004-10-21 22:50:05 -04:00
unicode=no
2006-07-05 01:23:28 -04:00
debug=no
2006-01-27 21:11:22 -05:00
reswig=no
universal=no
2003-03-25 01:35:27 -05:00
for flag in $*; do
case ${flag} in
2004-06-11 18:50:25 -04:00
skiptar) skiptar=yes ;;
skipconfig) skipconfig=yes; skiptar=yes ;;
skipbuild) skipbuild=yes; skipconfig=yes; skiptar=yes ;;
skipinstall) skipinstall=yes ;;
2006-07-05 01:23:28 -04:00
skipdmg) skipdmg=yes ;;
2004-06-11 18:50:25 -04:00
skipclean) skipclean=yes ;;
inplace) inplace=yes; skiptar=yes ;;
2004-10-21 22:50:05 -04:00
unicode) unicode=yes ;;
2006-07-05 01:23:28 -04:00
ansi) unicode=no ;;
debug) debug=yes ;;
2006-01-27 21:11:22 -05:00
reswig) reswig=yes ;;
universal) universal=yes ;;
2003-03-25 01:35:27 -05:00
*) echo "Unknown flag \"${flag}\""
usage
exit 1
esac
done
2006-07-05 01:23:28 -04:00
OSX_VERSION=`sw_vers -productVersion`
OSX_VERSION=${OSX_VERSION:0:4}
case $OSX_VERSION in
10.4) TAG=macosx10.4 ;;
10.3) TAG=macosx10.3 ;;
10.2) TAG=macosx10.2 ;;
*) usage; exit 1 ;;
esac
if [ $universal = yes ]; then
TAG=universal10.4
fi
2004-01-17 18:20:49 -05:00
VERSION=`$PYTHON -c "import setup;print setup.VERSION"`
2005-04-01 20:52:09 -05:00
SHORTVER=`echo $VERSION | cut -c 1,2,3`
2004-01-17 18:20:49 -05:00
PYPREFIX=`$PYTHON -c "import sys; print sys.exec_prefix"`
2004-01-21 15:53:39 -05:00
PYLIB=$PYPREFIX/lib/python$PYVER
SITEPACKAGES=$PYLIB/site-packages
2004-06-11 18:50:25 -04:00
2004-10-21 22:50:05 -04:00
if [ $unicode == yes ]; then
CHARTYPE=unicode
UNICODEOPT=--enable-unicode
PYUNICODEOPT=1
else
CHARTYPE=ansi
UNICODEOPT=--disable-unicode
PYUNICODEOPT=0
fi
2004-10-15 16:05:01 -04:00
2006-07-05 01:23:28 -04:00
if [ $debug == yes ]; then
DEBUG_FLAG=--enable-debug
PYDEBUGOPT=--debug
else
DEBUG_FLAG=--enable-debug_flag
PYDEBUGOPT=
fi
2005-04-01 20:52:09 -05:00
# Test if the python we are using is the System installed framework
# or one that was installed by the user. This changes where the
# site-packages (or its alias) is located in the installer tree.
APPLE_PYTHON=no
if [ -e /Library/Python/$PYVER ] && [ `dirname $PYTHON` == "/usr/bin" ]; then
APPLE_PYTHON=yes
fi
2004-11-05 22:45:05 -05:00
2004-06-11 18:50:25 -04:00
2004-06-09 03:10:57 -04:00
if [ -z "$TARBALLDIR" ]; then
2004-06-11 18:50:25 -04:00
# this is a spot on my fileserver where the tarballs go, adjust
# as needed for where you put the wxPython tarball, or set
# TARBALLDIR before invoking this script...
2004-06-09 03:10:57 -04:00
TARBALLDIR=/stuff/Development/wxPython/dist/$VERSION
fi
2006-06-01 23:43:46 -04:00
TARBALL=$TARBALLDIR/wxPython-src-$VERSION.tar.bz2
2003-03-25 01:35:27 -05:00
2006-06-01 23:43:46 -04:00
if [ ! -e $TARBALLDIR/wxPython-demo-$VERSION.tar.bz2 ]; then
2004-06-11 18:50:25 -04:00
echo "-------------------------------------------------------"
echo " WARNING: Demo tarball not found, will skip building "
echo " the Demo app bundle and etc."
2006-06-01 23:43:46 -04:00
echo " $TARBALLDIR/wxPython-demo-$VERSION.tar.bz2"
2004-06-11 18:50:25 -04:00
echo "-------------------------------------------------------"
fi
2006-06-01 23:43:46 -04:00
if [ ! -e $TARBALLDIR/wxPython-docs-$VERSION.tar.bz2 ]; then
2004-06-11 18:50:25 -04:00
echo "-------------------------------------------------------"
echo " WARNING: Docs tarball not found, will skip building "
echo " the the wxDocsViewer app bundle and etc."
2006-06-01 23:43:46 -04:00
echo " $TARBALLDIR/wxPython-docs-$VERSION.tar.bz2"
2004-06-11 18:50:25 -04:00
echo "-------------------------------------------------------"
fi
2004-10-21 22:50:05 -04:00
PREFIX=/usr/local/lib/wxPython-$CHARTYPE-$VERSION
2004-06-09 03:10:57 -04:00
BINPREFIX=/usr/local/bin
2003-03-25 01:35:27 -05:00
2006-01-27 21:11:22 -05:00
SWIGBIN=/opt/swig/bin/swig
2004-01-17 18:20:49 -05:00
WXROOT=`dirname $PWD`
2003-03-25 01:35:27 -05:00
PROGDIR="`dirname \"$0\"`"
TMPDIR=$PWD/_build_dmg
BUILDROOT=$TMPDIR/build
2004-10-21 22:50:05 -04:00
INSTALLROOT=$TMPDIR/install-root
INSTALLAPPS=$TMPDIR/install-apps
2003-03-25 01:35:27 -05:00
DMGDIR=$TMPDIR/dmg
2004-10-21 22:50:05 -04:00
DMGROOT=$DMGDIR/root
DMGAPPS=$DMGDIR/apps
2003-03-25 01:35:27 -05:00
RESOURCEDIR=$PROGDIR/resources
DESTDIR=$PWD/dist
2004-10-14 21:13:02 -04:00
SRCROOT=$BUILDROOT/wxPython-src-$VERSION
2003-03-25 01:35:27 -05:00
#----------------------------------------------------------------------
# Setup builddirs
mkdir -p $BUILDROOT
mkdir -p $INSTALLROOT
2004-10-21 22:50:05 -04:00
mkdir -p $INSTALLAPPS
2003-03-25 01:35:27 -05:00
rm -rf $DMGDIR
2004-10-21 22:50:05 -04:00
mkdir -p $DMGROOT
mkdir -p $DMGAPPS/Docs
mkdir -p $DMGAPPS/Samples
2004-03-12 20:56:23 -05:00
2005-09-21 00:37:32 -04:00
if [ ! -d $DESTDIR ]; then
mkdir $DESTDIR
fi
2003-03-25 01:35:27 -05:00
pushd $BUILDROOT
#----------------------------------------------------------------------
# Unpack the tarball
2004-06-11 18:50:25 -04:00
if [ $skiptar != yes ]; then
2004-01-17 18:20:49 -05:00
echo Unarchiving tarball...
2006-06-01 23:43:46 -04:00
tar xjf $TARBALL
2003-03-25 01:35:27 -05:00
fi
2004-06-11 18:50:25 -04:00
if [ $inplace = no ]; then
# make a build dir and cd to it.
2004-10-14 21:13:02 -04:00
cd wxPython-src-$VERSION
2004-06-11 18:50:25 -04:00
WXDIR=`pwd`
mkdir -p $WXDIR/bld
cd $WXDIR/bld
WXBLD=$WXDIR/bld
else
2004-11-04 16:55:00 -05:00
# If building "inplace" then our build dir will be off of the
# WXROOT like normal, adjust the variables to find things that
# way.
WXBLD=$WXROOT/build-$CHARTYPE
mkdir -p $WXBLD
cd $WXBLD
WXDIR=..
2004-06-11 18:50:25 -04:00
SRCROOT=$WXROOT
fi
2004-11-04 16:55:00 -05:00
echo "Using wx root dir: $WXROOT"
2004-06-11 18:50:25 -04:00
echo "Using build dir: $WXBLD"
2004-11-04 16:55:00 -05:00
echo "Using source tree: $WXDIR"
2003-03-25 01:35:27 -05:00
#----------------------------------------------------------------------
2006-07-05 01:23:28 -04:00
if [ $OSX_VERSION = 10.3 -o $OSX_VERSION = 10.4 ]; then
2005-03-07 13:28:20 -05:00
OTHER_CFG_OPTS=--enable-mediactrl
fi
2003-03-25 01:35:27 -05:00
2004-03-12 20:56:23 -05:00
# Configure wxWidgets
2006-07-05 01:23:28 -04:00
if [ $skipconfig != yes -a $universal != yes ]; then
2004-06-11 18:50:25 -04:00
$WXDIR/configure \
2004-01-17 18:20:49 -05:00
--prefix=$PREFIX \
--with-mac \
2004-08-09 19:26:03 -04:00
--enable-monolithic \
2003-03-25 01:35:27 -05:00
--with-opengl \
2004-03-09 22:16:48 -05:00
--enable-sound \
--enable-display \
2004-03-13 01:10:26 -05:00
--enable-geometry \
2006-10-11 02:44:51 -04:00
--enable-graphics_ctx \
2006-07-05 01:23:28 -04:00
$DEBUG_FLAG \
2004-01-17 18:20:49 -05:00
--enable-precomp=no \
2004-10-14 21:13:02 -04:00
--enable-optimise \
2005-03-12 16:00:19 -05:00
--disable-debugreport \
2006-01-27 21:11:22 -05:00
--disable-precompiled-headers \
2006-07-05 01:23:28 -04:00
$UNICODEOPT $OTHER_CFG_OPTS
2004-03-13 01:10:26 -05:00
2003-03-25 01:35:27 -05:00
fi
2004-03-12 20:56:23 -05:00
# Build wxWidgets and wxPython
2004-06-11 18:50:25 -04:00
if [ $skipbuild != yes ]; then
2003-03-25 01:35:27 -05:00
2004-03-12 20:56:23 -05:00
# Make wxWidgets and some contribs
2006-07-05 01:23:28 -04:00
WXBLD_CONFIG="$WXBLD/wx-config"
if [ $universal = yes ]; then
export WXROOT
export BUILDPREFIX=$PREFIX
export INSTALLDIR=$INSTALLROOT$PREFIX
$WXDIR/distrib/scripts/mac/macbuild wxpython universal $CHARTYPE
else
make $MAKEJOBS
make $MAKEJOBS -C contrib/src/gizmos
make $MAKEJOBS -C contrib/src/stc
fi
SWIGIT=0
if [ $reswig = yes ]; then
SWIGIT=1
fi
2006-01-27 21:11:22 -05:00
2004-01-17 18:20:49 -05:00
# Build wxPython
2004-11-04 16:55:00 -05:00
cd $WXROOT/wxPython
2004-01-17 18:20:49 -05:00
$PYTHON setup.py \
2004-10-21 22:50:05 -04:00
UNICODE=$PYUNICODEOPT \
2004-01-17 18:20:49 -05:00
NO_SCRIPTS=1 \
2004-10-14 21:13:02 -04:00
EP_ADD_OPTS=1 \
2006-07-05 01:23:28 -04:00
WX_CONFIG="$WXBLD_CONFIG --inplace" \
2004-06-11 18:50:25 -04:00
BUILD_BASE=$WXBLD/wxPython \
2006-01-27 21:11:22 -05:00
SWIG=$SWIGBIN \
USE_SWIG=$SWIGIT \
2003-03-25 01:35:27 -05:00
build
fi
#----------------------------------------------------------------------
2004-06-11 18:50:25 -04:00
if [ $skipinstall != yes ]; then
2004-03-12 20:56:23 -05:00
# Install wxWidgets
2004-06-11 18:50:25 -04:00
cd $WXBLD
2006-07-05 01:23:28 -04:00
if [ $universal != yes ]; then
make prefix=$INSTALLROOT$PREFIX install
make -C contrib/src/gizmos prefix=$INSTALLROOT$PREFIX install
make -C contrib/src/stc prefix=$INSTALLROOT$PREFIX install
fi
2003-03-25 01:35:27 -05:00
2004-10-14 21:13:02 -04:00
# relink wx-config with a relative link
cd $INSTALLROOT$PREFIX/bin
rm wx-config
ln -s ../lib/wx/config/* wx-config
2003-03-25 01:35:27 -05:00
# and wxPython
2004-11-04 16:55:00 -05:00
cd $WXROOT/wxPython
2004-01-17 18:20:49 -05:00
$PYTHON setup.py \
2004-10-21 22:50:05 -04:00
UNICODE=$PYUNICODEOPT \
2004-01-17 18:20:49 -05:00
NO_SCRIPTS=1 \
2004-10-14 21:13:02 -04:00
EP_ADD_OPTS=1 \
2006-07-05 01:23:28 -04:00
WX_CONFIG="$INSTALLROOT$PREFIX/bin/wx-config --prefix=$INSTALLROOT$PREFIX" \
2004-06-11 18:50:25 -04:00
BUILD_BASE=$WXBLD/wxPython \
2003-03-25 01:35:27 -05:00
install \
--root=$INSTALLROOT
2004-01-17 18:20:49 -05:00
2005-04-01 20:52:09 -05:00
# Apple's Python Framework (such as what comes with Panther)
# sym-links the site-packages dir in the framework to
2004-01-21 15:53:39 -05:00
# /Library/Python/$PYVER so we need to move the files so they are
# installed in the physical location, not the virtual one.
2005-04-01 20:52:09 -05:00
if [ $APPLE_PYTHON == yes ]; then
2004-06-11 18:50:25 -04:00
if [ -e $INSTALLROOT/Library/Python/$PYVER ]; then
rm -r $INSTALLROOT/Library/Python/$PYVER
fi
2004-01-21 15:53:39 -05:00
mkdir -p $INSTALLROOT/Library/Python/$PYVER
mv $INSTALLROOT/$SITEPACKAGES/* $INSTALLROOT/Library/Python/$PYVER
rm -r $INSTALLROOT/System
SITEPACKAGES=/Library/Python/$PYVER
fi
2004-10-23 20:17:57 -04:00
# install wxPython's tool scripts
mkdir -p $INSTALLROOT$BINPREFIX
2004-11-04 16:55:00 -05:00
cd $WXROOT/wxPython/scripts
2004-10-23 20:17:57 -04:00
python$PYVER CreateMacScripts.py $INSTALLROOT $BINPREFIX
2004-10-21 22:50:05 -04:00
2003-03-25 01:35:27 -05:00
2004-10-21 22:50:05 -04:00
# Remove the .pyc/.pyo files they just take up space and can be recreated
# during the install.
2004-11-04 16:55:00 -05:00
pushd $WXROOT/wxPython
2004-10-21 22:50:05 -04:00
$PYTHON $PROGDIR/../zappycfiles.py $INSTALLROOT > /dev/null
popd
2004-01-21 15:53:39 -05:00
2004-10-23 20:17:57 -04:00
# Set premissions for files in $INSTALLROOT
2004-06-09 03:10:57 -04:00
if [ "$UID" = "0" ]; then
2004-10-23 20:17:57 -04:00
chown -R root:admin $INSTALLROOT
chmod -R g+w $INSTALLROOT
2004-06-09 03:10:57 -04:00
fi
2003-03-25 01:35:27 -05:00
fi
2005-04-01 20:52:09 -05:00
if [ $APPLE_PYTHON == yes ]; then
2004-10-21 22:50:05 -04:00
SITEPACKAGES=/Library/Python/$PYVER
fi
2004-10-23 20:17:57 -04:00
PKGDIR=`cat $INSTALLROOT$SITEPACKAGES/wx.pth`
2004-10-14 21:13:02 -04:00
2003-03-25 01:35:27 -05:00
popd
#----------------------------------------------------------------------
# Make the Installer packages and disk image
2004-06-11 18:50:25 -04:00
if [ $skipdmg != yes ]; then
2003-03-25 01:35:27 -05:00
2004-10-21 22:50:05 -04:00
#-----------------------------------------------
# The main runtime installer package
2003-03-25 01:35:27 -05:00
# Make the welcome message
2006-07-05 01:23:28 -04:00
case $OSX_VERSION in
10.4) W_MSG="the Tiger (OS X 10.4.x Intel) version of" ;;
10.3) W_MSG="the Panther (OS X 10.3.x) version of" ;;
10.2) W_MSG="the Jaguar (OS X 10.2.x) version of" ;;
2004-01-17 18:20:49 -05:00
esac
2006-07-05 01:23:28 -04:00
if [ $universal == yes ]; then
W_MSG="the Universal (OS X 10.4.x and above) version of"
fi
2004-10-21 22:50:05 -04:00
2003-03-25 01:35:27 -05:00
cat > $RESOURCEDIR/Welcome.txt <<EOF
Welcome!
2004-10-21 22:50:05 -04:00
This Installer package will install the wxPython $CHARTYPE runtime $VERSION for $W_MSG MacPython-OSX $PYVER. This includes:
2003-03-25 01:35:27 -05:00
2004-10-21 22:50:05 -04:00
* The wxPython packages and modules
* The wxWidgets shared libraries and headers
2004-10-23 20:17:57 -04:00
* Some command line tool scripts, installed to /usr/local/bin.
2004-10-21 22:50:05 -04:00
You must install onto your current boot disk, eventhough the installer does not enforce this, otherwise things will not work.
2004-10-23 20:17:57 -04:00
You can install more than one version of the wxPython runtime if you desire. The most recently installed version will be the default wxPython, but you can choose another by setting the PYTHONPATH or by using the wxversion module. See http://wiki.wxpython.org/index.cgi/MultiVersionInstalls for more details.
2004-01-21 15:53:39 -05:00
2003-03-25 01:35:27 -05:00
Build date: `date`
EOF
# make the preflight script
cat > $RESOURCEDIR/preflight <<EOF
#!/bin/sh
# Cleanup any old install of the wxPython package
rm -rf \$2$SITEPACKAGES/wxPython
2004-01-17 18:20:49 -05:00
rm -rf \$2$SITEPACKAGES/wx
2004-10-14 21:13:02 -04:00
rm -rf \$2$SITEPACKAGES/$PKGDIR
2003-03-25 01:35:27 -05:00
exit 0
EOF
chmod +x $RESOURCEDIR/preflight
# make the postflight script
cat > $RESOURCEDIR/postflight <<EOF
#!/bin/sh -e
# Compile the .py files in the wxPython pacakge
2004-10-14 21:13:02 -04:00
$PYTHON \$2$PYLIB/compileall.py \$2$SITEPACKAGES/$PKGDIR
$PYTHON -O \$2$PYLIB/compileall.py \$2$SITEPACKAGES/$PKGDIR
2003-03-25 01:35:27 -05:00
2004-01-21 15:53:39 -05:00
# and all of the wxPython pacakge should be group writable
2004-10-14 21:13:02 -04:00
chgrp -R admin \$2$SITEPACKAGES/$PKGDIR
chmod -R g+w \$2$SITEPACKAGES/$PKGDIR
2003-03-25 01:35:27 -05:00
exit 0
EOF
chmod +x $RESOURCEDIR/postflight
2004-10-21 22:50:05 -04:00
2003-03-25 01:35:27 -05:00
2004-01-21 15:53:39 -05:00
# Build the main Installer Package...
2006-07-05 01:23:28 -04:00
PKGNAME=wxPython${SHORTVER}-osx-$CHARTYPE-$TAG
2005-04-04 19:11:25 -04:00
if [ $PYVER != 2.3 ]; then
2006-07-05 01:23:28 -04:00
PKGNAME=wxPython${SHORTVER}-osx-$CHARTYPE-$TAG-py$PYVER
2005-04-04 19:11:25 -04:00
fi
rm -rf $PKGNAME.pkg
$PYTHON $PROGDIR/../buildpkg.py \
--Title=$PKGNAME \
2003-03-25 01:35:27 -05:00
--Version=$VERSION \
2004-10-21 22:50:05 -04:00
--Description="wxPython $CHARTYPE runtime $VERSION for $W_MSG MacPython-OSX $PYVER" \
2003-03-25 01:35:27 -05:00
--NeedsAuthorization="YES" \
--Relocatable="NO" \
--InstallOnly="YES" \
$INSTALLROOT \
$RESOURCEDIR
2005-12-30 18:02:03 -05:00
mv $PKGNAME.pkg $DMGROOT/$PKGNAME.pkg
2003-03-25 01:35:27 -05:00
2004-10-21 22:50:05 -04:00
rm $RESOURCEDIR/postflight
rm $RESOURCEDIR/preflight
rm $RESOURCEDIR/Welcome.txt
2003-03-25 01:35:27 -05:00
2004-10-21 22:50:05 -04:00
#-----------------------------------------------
# Make a README to go on the disk image
cat > "$DMGROOT/README 1st.txt" <<EOF
2004-01-17 18:20:49 -05:00
Welcome to wxPython!
2004-10-21 22:50:05 -04:00
This disk image contains the following items:
wxPython${SHORTVER}-osx-$CHARTYPE-$VERSION-$KIND
2004-10-23 20:17:57 -04:00
This Installer contains the wxPython runtime, compiled on a
$KIND OS X system, using the $CHARTYPE build of the wxWidgets
library. It includes the Python modules and extension
modules, as well as the wxWidgets libraries.
2004-01-17 18:20:49 -05:00
2004-10-23 20:17:57 -04:00
It is possible to have more than one version of the runtime
installed at once if you wish. The most recently installed
version will be the default wxPython, but you can choose
another by setting the PYTHONPATH or by using the wxversion
module. For more details see:
http://wiki.wxpython.org/index.cgi/MultiVersionInstalls
2004-10-21 22:50:05 -04:00
uninstall_wxPython.py
A simple tool to help you manage your installed versions of
wxPython. It will allow you to choose from the currently
installed wxPython packages and to select one for
uninstallation. It is a text-mode tool so you can either run
it from a Terminal command line, or you can open it with
PythonLauncher and let it create a Terminal to run it in.
2004-11-04 16:55:00 -05:00
NOTE: If you have versions prior to 2.5.3.1 installed, please
do run this uninstall tool to remove the older version.
2004-10-21 22:50:05 -04:00
EOF
cp $PROGDIR/../uninstall_wxPython.py $DMGROOT
#-----------------------------------------------
# Make a disk image to hold these files
2005-04-01 20:52:09 -05:00
dmgname=wxPython${SHORTVER}-osx-$CHARTYPE-$VERSION-$TAG-py$PYVER
2004-10-21 22:50:05 -04:00
$PROGDIR/../makedmg $DMGROOT $DMGDIR $dmgname
echo Moving $DMGDIR/$dmgname.dmg to $DESTDIR
2005-09-21 00:37:32 -04:00
mv $DMGDIR/$dmgname.dmg $DESTDIR/$dmgname.dmg
2004-10-21 22:50:05 -04:00
#---------------------------------------------------------------------------
# Now create app bundles for the demo, docs, and tools and make another
# disk image to hold it all.
#---------------------------------------------------------------------------
cat > "$DMGAPPS/README 1st.txt" <<EOF
Welcome to wxPython!
2003-03-25 01:35:27 -05:00
2004-10-21 22:50:05 -04:00
On this disk image you will find Demo, Tools, Docs, and etc. for
wxPython $VERSION. Everything here is optional and you can drag them
out of the disk image and drop them wherever you want. You will need
to have an installed wxPython runtime to be able to use any of them.
2003-03-25 01:35:27 -05:00
2004-01-17 18:20:49 -05:00
2004-10-21 22:50:05 -04:00
wxPython Demo An application bundle version of the demo.
(This has it's own copy of the demo sources
within the bundle.)
2004-01-21 15:53:39 -05:00
2004-10-21 22:50:05 -04:00
XRCed An application for editing wxPython resource
2004-01-21 15:53:39 -05:00
files (XRC files.)
2004-10-21 22:50:05 -04:00
PyCrust An application that provides an interactive
2004-01-21 15:53:39 -05:00
Python shell and also namespace inspectors.
2004-03-12 20:56:23 -05:00
2004-06-11 18:50:25 -04:00
Docs/wxDocsViewer An application that allows you to view the
2004-03-26 00:31:31 -05:00
wxWidgets documentation.
2004-03-12 20:56:23 -05:00
Docs/licence License files.
2004-06-11 18:50:25 -04:00
Docs/other A few readmes, change log, etc.
2004-03-12 20:56:23 -05:00
2004-06-11 18:50:25 -04:00
Samples/samples Several small sample applications that
2004-03-12 20:56:23 -05:00
demonstrate how to use wxPython.
2004-06-11 18:50:25 -04:00
Samples/demo A copy of the wxPython demo source code,
2004-03-12 20:56:23 -05:00
just open the folder and run demo.pyw.
2003-03-25 01:35:27 -05:00
Happy Hacking!
EOF
2004-06-11 18:50:25 -04:00
# PyAlaMode An extension of PyCrust that includes source
2004-01-21 15:53:39 -05:00
# file editing capabilities.
2003-03-25 01:35:27 -05:00
2004-03-12 20:56:23 -05:00
# wxDocs
2006-06-01 23:43:46 -04:00
if [ ! -e $TARBALLDIR/wxPython-docs-$VERSION.tar.bz2 ]; then
2004-10-21 22:50:05 -04:00
cat > "$DMGAPPS/Docs/Build ERROR.txt" <<EOF
2004-03-26 00:31:31 -05:00
2004-10-14 21:13:02 -04:00
The wxPython-docs tarball was not found when building this disk image!
2004-06-11 18:50:25 -04:00
EOF
else
pushd $BUILDROOT
2006-06-01 23:43:46 -04:00
tar xjvf $TARBALLDIR/wxPython-docs-$VERSION.tar.bz2
2004-06-11 18:50:25 -04:00
popd
2004-03-26 00:31:31 -05:00
2004-06-11 18:50:25 -04:00
# Make an app to launch viewdocs.py
$PYTHONW $PROGDIR/../buildapp.py \
2004-10-21 22:50:05 -04:00
--builddir=$DMGAPPS/Docs \
2004-06-11 18:50:25 -04:00
--name=wxDocsViewer \
--mainprogram=$BUILDROOT/wxPython-$VERSION/docs/viewdocs.py \
--iconfile=$PROGDIR/Info.icns \
build
2004-03-26 00:31:31 -05:00
2004-10-21 22:50:05 -04:00
cp $BUILDROOT/wxPython-$VERSION/docs/*.zip $DMGAPPS/Docs/wxDocsViewer.app/Contents/Resources
2004-06-11 18:50:25 -04:00
2004-10-21 22:50:05 -04:00
cat > "$DMGAPPS/Docs/README 1st.txt" <<EOF
2004-03-26 00:31:31 -05:00
The wxDocsViewer application needs to be copied to your Desktop (or
someplace else you have write access to) before you can run it, so it
can cache some indexes within its bundle.
EOF
2004-01-17 18:20:49 -05:00
2004-06-11 18:50:25 -04:00
fi
2004-03-12 20:56:23 -05:00
# license files, docs, etc.
2004-10-21 22:50:05 -04:00
pushd $DMGAPPS/Docs
2004-03-12 20:56:23 -05:00
cp -pR $SRCROOT/wxPython/licence .
cp -pR $SRCROOT/wxPython/docs .
rm -rf docs/bin
rm -rf docs/xml-raw
mv docs other
popd
2004-06-11 18:50:25 -04:00
2006-06-01 23:43:46 -04:00
if [ ! -e $TARBALLDIR/wxPython-demo-$VERSION.tar.bz2 ]; then
2004-10-21 22:50:05 -04:00
cat > "$DMGAPPS/Samples/Build ERROR.txt" <<EOF
2004-06-11 18:50:25 -04:00
2005-12-30 18:02:03 -05:00
The wxPython-$VERSION-demo tarball was not found when building this disk image!
2004-06-11 18:50:25 -04:00
EOF
2004-10-21 22:50:05 -04:00
cp "$DMGAPPS/Samples/Build ERROR.txt" $DMGAPPS
2004-06-11 18:50:25 -04:00
else
# Copy the demo and samples to the disk image from the tarball
2004-10-21 22:50:05 -04:00
pushd $DMGAPPS/Samples
2006-06-01 23:43:46 -04:00
tar xjvf $TARBALLDIR/wxPython-demo-$VERSION.tar.bz2
2004-06-11 18:50:25 -04:00
mv wxPython-$VERSION/* .
rm -rf wxPython-$VERSION
2006-07-05 01:23:28 -04:00
rm -f demo/b demo/.setup.sh
2004-06-11 18:50:25 -04:00
mv demo/demo.py demo/demo.pyw
popd
# Make an app bundle to run the demo
$PYTHONW $PROGDIR/../buildapp.py \
2004-10-21 22:50:05 -04:00
--builddir=$DMGAPPS \
2004-06-11 18:50:25 -04:00
--name="wxPython Demo" \
2004-10-21 22:50:05 -04:00
--mainprogram=$DMGAPPS/Samples/demo/demo.pyw \
2004-06-11 18:50:25 -04:00
--iconfile=$PROGDIR/RunDemo.icns \
build
2004-10-21 22:50:05 -04:00
cp -pR $DMGAPPS/Samples/demo/* "$DMGAPPS/wxPython Demo.app/Contents/Resources"
2004-06-11 18:50:25 -04:00
fi
2004-03-12 20:56:23 -05:00
2004-01-17 18:20:49 -05:00
# Make an app bundle to launch PyCrust
$PYTHONW $PROGDIR/../buildapp.py \
2004-10-21 22:50:05 -04:00
--builddir=$DMGAPPS \
2004-01-17 18:20:49 -05:00
--name=PyCrust \
2004-10-23 20:17:57 -04:00
--mainprogram=$INSTALLROOT$BINPREFIX/pycrust.py \
2004-01-17 18:20:49 -05:00
--iconfile=$PROGDIR/PieShell.icns \
build
2004-10-23 20:17:57 -04:00
## TODO: PyAlaMode needs tweaked to be able to run from a bundle. It
## needs to know to ignore command line parameters and etc...
2004-10-21 22:50:05 -04:00
# # and PyAlaMode
# $PYTHONW $PROGDIR/../buildapp.py \
# --builddir=$DMGAPPS \
# --name=PyAlaMode \
2004-10-23 20:17:57 -04:00
# --mainprogram=$INSTALLROOT$BINPREFIX/pyalamode.py \
2004-10-21 22:50:05 -04:00
# --iconfile=$PROGDIR/PieShell.icns \
# build
2004-01-21 15:53:39 -05:00
2004-01-17 18:20:49 -05:00
# Make an app to launch XRCed
$PYTHONW $PROGDIR/../buildapp.py \
2004-10-21 22:50:05 -04:00
--builddir=$DMGAPPS \
2004-01-17 18:20:49 -05:00
--name=XRCed \
2004-10-23 20:17:57 -04:00
--mainprogram=$INSTALLROOT$BINPREFIX/xrced.py \
2004-01-17 18:20:49 -05:00
--iconfile=$PROGDIR/XRCed.icns \
build
2004-06-11 18:50:25 -04:00
2003-03-25 01:35:27 -05:00
2004-10-21 22:50:05 -04:00
# and then finally make a disk image containing everything
2005-04-04 19:11:25 -04:00
dmgname=wxPython${SHORTVER}-osx-docs-demos-$VERSION-$TAG-py$PYVER
2004-10-21 22:50:05 -04:00
$PROGDIR/../makedmg $DMGAPPS $DMGDIR $dmgname
2003-03-25 01:35:27 -05:00
2004-10-21 22:50:05 -04:00
echo Moving $DMGDIR/$dmgname.dmg to $DESTDIR
2005-09-21 00:37:32 -04:00
mv $DMGDIR/$dmgname.dmg $DESTDIR/$dmgname.dmg
2003-03-25 01:35:27 -05:00
fi
# Cleanup build/install dirs
2004-06-11 18:50:25 -04:00
if [ $skipclean != yes ]; then
2003-03-25 01:35:27 -05:00
echo "Cleaning up..."
rm -rf $TMPDIR
else
echo "Cleanup is disabled. You should remove $TMPDIR when finished"
fi
2006-07-05 01:23:28 -04:00
exit 0