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