]> git.saurik.com Git - wxWidgets.git/blob - wxPython/b
empty spin range is valid and even useful (at least for testing purposes)
[wxWidgets.git] / wxPython / b
1 #!/bin/bash
2
3 # Are we using bash on win32? If so source that file and then exit.
4 if [ "$OSTYPE" = "cygwin" ]; then
5 source b.win32
6 exit
7 fi
8
9 # make it easy to switch versions of SWIG
10 if [ "$SWIG" = "" ]; then
11 SWIG=/opt/swig/bin/swig-1.3.29
12 fi
13
14
15 function getpyver {
16 if [ "$1" = "15" ]; then
17 PYVER=1.5
18 elif [ "$1" = "20" ]; then
19 PYVER=2.0
20 elif [ "$1" = "21" ]; then
21 PYVER=2.1
22 elif [ "$1" = "22" ]; then
23 PYVER=2.2
24 elif [ "$1" = "23" ]; then
25 PYVER=2.3
26 elif [ "$1" = "24" ]; then
27 PYVER=2.4
28 elif [ "$1" = "25" ]; then
29 PYVER=2.5
30 else
31 echo You must specify Python version as first parameter.
32 exit
33 fi
34 }
35
36 getpyver $1
37 shift
38
39 python$PYVER -c "import sys;print '\n', sys.version, '\n'"
40
41
42 SETUP="python$PYVER -u setup.py"
43 FLAGS="USE_SWIG=1 SWIG=$SWIG"
44 OTHERFLAGS=""
45 PORTFLAGS=""
46 UNIFLAG="UNICODE=1"
47
48
49
50 if [ "$1" = "gtk1" -o "$1" = "gtk" ]; then
51 PORTFLAGS="WXPORT=gtk"
52 UNIFLAG="UNICODE=0"
53 shift
54 elif [ "$1" = "gtk2" ]; then
55 PORTFLAGS="WXPORT=gtk2"
56 UNIFLAG="UNICODE=1"
57 shift
58 fi
59
60 for p in $*; do
61 if [ "$p" = "UNICODE=0" -o "$p" = "UNICODE=1" ]; then
62 UNIFLAG=""
63 break
64 fi
65 done
66
67 FLAGS="$FLAGS $PORTFLAGS $UNIFLAG"
68
69
70
71 # "c" --> clean
72 if [ "$1" = "c" ]; then
73 shift
74 CMD="$SETUP $FLAGS $OTHERFLAGS clean $*"
75 OTHERCMD="rm -f wx/*.so"
76
77 # "d" --> clean extension modules only
78 elif [ "$1" = "d" ]; then
79 shift
80 CMD="rm -f wx/*.so"
81
82 # "t" --> touch *.i files
83 elif [ "$1" = "t" ]; then
84 shift
85 CMD='find . -name "*.i" | xargs touch'
86
87 # "i" --> install
88 elif [ "$1" = "i" ]; then
89 shift
90 CMD="$SETUP $FLAGS $OTHERFLAGS build_ext install $*"
91
92 # "s" --> source dist
93 elif [ "$1" = "s" ]; then
94 shift
95 CMD="$SETUP $OTHERFLAGS sdist $*"
96
97 # "r" --> rpm dist
98 elif [ "$1" = "r" ]; then
99 WXPYVER=`python$PYVER -c "import setup;print setup.VERSION"`
100 for VER in 21 22; do
101 getpyver $VER
102
103 echo "*****************************************************************"
104 echo "******* Building wxPython for Python $PYVER"
105 echo "*****************************************************************"
106
107 SETUP="python$PYVER -u setup.py"
108
109 # save the original
110 cp setup.py setup.py.save
111
112 # fix up setup.py the way we want...
113 sed "s/BUILD_GLCANVAS = /BUILD_GLCANVAS = 0 #/" < setup.py.save > setup.py.temp
114 sed "s/GL_ONLY = /GL_ONLY = 1 #/" < setup.py.temp > setup.py
115
116 # build wxPython-gl RPM
117 $SETUP $OTHERFLAGS bdist_rpm --binary-only --doc-files README.txt --python=python$PYVER
118 ### --requires=python$PYVER
119 rm dist/wxPython-gl*.tar.gz
120
121 # Build wxPython RPM
122 cp setup.py setup.py.temp
123 sed "s/GL_ONLY = /GL_ONLY = 0 #/" < setup.py.temp > setup.py
124 $SETUP $OTHERFLAGS bdist_rpm --binary-only --python=python$PYVER
125 ### --requires=python$PYVER
126
127 # put the oringal setup.py back
128 cp setup.py.save setup.py
129 rm setup.py.*
130
131 # rename the binary RPM's
132 mv dist/wxPython-$WXPYVER-1.i386.rpm dist/wxPython-$WXPYVER-1-Py$VER.i386.rpm
133 mv dist/wxPython-gl-$WXPYVER-1.i386.rpm dist/wxPython-gl-$WXPYVER-1-Py$VER.i386.rpm
134
135 done
136
137 # rebuild the source dists without the munched up setup.py
138 $SETUP $OTHERFLAGS bdist_rpm --source-only
139 exit 0
140
141
142 # "f" --> FINAL (no debug)
143 elif [ "$1" = "f" ]; then
144 shift
145 CMD="$SETUP $FLAGS $OTHERFLAGS build_ext --inplace $*"
146
147 # (no command arg) --> normal build for development
148 else
149 CMD="$SETUP $FLAGS $OTHERFLAGS build_ext --inplace --debug $*"
150 fi
151
152
153 echo $CMD
154 eval $CMD
155 RC=$?
156
157 if [ "$RC" = "0" -a "$OTHERCMD" != "" ]; then
158 echo $OTHERCMD
159 $OTHERCMD
160 RC=$?
161 fi
162
163 exit $RC