]>
Commit | Line | Data |
---|---|---|
e4bb5998 RD |
1 | #!/bin/bash |
2 | # --------------------------------------------------------------------------- | |
3 | # Build wxWidgets and wxPython on a Windows box. This is normally called | |
4 | # from build-all but it should be able to be used standalone too... | |
5 | # | |
6 | # The command line must have the following parameters: | |
7 | # | |
8 | # 1. the path to the base of the wx source tree | |
9 | # 2. the path of where to put the resulting installers | |
10 | # 3. skipclean flag (yes|no) | |
11 | # 4. the VERSION | |
12 | # 5. the remaining args are the versions of Python to build for | |
13 | # | |
14 | # --------------------------------------------------------------------------- | |
15 | ||
16 | set -o errexit | |
17 | #set -o xtrace | |
18 | ||
19 | echo "-=-=-=- Hello from $HOSTNAME -=-=-=-" | |
20 | ||
21 | if [ $# -lt 5 ]; then | |
22 | echo "Usage: $0 WXDIR DESTDIR SKIPCLEAN VERSION PYVER..." | |
23 | exit 1 | |
24 | fi | |
25 | ||
26 | WXDIR=$1 | |
27 | DESTDIR=$2 | |
28 | SKIPCLEAN=$3 | |
29 | VERSION=$4 | |
3d6c749c | 30 | PYVER=$5 |
e4bb5998 RD |
31 | |
32 | ||
33 | # WXDIR is the cygwin path, WXWIN is the DOS path | |
34 | WXWIN_OLD=$WXWIN | |
35 | WXWIN=`cygpath -w $WXDIR` | |
36 | export WXWIN | |
37 | ||
38 | ||
39 | # # Fix the PATH. (Why is this needed??) | |
40 | # PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/robind/bin:.:$WXDIR/lib/vc_dll:$PATH | |
41 | # export PATH | |
42 | # echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" | |
43 | # echo $PATH | |
44 | # echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" | |
45 | # exit 0 | |
46 | ||
3d6c749c RD |
47 | # setup the compiler |
48 | if [ $PYVER = 2.3 ]; then | |
49 | echo "Using MSVC ver 6" | |
50 | . msvcset local 6 | |
51 | echo `which cl.exe` | |
52 | else | |
53 | echo "Using MSVC ver 7" | |
54 | . msvcset local 7 | |
55 | echo `which cl.exe` | |
56 | fi | |
57 | ||
e4bb5998 RD |
58 | |
59 | # untar the source | |
60 | echo "Unarchiving wxPython-src-$VERSION.tar.gz" | |
61 | cd $DESTDIR | |
62 | tar xzf wxPython-src-$VERSION.tar.gz | |
63 | rm wxPython-src-$VERSION.tar.gz | |
64 | ||
65 | ||
66 | # Fix line endings | |
67 | echo "Converting wxPython line endings to CRLF..." | |
68 | cd $WXDIR | |
69 | names=`find wxPython -name "*.py" -o -name "*.txt" -o -name "*.htm*" -o -name "*.css" -o -name "*.xml" ` | |
70 | unix2dos -D $names | |
71 | ||
72 | ||
73 | # change to the right spot in the source tree and copy our build scripts | |
74 | echo "Setting up for the build..." | |
75 | cd $WXDIR/build/msw | |
76 | cp $WXDIR/wxPython/distrib/msw/.m* . | |
3d6c749c | 77 | chmod +x .m* |
e4bb5998 RD |
78 | |
79 | ||
80 | # replace some settings in setup0.h and write to setup.h | |
81 | cat > .my.sedexpr <<EOF | |
82 | s/wxDIALOG_UNIT_COMPATIBILITY *1/wxDIALOG_UNIT_COMPATIBILITY 0/g | |
8c87c6b4 | 83 | s/wxUSE_EXCEPTIONS *1/wxUSE_EXCEPTIONS 0/g |
e4bb5998 RD |
84 | s/wxUSE_DEBUG_CONTEXT *0/wxUSE_DEBUG_CONTEXT 1/g |
85 | s/wxUSE_MEMORY_TRACING *0/wxUSE_MEMORY_TRACING 1/g | |
86 | s/wxUSE_DIALUP_MANAGER *1/wxUSE_DIALUP_MANAGER 0/g | |
87 | s/wxUSE_GLCANVAS *0/wxUSE_GLCANVAS 1/g | |
88 | s/wxUSE_POSTSCRIPT *0/wxUSE_POSTSCRIPT 1/g | |
89 | s/wxUSE_AFM_FOR_POSTSCRIPT *1/wxUSE_AFM_FOR_POSTSCRIPT 0/g | |
90 | s/wxUSE_DISPLAY *0/wxUSE_DISPLAY 1/g | |
8c87c6b4 | 91 | s/wxUSE_DIB_FOR_BITMAP *0/wxUSE_DIB_FOR_BITMAP 1/g |
8c1a4666 | 92 | s/wxUSE_DEBUGREPORT *1/wxUSE_DEBUGREPORRT 0/g |
e4bb5998 RD |
93 | EOF |
94 | cat $WXDIR/include/wx/msw/setup0.h | sed -f .my.sedexpr > $WXDIR/include/wx/msw/setup.h | |
95 | rm .my.sedexpr | |
96 | ||
97 | ||
98 | echo "Building the wx DLLs..." | |
99 | .make hybrid | |
100 | .make hybrid-uni | |
101 | ||
102 | ||
103 | #echo "Building the wx tools..." | |
104 | #.make_tools | |
105 | ||
106 | # cheat and just copy the .CHM files from the regular project dir | |
107 | # TODO: Copy over the wxPython-docs fle and run hhc on the contents of that. | |
108 | mkdir -p $WXDIR/docs/htmlhelp | |
109 | cp `cygpath $WXWIN_OLD/docs/htmlhelp`/*.chm $WXDIR/docs/htmlhelp | |
110 | ||
111 | ||
112 | echo "Building wxPython and installers..." | |
113 | cd $WXDIR/wxPython | |
114 | mkdir -p dist | |
115 | ||
116 | for ver in $PYVER; do | |
117 | echo $ver | |
118 | b $ver d USE_SWIG=0 | |
119 | b $ver h USE_SWIG=0 EP_ADD_OPTS=1 | |
120 | b $ver r USE_SWIG=0 | |
121 | b $ver d UNICODE=1 USE_SWIG=0 | |
122 | b $ver h UNICODE=1 USE_SWIG=0 EP_ADD_OPTS=1 | |
123 | b $ver r UNICODE=1 USE_SWIG=0 | |
124 | done | |
125 | ||
126 | echo "Building the developer package..." | |
127 | WXWIN=`cygpath -w $WXDIR` | |
128 | export WXWIN | |
129 | 4nt /c distrib/makedev.bat $VERSION | |
130 | ||
131 | ||
132 | echo "Copying installers to $DESTDIR..." | |
133 | mv dist/wxPython* $DESTDIR | |
134 | cd $DESTDIR | |
135 | ||
136 | ||
137 | if [ $SKIPCLEAN != yes ]; then | |
138 | echo "Cleaning up..." | |
139 | rm -r $WXDIR || true | |
140 | fi | |
141 | ||
142 | echo "-=-=-=- Goodbye! -=-=-=-" |