File: do-build-windows

package info (click to toggle)
wxwidgets2.8 2.8.10.1-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 239,052 kB
  • ctags: 289,550
  • sloc: cpp: 1,838,857; xml: 396,717; python: 282,506; ansic: 126,171; makefile: 51,406; sh: 14,581; asm: 299; sql: 258; lex: 194; perl: 139; yacc: 128; pascal: 95; php: 39; lisp: 38; tcl: 24; haskell: 20; java: 18; cs: 18; erlang: 17; ruby: 16; ada: 9; ml: 9; csh: 9
file content (187 lines) | stat: -rwxr-xr-x 4,532 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#!/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 6 ]; then
    echo "Usage: $0 WXDIR DESTDIR SKIPCLEAN VERSION PYVER CHARTYPE"
    exit 1
fi

WXDIR=$1
DESTDIR=$2
SKIPCLEAN=$3
VERSION=$4
PYVER=$5
CHARTYPE=$6
CPU=$7

# WXDIR is the cygwin path, WXWIN is the DOS path
WXWIN=`cygpath -w $WXDIR`
export WXWIN
export WXDIR
export TOOLS=/cygdrive/c/TOOLS
export CPU


# setup the environment for the right compiler
if [ $PYVER = 2.3 ]; then
    echo "Using MSVC ver 6"
    . msvcset local 6

elif [ $PYVER = 2.4 -o $PYVER = 2.5 ]; then    
    if [ "$CPU" = "AMD64" ]; then
	echo "Using MSVC ver 7x64"
	. msvcset local 7x64
    else
	echo "Using MSVC ver 7"
	. msvcset local 7
    fi

else # Python 2.6 or later
    if [ "$CPU" = "AMD64" ]; then
	echo "Using MSVC ver 9x64"
	. msvcset local 9x64
    else
	echo "Using MSVC ver 9"
	. msvcset local 9
    fi
fi 
echo "Using compiler located at:" `which cl.exe`


# untar the source 
echo "Unarchiving wxPython-src-$VERSION.tar.bz2"
cd $DESTDIR
tar xjf wxPython-src-$VERSION.tar.bz2
rm wxPython-src-$VERSION.tar.bz2


# 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


. $WXDIR/wxPython/distrib/all/functions.inc

# 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* .
chmod +x .m*

update_setup_h $WXDIR/include/wx/msw

echo "Building the wx DLLs..."
if [ "$CPU" != "AMD64" ]; then
    if [ $CHARTYPE = both -o $CHARTYPE = ansi ]; then
	.make hybrid USE_GDIPLUS=1
    fi
fi
if [ $CHARTYPE = both -o $CHARTYPE = unicode ]; then
    .make hybrid-uni USE_GDIPLUS=1
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

# 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`

# $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


echo "Building the HTMLHelp file..."
cd $WXDIR/docs/html/wx
##cp $DOCDIR/latex/wx/wx.css .
$TOOLS/HTMLHelpWorkshop/hhc.exe wx.hhp || true
mkdir -p ../../htmlhelp
mv wx.chm ../../htmlhelp


echo "Building wxPython and installers..."
cd $WXDIR/wxPython

case $PYVER in
    21 | 2.1) VER=21; shift ;;
    22 | 2.2) VER=22; shift ;;
    23 | 2.3) VER=23; shift ;;
    24 | 2.4) VER=24; shift ;;
    25 | 2.5) VER=25; shift ;;
    26 | 2.6) VER=26; shift ;;

    *) 	VER=25
esac

# export DISTUTILS_DEBUG=1

PYTHON=$TOOLS/python$VER/python.exe
mkdir -p dist
if [ "$CPU" != "AMD64" ]; then
    if [ $CHARTYPE = both -o $CHARTYPE = ansi ]; then
	rm -f wx/*.pyd
	$PYTHON setup.py HYBRID=1 build_ext --inplace UNICODE=0 EP_ADD_OPTS=1
	$PYTHON -u distrib/make_installer.py UNICODE=0
    fi
fi
if [ $CHARTYPE = both -o $CHARTYPE = unicode ]; then
    rm -f wx/*.pyd
    $PYTHON setup.py HYBRID=1 build_ext --inplace UNICODE=1 EP_ADD_OPTS=1
    $PYTHON -u distrib/make_installer.py UNICODE=1
fi


echo "Building the developer package..."
WXWIN=`cygpath -w $WXDIR`
export WXWIN
export CPU
$TOOLS/4dos/4nt.exe /c distrib/makedev.bat $VERSION


echo "Copying installers to $DESTDIR..."
mv dist/wxPython* $DESTDIR
cd $DESTDIR


if [ $SKIPCLEAN != yes ]; then 
    echo "Cleaning up..."
    rm -fr $WXDIR || true
fi

echo "-=-=-=-  Goodbye!  -=-=-=-"