2004-11-08 18:55:25 -05: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 -=-=-=-"
|
|
|
|
|
2006-07-12 22:40:46 -04:00
|
|
|
if [ $# -lt 6 ]; then
|
|
|
|
echo "Usage: $0 WXDIR DESTDIR SKIPCLEAN VERSION PYVER CHARTYPE"
|
2004-11-08 18:55:25 -05:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
WXDIR=$1
|
|
|
|
DESTDIR=$2
|
|
|
|
SKIPCLEAN=$3
|
|
|
|
VERSION=$4
|
2005-02-24 14:50:53 -05:00
|
|
|
PYVER=$5
|
2006-07-12 22:40:46 -04:00
|
|
|
CHARTYPE=$6
|
2004-11-08 18:55:25 -05:00
|
|
|
|
|
|
|
# WXDIR is the cygwin path, WXWIN is the DOS path
|
|
|
|
WXWIN=`cygpath -w $WXDIR`
|
|
|
|
export WXWIN
|
2006-07-05 01:23:28 -04:00
|
|
|
export WXDIR
|
|
|
|
export TOOLS=/cygdrive/c/TOOLS
|
2004-11-08 18:55:25 -05:00
|
|
|
|
|
|
|
|
2005-02-24 14:50:53 -05:00
|
|
|
# setup the compiler
|
|
|
|
if [ $PYVER = 2.3 ]; then
|
|
|
|
echo "Using MSVC ver 6"
|
|
|
|
. msvcset local 6
|
|
|
|
echo `which cl.exe`
|
|
|
|
else
|
|
|
|
echo "Using MSVC ver 7"
|
|
|
|
. msvcset local 7
|
|
|
|
echo `which cl.exe`
|
|
|
|
fi
|
|
|
|
|
2004-11-08 18:55:25 -05:00
|
|
|
|
|
|
|
# untar the source
|
2006-06-01 23:43:46 -04:00
|
|
|
echo "Unarchiving wxPython-src-$VERSION.tar.bz2"
|
2004-11-08 18:55:25 -05:00
|
|
|
cd $DESTDIR
|
2006-06-01 23:43:46 -04:00
|
|
|
tar xjf wxPython-src-$VERSION.tar.bz2
|
|
|
|
rm wxPython-src-$VERSION.tar.bz2
|
2004-11-08 18:55:25 -05:00
|
|
|
|
|
|
|
|
|
|
|
# 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 "*.xml" `
|
|
|
|
unix2dos -D $names
|
|
|
|
|
|
|
|
|
|
|
|
# change to the right spot in the source tree and copy our build scripts
|
|
|
|
echo "Setting up for the build..."
|
|
|
|
cd $WXDIR/build/msw
|
|
|
|
cp $WXDIR/wxPython/distrib/msw/.m* .
|
2005-02-24 14:50:53 -05:00
|
|
|
chmod +x .m*
|
2004-11-08 18:55:25 -05:00
|
|
|
|
|
|
|
|
|
|
|
# replace some settings in setup0.h and write to setup.h
|
|
|
|
cat > .my.sedexpr <<EOF
|
|
|
|
s/wxDIALOG_UNIT_COMPATIBILITY *1/wxDIALOG_UNIT_COMPATIBILITY 0/g
|
2005-02-28 14:31:49 -05:00
|
|
|
s/wxUSE_EXCEPTIONS *1/wxUSE_EXCEPTIONS 0/g
|
2004-11-08 18:55:25 -05: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
|
2005-02-28 14:31:49 -05:00
|
|
|
s/wxUSE_DIB_FOR_BITMAP *0/wxUSE_DIB_FOR_BITMAP 1/g
|
2005-05-09 11:53:09 -04:00
|
|
|
s/wxUSE_DEBUGREPORT *1/wxUSE_DEBUGREPORT 0/g
|
2004-11-08 18:55:25 -05:00
|
|
|
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..."
|
2006-07-12 22:40:46 -04:00
|
|
|
if [ $CHARTYPE = both -o $CHARTYPE = ansi ]; then
|
|
|
|
.make hybrid
|
|
|
|
fi
|
|
|
|
if [ $CHARTYPE = both -o $CHARTYPE = unicode ]; then
|
|
|
|
.make hybrid-uni
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# echo "Building tex2rtf..."
|
|
|
|
# cd $WXDIR/utils/tex2rtf/src
|
|
|
|
# $WXDIR/build/msw/.mymake hybrid
|
|
|
|
# cp vc_mswhdll/tex2rtf.exe $WXDIR/lib/vc_dll/tex2rtf.exe
|
2004-11-08 18:55:25 -05:00
|
|
|
|
2006-07-12 22:40:46 -04:00
|
|
|
# echo "Translating docs to html..."
|
|
|
|
# DOCDIR=$WXDIR/docs
|
|
|
|
# cd $DOCDIR/latex/wx
|
|
|
|
# mkdir -p $DOCDIR/html/wx
|
|
|
|
# cp *.gif $DOCDIR/html/wx
|
|
|
|
# cp *.css $DOCDIR/html/wx
|
|
|
|
# DOCSRC=`cygpath -w $DOCDIR/latex/wx/manual.tex`
|
|
|
|
# DOCDEST=`cygpath -w $DOCDIR/html/wx/wx.htm`
|
|
|
|
# DOCINI=`cygpath -w $DOCDIR/latex/wx/tex2rtf_css.ini`
|
2004-11-08 18:55:25 -05:00
|
|
|
|
2006-07-12 22:40:46 -04:00
|
|
|
# $WXDIR/lib/vc_dll/tex2rtf.exe $DOCSRC $DOCDEST -twice -html -macros $DOCINI
|
|
|
|
|
|
|
|
|
|
|
|
echo "Extracting html docs..."
|
|
|
|
mkdir -p $WXDIR/docs/html/wx
|
|
|
|
cd $WXDIR/docs/html/wx
|
|
|
|
rm -rf *
|
|
|
|
tar xjf $DESTDIR/wxPython-docs-$VERSION.tar.bz2
|
|
|
|
rm $DESTDIR/wxPython-docs-$VERSION.tar.bz2
|
|
|
|
unzip wxPython-$VERSION/docs/wx.zip
|
2006-07-05 01:23:28 -04:00
|
|
|
|
|
|
|
echo "Building the HTMLHelp file..."
|
2006-07-12 22:40:46 -04:00
|
|
|
cd $WXDIR/docs/html/wx
|
|
|
|
##cp $DOCDIR/latex/wx/wx.css .
|
2006-07-05 01:23:28 -04:00
|
|
|
$TOOLS/HTMLHelpWorkshop/hhc.exe wx.hhp || true
|
|
|
|
mkdir -p ../../htmlhelp
|
|
|
|
mv wx.chm ../../htmlhelp
|
|
|
|
|
|
|
|
|
2004-11-08 18:55:25 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "Building wxPython and installers..."
|
|
|
|
cd $WXDIR/wxPython
|
|
|
|
mkdir -p dist
|
2006-07-12 22:40:46 -04:00
|
|
|
if [ $CHARTYPE = both -o $CHARTYPE = ansi ]; then
|
|
|
|
b $PYVER d UNICODE=0 USE_SWIG=0
|
|
|
|
b $PYVER h UNICODE=0 USE_SWIG=0 EP_ADD_OPTS=1
|
|
|
|
b $PYVER r UNICODE=0 USE_SWIG=0
|
|
|
|
fi
|
|
|
|
if [ $CHARTYPE = both -o $CHARTYPE = unicode ]; then
|
|
|
|
b $PYVER d UNICODE=1 USE_SWIG=0
|
|
|
|
b $PYVER h UNICODE=1 USE_SWIG=0 EP_ADD_OPTS=1
|
|
|
|
b $PYVER r UNICODE=1 USE_SWIG=0
|
|
|
|
fi
|
2004-11-08 18:55:25 -05:00
|
|
|
|
|
|
|
echo "Building the developer package..."
|
|
|
|
WXWIN=`cygpath -w $WXDIR`
|
|
|
|
export WXWIN
|
2006-07-05 01:23:28 -04:00
|
|
|
$TOOLS/4dos/4nt /c distrib/makedev.bat $VERSION
|
2004-11-08 18:55:25 -05:00
|
|
|
|
|
|
|
|
|
|
|
echo "Copying installers to $DESTDIR..."
|
|
|
|
mv dist/wxPython* $DESTDIR
|
|
|
|
cd $DESTDIR
|
|
|
|
|
|
|
|
|
|
|
|
if [ $SKIPCLEAN != yes ]; then
|
|
|
|
echo "Cleaning up..."
|
|
|
|
rm -r $WXDIR || true
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "-=-=-=- Goodbye! -=-=-=-"
|