]> git.saurik.com Git - wxWidgets.git/blob - wxPython/distrib/build_packages.sh
Use the now 'official' makemo.py when building packages.
[wxWidgets.git] / wxPython / distrib / build_packages.sh
1 #!/bin/bash
2
3 unicode=no
4 debug=no
5 reswig=no
6 all=no
7
8 if [ "$1" = "all" ]; then
9 all=yes
10 else
11 PY_VERSION=$1
12 fi
13
14 shift
15
16 for flag in $*; do
17 case ${flag} in
18 debug) debug=yes ;;
19 unicode) unicode=yes ;;
20 reswig) reswig=yes ;;
21 esac
22 done
23
24 if [ "$WXWIN" = "" ]; then
25 export WXWIN=`pwd`/../..
26 fi
27
28 if [ $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
33 fi
34
35 echo "wxWidgets directory is: $WXWIN"
36
37 if [ "$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
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
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
61 $TOOLS/Python$PY_VERSION/python `cygpath -d $WXWIN/wxPython/distrib/create_setup.h.py` $UNICODE_FLAG
62
63 export PATH=${PATH}:${WXWIN}/lib/vc_dll:${TOOLS}/Python${PY_VERSION}
64
65 cd $WXWIN/build/msw
66 # remove old build files
67 rm -rf vc_msw*
68 UNI=
69 if [ $unicode = yes ]; then
70 UNI=-uni
71 fi
72 ./.make hybrid$UNI
73 # make tools for docs creation, etc.
74 ./.make_tools
75
76 cd $WXWIN/wxPython
77
78 # update the language files
79 $TOOLS/Python$PY_VERSION/python `cygpath -d $WXWIN/wxPython/distrib/makemo.py`
80
81 rm -rf build build.unicode
82 rm -rf wx/*.pyd
83
84 # re-generate SWIG files
85 if [ $reswig = yes ]; then
86 $WXWIN/wxPython/b $PY_VERSION t
87 fi
88
89 # build the hybrid extension
90 # NOTE: Win Python needs Windows-style pathnames, so we
91 # need to convert
92 export WXWIN=`cygpath -w $WXWIN`
93 export SWIGDIR=`cygpath -w $SWIGDIR`
94
95 $WXWIN/wxPython/b $PY_VERSION h $DEBUG_FLAG $UNICODE_FLAG
96
97 # make the dev package
98 $WXWIN/wxPython/distrib/makedev
99 $WXWIN/wxPython/distrib/makedocs
100 $WXWIN/wxPython/distrib/makedemo
101
102 $TOOLS/Python$PY_VERSION/python `cygpath -d $WXWIN/wxPython/distrib/make_installer_inno4.py` $UNICODE_FLAG
103 elif [ "$OSTYPE" = "darwin" ]; then
104 cd $WXWIN/wxPython
105
106 if [ ! -d dist ]; then
107 mkdir dist
108 fi
109 # re-generate SWIG files
110 if [ $reswig = yes ]; then
111 $WXWIN/wxPython/b $PY_VERSION t
112 fi
113
114 PY_DOT_VER=2.3
115 if [ "$PY_VERSION" = "24" ]; then
116 PY_DOT_VER=2.4
117 fi
118
119 UNICODE_OPT=
120 if [ $unicode = yes ]; then
121 UNICODE_OPT=unicode
122 fi
123
124 #sudo $WXWIN/wxPython/distrib/makedocs
125 $WXWIN/wxPython/distrib/makedemo
126 export TARBALLDIR=$WXWIN/wxPython/dist
127
128 distrib/mac/wxPythonOSX/build $PY_DOT_VER panther inplace $UNICODE_OPT
129 else
130 echo "OSTYPE $OSTYPE not yet supported by this build script."
131 fi
132
133 # return to original dir
134 cd $WXWIN/wxPython/distrib
135