]> git.saurik.com Git - wxWidgets.git/blame - wxPython/distrib/build_packages.sh
always use wxPyPanel
[wxWidgets.git] / wxPython / distrib / build_packages.sh
CommitLineData
f58a6c81
KO
1#!/bin/bash
2
919de94c
KO
3unicode=no
4debug=no
1d7127d0
KO
5reswig=no
6all=no
7
8if [ "$1" = "all" ]; then
9 all=yes
10else
11 PY_VERSION=$1
12fi
13
14shift
919de94c
KO
15
16for flag in $*; do
17 case ${flag} in
18 debug) debug=yes ;;
19 unicode) unicode=yes ;;
1d7127d0 20 reswig) reswig=yes ;;
919de94c
KO
21 esac
22done
23
f58a6c81
KO
24if [ "$WXWIN" = "" ]; then
25 export WXWIN=`pwd`/../..
26fi
27
1d7127d0
KO
28if [ $all = yes ]; then
29 $WXWIN/wxPython/distrib/build_packages.sh 23
30 $WXWIN/wxPython/distrib/build_packages.sh 23 unicode
31 $WXWIN/wxPython/distrib/build_packages.sh 24
32 $WXWIN/wxPython/distrib/build_packages.sh 24 unicode
33fi
34
f58a6c81
KO
35echo "wxWidgets directory is: $WXWIN"
36
37if [ "$OSTYPE" = "cygwin" ]; then
38 # do setup of build environment vars
39 if [ "$TOOLS" = "" ]; then
40 export TOOLS=`cygpath C:\\`
41 fi
42
43 if [ "$SWIGDIR" = "" ]; then
44 export SWIGDIR=$TOOLS/SWIG-1.3.24
45 fi
46
82378a4f
KO
47 DEBUG_FLAG=
48 UNICODE_FLAG=
49 if [ $debug = yes ]; then
50 DEBUG_FLAG=--debug
51 fi
52 if [ $unicode = yes ]; then
53 UNICODE_FLAG="UNICODE=1"
54 fi
55
f58a6c81
KO
56 # copy wxPython build scripts
57 cp $WXWIN/wxPython/distrib/msw/.m* $WXWIN/build/msw
58
59 # setup wxPython defines
60 cp $WXWIN/include/wx/msw/setup0.h $WXWIN/include/wx/msw/setup.h
82378a4f 61 $TOOLS/Python$PY_VERSION/python `cygpath -d $WXWIN/wxPython/distrib/create_setup.h.py` $UNICODE_FLAG
f58a6c81 62
82378a4f 63 export PATH=${PATH}:${WXWIN}/lib/vc_dll:${TOOLS}/Python${PY_VERSION}
f58a6c81
KO
64
65 cd $WXWIN/build/msw
66 # remove old build files
67 rm -rf vc_msw*
68 UNI=
919de94c 69 if [ $unicode = yes ]; then
f58a6c81
KO
70 UNI=-uni
71 fi
72 ./.make hybrid$UNI
f58a6c81
KO
73 # make tools for docs creation, etc.
74 ./.make_tools
75
c1ebcef0
KO
76 cd $WXWIN/wxPython
77
f58a6c81 78 # update the language files
82378a4f 79 $TOOLS/Python$PY_VERSION/python `cygpath -d $WXWIN/wxPython/distrib/makemo.py`
f58a6c81
KO
80 rm -rf build build.unicode
81 rm -rf wx/*.pyd
82
83 # re-generate SWIG files
1d7127d0
KO
84 if [ $reswig = yes ]; then
85 $WXWIN/wxPython/b $PY_VERSION t
86 fi
f58a6c81
KO
87
88 # build the hybrid extension
89 # NOTE: Win Python needs Windows-style pathnames, so we
90 # need to convert
82378a4f
KO
91 export WXWIN=`cygpath -w $WXWIN`
92 export SWIGDIR=`cygpath -w $SWIGDIR`
f58a6c81 93
82378a4f 94 $WXWIN/wxPython/b $PY_VERSION h $DEBUG_FLAG $UNICODE_FLAG
f58a6c81
KO
95
96 # make the dev package
82378a4f 97 $WXWIN/wxPython/distrib/makedev
1d7127d0
KO
98 $WXWIN/wxPython/distrib/makedocs
99 $WXWIN/wxPython/distrib/makedemo
f58a6c81 100
82378a4f 101 $TOOLS/Python$PY_VERSION/python `cygpath -d $WXWIN/wxPython/distrib/make_installer_inno4.py` $UNICODE_FLAG
f58a6c81 102elif [ "$OSTYPE" = "darwin" ]; then
e61e5964
KO
103 OSX_VERSION=`sw_vers -productVersion`
104 echo "OS X Version: ${OSX_VERSION:0:4}"
f58a6c81
KO
105 cd $WXWIN/wxPython
106
1d7127d0
KO
107 if [ ! -d dist ]; then
108 mkdir dist
109 fi
f58a6c81 110 # re-generate SWIG files
e61e5964 111 RESWIG=
1d7127d0 112 if [ $reswig = yes ]; then
e61e5964 113 RESWIG=reswig
1d7127d0 114 fi
f58a6c81 115
fc87210f
KO
116 PY_DOT_VER=2.3
117 if [ "$PY_VERSION" = "24" ]; then
118 PY_DOT_VER=2.4
119 fi
120
121 UNICODE_OPT=
919de94c 122 if [ $unicode = yes ]; then
fc87210f
KO
123 UNICODE_OPT=unicode
124 fi
125
0f475e8a
RD
126 DEBUG_OPT=
127 if [ $debug = yes ]; then
128 DEBUG_OPT=debug
129 fi
e61e5964
KO
130 # On Tiger, build Universal.
131 UNIV_OPT=
132 if [ ${OSX_VERSION:0:4} = "10.4" ]; then
133 UNIV_OPT="universal"
134 fi
135
1d7127d0
KO
136 #sudo $WXWIN/wxPython/distrib/makedocs
137 $WXWIN/wxPython/distrib/makedemo
138 export TARBALLDIR=$WXWIN/wxPython/dist
0f475e8a 139 echo "distrib/mac/wxPythonOSX/build $PY_DOT_VER inplace $UNICODE_OPT $RESWIG"
1d7127d0 140
0f475e8a 141 distrib/mac/wxPythonOSX/build $PY_DOT_VER inplace $UNICODE_OPT $DEBUG_OPT $RESWIG $UNIV_OPT
f58a6c81
KO
142else
143 echo "OSTYPE $OSTYPE not yet supported by this build script."
144fi
82378a4f 145
1d7127d0
KO
146# return to original dir
147cd $WXWIN/wxPython/distrib
82378a4f 148