2004-06-14 15:53:50 -04:00
|
|
|
#!/bin/bash
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
# Build wxWidgets and wxPython on a Windows box. This is normally called
|
|
|
|
# from build-all but it should be able to be used standalone too...
|
|
|
|
#
|
|
|
|
# The command line must have the following parameters:
|
|
|
|
#
|
|
|
|
# 1. the path to the base of the wx source tree
|
|
|
|
# 2. the path of where to put the resulting installers
|
|
|
|
# 3. skipclean flag (yes|no)
|
|
|
|
# 4. the VERSION
|
|
|
|
# 5. the remaining args are the versions of Python to build for
|
|
|
|
#
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
#set -o xtrace
|
|
|
|
|
|
|
|
echo "-=-=-=- Hello from $HOSTNAME -=-=-=-"
|
|
|
|
|
|
|
|
if [ $# -lt 5 ]; then
|
|
|
|
echo "Usage: $0 WXDIR DESTDIR SKIPCLEAN VERSION PYVER..."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
WXDIR=$1
|
|
|
|
DESTDIR=$2
|
|
|
|
SKIPCLEAN=$3
|
|
|
|
VERSION=$4
|
|
|
|
shift;shift;shift;shift
|
|
|
|
PYVER=$@
|
|
|
|
|
2004-07-06 16:58:16 -04:00
|
|
|
|
2004-06-14 15:53:50 -04:00
|
|
|
# WXDIR is the cygwin path, WXWIN is the DOS path
|
|
|
|
WXWIN_OLD=$WXWIN
|
2004-07-06 16:58:16 -04:00
|
|
|
WXWIN=`cygpath -m $WXDIR`
|
2004-06-14 15:53:50 -04:00
|
|
|
export WXWIN
|
|
|
|
|
|
|
|
|
2004-07-06 16:58:16 -04:00
|
|
|
# # Fix the PATH. (Why is this needed??)
|
|
|
|
# PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/robind/bin:.:$WXDIR/lib/vc_dll:$PATH
|
|
|
|
# export PATH
|
|
|
|
# echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
|
|
|
|
# echo $PATH
|
|
|
|
# echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
|
|
|
|
# exit 0
|
|
|
|
|
|
|
|
|
|
|
|
# untar the source
|
|
|
|
echo "Unarchiving wxPythonSrc-$VERSION.tar.gz"
|
|
|
|
cd $DESTDIR
|
|
|
|
tar xzf wxPythonSrc-$VERSION.tar.gz
|
|
|
|
rm wxPythonSrc-$VERSION.tar.gz
|
|
|
|
|
|
|
|
|
|
|
|
# Fix line endings
|
|
|
|
echo "Converting wxPython line endings to CRLF..."
|
|
|
|
cd $WXDIR
|
|
|
|
names=`find wxPython -name "*.py" -o -name "*.txt" -o -name "*.htm*" -o -name "*.css" -o -name "*.h" -o -name "*.cpp" -o -name "*.c" -o -name "*.xml" `
|
|
|
|
unix2dos -D $names
|
|
|
|
|
|
|
|
|
|
|
|
# change to the right spot in the source tree and copy our build scripts
|
|
|
|
echo "Setting up for the build..."
|
2004-06-14 15:53:50 -04:00
|
|
|
cd $WXDIR/build/msw
|
|
|
|
cp $WXDIR/wxPython/distrib/msw/.m* .
|
|
|
|
|
2004-07-06 16:58:16 -04:00
|
|
|
|
2004-06-14 15:53:50 -04:00
|
|
|
# replace some settings in setup0.h and write to setup.h
|
|
|
|
cat > .my.sedexpr <<EOF
|
2004-07-06 16:58:16 -04:00
|
|
|
s/wxDIALOG_UNIT_COMPATIBILITY *1/wxDIALOG_UNIT_COMPATIBILITY 0/g
|
2004-06-14 15:53:50 -04:00
|
|
|
s/wxUSE_DEBUG_CONTEXT *0/wxUSE_DEBUG_CONTEXT 1/g
|
|
|
|
s/wxUSE_MEMORY_TRACING *0/wxUSE_MEMORY_TRACING 1/g
|
|
|
|
s/wxUSE_DIALUP_MANAGER *1/wxUSE_DIALUP_MANAGER 0/g
|
|
|
|
s/wxUSE_GLCANVAS *0/wxUSE_GLCANVAS 1/g
|
|
|
|
s/wxUSE_POSTSCRIPT *0/wxUSE_POSTSCRIPT 1/g
|
|
|
|
s/wxUSE_AFM_FOR_POSTSCRIPT *1/wxUSE_AFM_FOR_POSTSCRIPT 0/g
|
|
|
|
s/wxUSE_DISPLAY *0/wxUSE_DISPLAY 1/g
|
|
|
|
EOF
|
|
|
|
cat $WXDIR/include/wx/msw/setup0.h | sed -f .my.sedexpr > $WXDIR/include/wx/msw/setup.h
|
|
|
|
rm .my.sedexpr
|
|
|
|
|
|
|
|
|
|
|
|
echo "Building the wx DLLs..."
|
|
|
|
.make hybrid
|
|
|
|
.make hybrid-uni
|
|
|
|
|
2004-07-06 16:58:16 -04:00
|
|
|
|
2004-06-14 15:53:50 -04:00
|
|
|
echo "Building the wx tools..."
|
|
|
|
.make_tools
|
|
|
|
|
|
|
|
# cheat and just copy the .CHM files from the regular project dir
|
2004-07-06 16:58:16 -04:00
|
|
|
# TODO: Copy over the wxPythonDocs fle and run hhc on the contents of that.
|
2004-06-14 15:53:50 -04:00
|
|
|
mkdir -p $WXDIR/docs/htmlhelp
|
|
|
|
cp `cygpath $WXWIN_OLD/docs/htmlhelp`/*.chm $WXDIR/docs/htmlhelp
|
|
|
|
|
|
|
|
|
|
|
|
echo "Building wxPython and installers..."
|
|
|
|
cd $WXDIR/wxPython
|
2004-06-16 01:18:58 -04:00
|
|
|
mkdir -p dist
|
2004-06-14 15:53:50 -04:00
|
|
|
|
|
|
|
for ver in $PYVER; do
|
|
|
|
echo $ver
|
|
|
|
b $ver d USE_SWIG=0
|
|
|
|
b $ver h USE_SWIG=0
|
|
|
|
b $ver r USE_SWIG=0
|
|
|
|
b $ver d UNICODE=1 USE_SWIG=0
|
|
|
|
b $ver h UNICODE=1 USE_SWIG=0
|
|
|
|
b $ver r UNICODE=1 USE_SWIG=0
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "Building the developer package..."
|
2004-07-06 16:58:16 -04:00
|
|
|
WXWIN=`cygpath -w $WXDIR`
|
|
|
|
export WXWIN
|
2004-06-14 15:53:50 -04:00
|
|
|
4nt /c distrib/makedev.bat $VERSION
|
|
|
|
|
|
|
|
|
|
|
|
echo "Copying installers to $DESTDIR..."
|
|
|
|
mv dist/wxPythonWIN32* $DESTDIR
|
|
|
|
cd $DESTDIR
|
|
|
|
|
|
|
|
|
|
|
|
if [ $SKIPCLEAN != yes ]; then
|
|
|
|
echo "Cleaning up..."
|
2004-06-16 01:27:09 -04:00
|
|
|
rm -r $WXDIR || true
|
2004-06-14 15:53:50 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "-=-=-=- Goodbye! -=-=-=-"
|