]> git.saurik.com Git - wxWidgets.git/blob - wxPython/distrib/build_packages.sh
Don't try to open clipboard if already open
[wxWidgets.git] / wxPython / distrib / build_packages.sh
1 #!/bin/bash
2
3 PY_VERSION=$1
4 shift
5
6 unicode=no
7 debug=no
8
9 for flag in $*; do
10 case ${flag} in
11 debug) debug=yes ;;
12 unicode) unicode=yes ;;
13 esac
14 done
15
16 if [ "$WXWIN" = "" ]; then
17 export WXWIN=`pwd`/../..
18 fi
19
20 echo "wxWidgets directory is: $WXWIN"
21
22 if [ "$OSTYPE" = "cygwin" ]; then
23 # do setup of build environment vars
24 if [ "$TOOLS" = "" ]; then
25 export TOOLS=`cygpath C:\\`
26 fi
27
28 if [ "$SWIGDIR" = "" ]; then
29 export SWIGDIR=$TOOLS/SWIG-1.3.24
30 fi
31
32 DEBUG_FLAG=
33 UNICODE_FLAG=
34 if [ $debug = yes ]; then
35 DEBUG_FLAG=--debug
36 fi
37 if [ $unicode = yes ]; then
38 UNICODE_FLAG="UNICODE=1"
39 fi
40
41 # copy wxPython build scripts
42 cp $WXWIN/wxPython/distrib/msw/.m* $WXWIN/build/msw
43
44 # setup wxPython defines
45 cp $WXWIN/include/wx/msw/setup0.h $WXWIN/include/wx/msw/setup.h
46 $TOOLS/Python$PY_VERSION/python `cygpath -d $WXWIN/wxPython/distrib/create_setup.h.py` $UNICODE_FLAG
47
48 export PATH=${PATH}:${WXWIN}/lib/vc_dll:${TOOLS}/Python${PY_VERSION}
49
50 cd $WXWIN/build/msw
51 # remove old build files
52 rm -rf vc_msw*
53 UNI=
54 if [ $unicode = yes ]; then
55 UNI=-uni
56 fi
57 ./.make hybrid$UNI
58
59 # make tools for docs creation, etc.
60 ./.make_tools
61
62 # update the language files
63 cd $WXWIN/locale
64 make allmo
65
66 $TOOLS/Python$PY_VERSION/python `cygpath -d $WXWIN/wxPython/distrib/makemo.py`
67
68 cd $WXWIN/wxPython
69
70 rm -rf build build.unicode
71 rm -rf wx/*.pyd
72
73 # re-generate SWIG files
74 $WXWIN/wxPython/b $PY_VERSION t
75
76 # build the hybrid extension
77 # NOTE: Win Python needs Windows-style pathnames, so we
78 # need to convert
79 export WXWIN=`cygpath -w $WXWIN`
80 export SWIGDIR=`cygpath -w $SWIGDIR`
81
82 $WXWIN/wxPython/b $PY_VERSION h $DEBUG_FLAG $UNICODE_FLAG
83
84 # make the dev package
85 $WXWIN/wxPython/distrib/makedev
86
87 $TOOLS/Python$PY_VERSION/python `cygpath -d $WXWIN/wxPython/distrib/make_installer_inno4.py` $UNICODE_FLAG
88 elif [ "$OSTYPE" = "darwin" ]; then
89 cd $WXWIN/wxPython
90
91 # re-generate SWIG files
92 $WXWIN/wxPython/b $PY_VERSION t
93
94 PY_DOT_VER=2.3
95 if [ "$PY_VERSION" = "24" ]; then
96 PY_DOT_VER=2.4
97 fi
98
99 UNICODE_OPT=
100 if [ $unicode = yes ]; then
101 UNICODE_OPT=unicode
102 fi
103
104 sudo distrib/mac/wxPythonOSX/build $PY_DOT_VER panther inplace $UNICODE_OPT
105 else
106 echo "OSTYPE $OSTYPE not yet supported by this build script."
107 fi
108
109 # Now make the demo and docs tarballs
110 cd $WXWIN/wxPython
111 $WXWIN/wxPython/distrib/makedocs
112 $WXWIN/wxPython/distrib/makedemo
113