]> git.saurik.com Git - wxWidgets.git/blob - wxPython/b
fix for wx-config --inplace --rezflags output in wxCocoa (and reorganization of code...
[wxWidgets.git] / wxPython / b
1 #!/bin/sh
2
3 function getpyver {
4 if [ "$1" = "15" ]; then
5 PYVER=1.5
6 elif [ "$1" = "20" ]; then
7 PYVER=2.0
8 elif [ "$1" = "21" ]; then
9 PYVER=2.1
10 elif [ "$1" = "22" ]; then
11 PYVER=2.2
12 elif [ "$1" = "23" ]; then
13 PYVER=2.3
14 else
15 echo You must specify Python version as first parameter.
16 exit
17 fi
18 }
19
20 getpyver $1
21 shift
22
23 python$PYVER -c "import sys;print '\n', sys.version, '\n'"
24
25
26 SETUP="python$PYVER -u setup.py"
27 FLAGS="USE_SWIG=1 SWIG=/opt/swig/bin/swig" # BUILD_GLCANVAS=0"
28 OTHERFLAGS=""
29
30
31 # "c" --> clean
32 if [ "$1" = "c" ]; then
33 shift
34 CMD="$SETUP $FLAGS $OTHERFLAGS clean $*"
35 OTHERCMD="rm -f wx/*.so"
36
37 # "d" --> clean extension modules only
38 elif [ "$1" = "d" ]; then
39 shift
40 CMD="rm -f wx/*.so"
41
42 # "t" --> touch *.i files
43 elif [ "$1" = "t" ]; then
44 shift
45 #CMD="set CMD=touch src\*.i; touch contrib\glcanvas\*.i; touch contrib\ogl\*.i; touch contrib\stc\*.i"
46 CMD='find . -name "*.i" | xargs touch'
47
48 # "i" --> install
49 elif [ "$1" = "i" ]; then
50 shift
51 CMD="$SETUP $FLAGS $OTHERFLAGS build_ext install $*"
52
53 # "s" --> source dist
54 elif [ "$1" = "s" ]; then
55 shift
56 CMD="$SETUP $OTHERFLAGS sdist $*"
57
58 # "r" --> rpm dist
59 elif [ "$1" = "r" ]; then
60 WXPYVER=`python$PYVER -c "import setup;print setup.VERSION"`
61 for VER in 21 22; do
62 getpyver $VER
63
64 echo "*****************************************************************"
65 echo "******* Building wxPython for Python $PYVER"
66 echo "*****************************************************************"
67
68 SETUP="python$PYVER -u setup.py"
69
70 # save the original
71 cp setup.py setup.py.save
72
73 # fix up setup.py the way we want...
74 sed "s/BUILD_GLCANVAS = /BUILD_GLCANVAS = 0 #/" < setup.py.save > setup.py.temp
75 sed "s/GL_ONLY = /GL_ONLY = 1 #/" < setup.py.temp > setup.py
76
77 # build wxPython-gl RPM
78 $SETUP $OTHERFLAGS bdist_rpm --binary-only --doc-files README.txt --python=python$PYVER
79 ### --requires=python$PYVER
80 rm dist/wxPython-gl*.tar.gz
81
82 # Build wxPython RPM
83 cp setup.py setup.py.temp
84 sed "s/GL_ONLY = /GL_ONLY = 0 #/" < setup.py.temp > setup.py
85 $SETUP $OTHERFLAGS bdist_rpm --binary-only --python=python$PYVER
86 ### --requires=python$PYVER
87
88 # put the oringal setup.py back
89 cp setup.py.save setup.py
90 rm setup.py.*
91
92 # rename the binary RPM's
93 mv dist/wxPython-$WXPYVER-1.i386.rpm dist/wxPython-$WXPYVER-1-Py$VER.i386.rpm
94 mv dist/wxPython-gl-$WXPYVER-1.i386.rpm dist/wxPython-gl-$WXPYVER-1-Py$VER.i386.rpm
95
96 done
97
98 # rebuild the source dists without the munched up setup.py
99 $SETUP $OTHERFLAGS bdist_rpm --source-only
100 exit 0
101
102
103 # "f" --> FINAL (no debug)
104 elif [ "$1" = "f" ]; then
105 shift
106 CMD="$SETUP $FLAGS $OTHERFLAGS build_ext --inplace $*"
107
108 # (no command arg) --> normal build for development
109 else
110 CMD="$SETUP $FLAGS $OTHERFLAGS build_ext --inplace --debug $*"
111 fi
112
113
114 echo $CMD
115 eval $CMD
116
117
118 if [ "$OTHERCMD" != "" ]; then
119 echo $OTHERCMD
120 $OTHERCMD
121 fi
122