]> git.saurik.com Git - wxWidgets.git/blame - wxPython/distrib/mac/_build
fixedb ug with normalization of UNC paths (patch 558701)
[wxWidgets.git] / wxPython / distrib / mac / _build
CommitLineData
8721cada
RD
1#!/bin/sh -e
2#
3# build binary wxMacPython package and put it on a disk image
4#
5# usage: build [-s dir] [-d dir] [--cvs-update] [--force] [--debug]
6#
7# (C)opyright 2002 Frank Vercruesse
8#
9# Many modifications by Robin Dunn
10
11
12PYVER=2.2
13
14curDir=`pwd`
15progDir="`dirname \"$0\"`"
16
17defSrcPath="/projects/wx"
18defDstPath="/projects/wx/wxPython/dist"
19
20pkgName="wxMacPython"
21version=`date +"%Y-%m-%d"`
22dmgRoot="dmg-root"
23pkgRoot="pkg-root"
24wxWindowsInst="$pkgRoot/usr/local"
25wxPythonInst="$pkgRoot/Library/Frameworks/Python.framework/Versions/$PYVER/lib/python$PYVER/site-packages"
26
27pythonExec="python$PYVER"
28makePkgExec="./makepkg"
29makeDmgExec="./makedmg"
30
31
32usage() {
33 echo `basename $0`: ERROR: $* 1>&2
34 echo usage: `basename $0` '[-s dir] [-d dir] [--cvs-update] [--force] [--debug]' 1>&2
35 exit 1
36}
37
38quotemeta() {
39 # probably not quite correct, but seems to work
40 echo "$1" | sed -e 's/\([^a-zA-z0-9.,--;_/]\)/\\\1/g'
41}
42
43msg()
44{
45 echo "---------------------------------------------"
46 echo $@
47}
48
49msgdo() {
50 echo "--> " $@
51 $@
52}
53
54
55user=$1
56shift
57
58update=
59force=
60debug=
61srcPath=
62dstPath=
63
64while :; do
65 case "$1" in
66 --cvs-update) update=1;;
67 --force) force=1;;
68 --debug) debug=1;;
69 -s) shift; srcPath="$1";;
70 -d) shift; dstPath="$1";;
71 -*) usage "bad argument $1";;
72 *) break;;
73 esac
74 shift
75done
76
77
78#-----------------------------------
79msg check and prepare build directories
80
81if ! test "$srcPath"; then
82 srcPath=$defSrcPath
83fi
84if ! test -d "$srcPath"; then
85 echo "no such directory: '$srcPath'" 1>&2
86 exit
87fi
88
89if ! test "$dstPath"; then
90 dstPath=$defDstPath
91fi
92if ! test -d "$dstPath"; then
93 msgdo mkdir -p -m 775 "$dstPath"
94 msgdo chown ${user}:staff "$dstPath"
95fi
96
97temp="tmp$$"
98if test -e "$dstPath/$temp"; then
99 msgdo rm -rf "$dstPath/$temp"
100fi
101msgdo mkdir -m 775 "$dstPath/$temp"
102
103if test -e "$dstPath/$temp/$pkgRoot"; then
104 msgdo rm -rf "$dstPath/$temp/$pkgRoot"
105fi
106msgdo mkdir -m 1775 "$dstPath/$temp/$pkgRoot"
107msgdo chown root:admin "$dstPath/$temp/$pkgRoot"
108
109if test -e "$dstPath/$temp/$dmgRoot"; then
110 msgdo rm -rf "$dstPath/$temp/$dmgRoot"
111fi
112msgdo mkdir -p -m 775 "$dstPath/$temp/$dmgRoot"
113msgdo chown $user:staff "$dstPath/$temp/$dmgRoot"
114
115
116#-----------------------------------
117# update cvs
118if [ $update ]; then
119 msg Updating from CVS
120 msgdo cd "$srcPath"
121 msgdo cvs update -dP -A
122fi
123
124
125#-----------------------------------
126msg configuring wxWindows
127buildDir="$srcPath/build-pkg"
128dFlag=
129if [ $debug ]; then
130 buildDir="$srcPath/build-pkg-debug"
131 dFlag="--enable-debug"
132fi
133if ! test -e "$buildDir"; then
134 force=1
135fi
136if [ $force ]; then
137 if test -e "$buildDir"; then
138 rm -rf "$buildDir"
139 fi
140 msgdo mkdir -m 775 "$buildDir"
141 msgdo cd "$buildDir"
142 msgdo ../configure --with-mac --with-opengl $dFlag
143 cd $curDir
144
145else
146 echo wxWindows already configured
147fi
148
149
150#-----------------------------------
151msg building wxWindows
152msgdo cd $buildDir
153msgdo make
154cd $curDir
155
156
157#-----------------------------------
158msg installing wxWindows
159msgdo mkdir -p -m 755 "$dstPath/$temp/$wxWindowsInst"
160msgdo cd "$buildDir"
5f9dc1f1
RD
161
162# install once to the package directory, and once to the
163# local machine so the wxPython build will get the right wxMac
8721cada 164msgdo make install "prefix=`quotemeta \"$dstPath/$temp/$wxWindowsInst\"`"
5f9dc1f1
RD
165msgdo make install
166
8721cada
RD
167msgdo chown -R root:wheel "$dstPath/$temp/$pkgRoot/usr"
168cd $curDir
169
170
171#-----------------------------------
172msg building wxPython
173if [ $force ]; then
174 fFlag="--force"
175else
176 fFlag=
177fi
178if [ $debug ]; then
179 dFlag="--debug"
180 wxpBuildDir="build-pkg-debug"
181else
182 dFlag=
183 wxpBuildDir="build-pkg"
184fi
185bbFlag="BUILD_BASE=$wxpBuildDir"
186
187msgdo cd "$srcPath/wxPython"
188msgdo $pythonExec setup.py build 'IN_CVS_TREE=1' $bbFlag $fFlag $dFlag
189cd $curDir
190
191
192#-----------------------------------
193msg installing wxPython
194msgdo mkdir -p -m 775 "$dstPath/$temp/$wxPythonInst"
195msgdo cd "$srcPath/wxPython"
196msgdo $pythonExec setup.py install $bbFlag --install-lib="$dstPath/$temp/$wxPythonInst"
197cd $curDir
198
199msgdo chown -R root:admin "$dstPath/$temp/$pkgRoot/Library"
200msgdo chmod -R g+w "$dstPath/$temp/$pkgRoot/Library"
201
202
203#-----------------------------------
204msg copying additional wxPython files
205msgdo cp -pR "$srcPath/wxPython/samples" "$dstPath/$temp/$dmgRoot"
206msgdo cp -pR "$srcPath/wxPython/demo" "$dstPath/$temp/$dmgRoot"
207msgdo cp -pR "$srcPath/wxPython/licence" "$dstPath/$temp/$dmgRoot"
208msgdo cp -pR "$srcPath/wxPython/tools" "$dstPath/$temp/$dmgRoot"
209find "$dstPath/$temp/$dmgRoot" -name "CVS" -type d -print0 | xargs -0 rm -rf
210find "$dstPath/$temp/$dmgRoot" -name ".DS_Store" -type f -print0 | xargs -0 rm
211find "$dstPath/$temp/$dmgRoot" -name ".cvsignore" -type f -print0 | xargs -0 rm
212find "$dstPath/$temp/$dmgRoot" -name ".#*" -type f -print0 | xargs -0 rm
213find "$dstPath/$temp/$dmgRoot" -name "b" -type f -print0 | xargs -0 rm
214find "$dstPath/$temp/$dmgRoot" -name "*~*~" -type f -print0 | xargs -0 rm
215msgdo chown -R ${user}:staff "$dstPath/$temp/$dmgRoot"
216
217
218#-----------------------------------
219msg making installer package
220msgdo cp -pR "$progDir/resources" "$dstPath/$temp"
221msgdo cp $progDir/$pkgName.info $progDir/$pkgName-$version.info
222if [ $debug ]; then
223 echo "__WXDEBUG__ version." >> "$dstPath/$temp/resources/Welcome.txt"
224 echo "" >> "$dstPath/$temp/resources/Welcome.txt"
225fi
226echo "Build date: `date`" >> "$dstPath/$temp/resources/Welcome.txt"
227msgdo cd "$progDir"
228msgdo "$makePkgExec" $dstPath/$temp/$pkgRoot $pkgName-$version.info -d $dstPath/$temp/$dmgRoot -r $dstPath/$temp/resources
229msgdo chown -R ${user}:staff $dstPath/$temp/$dmgRoot/$pkgName-$version.pkg
230cd $curDir
231
232
233#-----------------------------------
234msg making disk image
235msgdo cd "$progDir"
236msgdo "$makeDmgExec" $dstPath/$temp/$dmgRoot $dstPath/$temp $pkgName-$version
237if [ $debug ]; then
238 dmgName="$pkgName-$version-debug"
239else
240 dmgName="$pkgName-$version"
241fi
242msgdo mv "$dstPath/$temp/$pkgName-$version.dmg" "$dstPath/$dmgName.dmg"
243msgdo chown ${user}:staff "$dstPath/$dmgName.dmg"
244cd $curDir
245
246
247#-----------------------------------
248msg cleaning up
249msgdo chown -R ${user}:staff "$buildDir"
250msgdo chown -R ${user}:staff "$srcPath/wxPython/$wxpBuildDir"
251msgdo rm $progDir/$pkgName-$version.info
252msgdo rm -rf "$dstPath/$temp"