]>
Commit | Line | Data |
---|---|---|
1e4a197e RD |
1 | #!/bin/sh -e |
2 | #---------------------------------------------------------------------- | |
3 | # Build wxMac and wxPythonOSX from the tarball and then make an | |
4 | # Installer package out of it. | |
5 | ||
6 | spectemplate=distrib/wxPythonFull.spec.in | |
7 | ||
8 | if [ ! -d wxPython -o ! -e ${spectemplate} ]; then | |
9 | echo "Please run this script from the root wxPython directory." | |
10 | exit 1 | |
11 | fi | |
12 | ||
81de4ba3 | 13 | if [ "$UID" != "0" ]; then |
132ae51e RD |
14 | echo "-------------------------------------------------------" |
15 | echo " WARNING: will be unable to change ownership of files" | |
16 | echo " unless this script is run as root or via sudo" | |
17 | echo "-------------------------------------------------------" | |
18 | fi | |
19 | ||
1e4a197e RD |
20 | #---------------------------------------------------------------------- |
21 | # Check Parameters | |
22 | ||
23 | function usage { | |
24 | echo "" | |
dd35b09a | 25 | echo "Usage: $0 [panther|jaguar] [command flags...]" |
1e4a197e | 26 | echo "" |
c6387bc1 RD |
27 | echo " panther Build for Apple's python in /usr/bin, such as on Panther" |
28 | echo " jaguar Build for a python in /usr/local/bin, such as on Jaguar" | |
46456f61 RD |
29 | echo "" |
30 | echo "optional command flags:" | |
1e4a197e | 31 | echo " skiptar Don't unpack the tarball" |
81de4ba3 RD |
32 | echo " inplace Don't use the tarball, build from the CVS tree instead" |
33 | echo " (The Docs and Demo tarballs are still required for a full build.)" | |
85245f48 | 34 | echo " unicode Make a unicode build" |
1e4a197e | 35 | echo " skipconfig Don't run configure" |
b42b447c | 36 | echo " skipbuild Don't build wxWidgets or wxPython" |
1e4a197e RD |
37 | echo " skipinstall Don't do the installation step" |
38 | echo " skipdmg Don't make the package or diskimage" | |
39 | echo " skipclean Don't do the cleanup at the end" | |
46456f61 | 40 | echo "" |
1e4a197e RD |
41 | } |
42 | ||
43 | ||
46456f61 | 44 | if [ $# -lt 1 ]; then |
1e4a197e RD |
45 | usage |
46 | exit 1 | |
47 | fi | |
48 | ||
46456f61 RD |
49 | KIND=$1 |
50 | case $KIND in | |
c6387bc1 RD |
51 | panther) PYTHON=/usr/bin/python ;; |
52 | jaguar) PYTHON=/usr/local/bin/python ;; | |
53 | *) usage; exit 1 ;; | |
46456f61 RD |
54 | esac |
55 | PYTHONW=${PYTHON}w | |
56 | shift | |
1e4a197e | 57 | |
81de4ba3 RD |
58 | skiptar=no |
59 | skipconfig=no | |
60 | skipbuild=no | |
61 | skipinstall=no | |
62 | skipdmg=no | |
63 | skipclean=no | |
64 | inplace=no | |
85245f48 | 65 | unicode=no |
1e4a197e RD |
66 | |
67 | for flag in $*; do | |
68 | case ${flag} in | |
81de4ba3 RD |
69 | skiptar) skiptar=yes ;; |
70 | skipconfig) skipconfig=yes; skiptar=yes ;; | |
71 | skipbuild) skipbuild=yes; skipconfig=yes; skiptar=yes ;; | |
72 | skipinstall) skipinstall=yes ;; | |
73 | skipdmg) skipdmg=yes ;; | |
74 | skipclean) skipclean=yes ;; | |
75 | inplace) inplace=yes; skiptar=yes ;; | |
85245f48 | 76 | unicode) unicode=yes ;; |
1e4a197e RD |
77 | |
78 | *) echo "Unknown flag \"${flag}\"" | |
79 | usage | |
80 | exit 1 | |
81 | esac | |
82 | done | |
83 | ||
84 | ||
46456f61 RD |
85 | VERSION=`$PYTHON -c "import setup;print setup.VERSION"` |
86 | PYVER=`$PYTHON -c "import sys; print sys.version[:3]"` | |
87 | PYPREFIX=`$PYTHON -c "import sys; print sys.exec_prefix"` | |
c6387bc1 RD |
88 | PYLIB=$PYPREFIX/lib/python$PYVER |
89 | SITEPACKAGES=$PYLIB/site-packages | |
28d1454a | 90 | SHORTVER=`echo $VERSION | cut -c 1,2,3` |
81de4ba3 | 91 | |
85245f48 RD |
92 | if [ $unicode == yes ]; then |
93 | CHARTYPE=unicode | |
94 | UNICODEOPT=--enable-unicode | |
95 | PYUNICODEOPT=1 | |
96 | else | |
97 | CHARTYPE=ansi | |
98 | UNICODEOPT=--disable-unicode | |
99 | PYUNICODEOPT=0 | |
100 | fi | |
bceb17b2 | 101 | |
eae9a172 RD |
102 | #if [ "$HOSTNAME" = "bigmac.alldunn.com" ]; then |
103 | # MAKEJOBS="--jobs=2" | |
104 | #fi | |
105 | ||
81de4ba3 | 106 | |
132ae51e | 107 | if [ -z "$TARBALLDIR" ]; then |
81de4ba3 RD |
108 | # this is a spot on my fileserver where the tarballs go, adjust |
109 | # as needed for where you put the wxPython tarball, or set | |
110 | # TARBALLDIR before invoking this script... | |
132ae51e RD |
111 | TARBALLDIR=/stuff/Development/wxPython/dist/$VERSION |
112 | fi | |
28d1454a | 113 | TARBALL=$TARBALLDIR/wxPython-src-$VERSION.tar.gz |
1e4a197e | 114 | |
28d1454a | 115 | if [ ! -e $TARBALLDIR/wxPython-demo-$VERSION.tar.gz ]; then |
81de4ba3 RD |
116 | echo "-------------------------------------------------------" |
117 | echo " WARNING: Demo tarball not found, will skip building " | |
118 | echo " the Demo app bundle and etc." | |
28d1454a | 119 | echo " $TARBALLDIR/wxPython-demo-$VERSION.tar.gz" |
81de4ba3 RD |
120 | echo "-------------------------------------------------------" |
121 | fi | |
122 | ||
28d1454a | 123 | if [ ! -e $TARBALLDIR/wxPython-docs-$VERSION.tar.gz ]; then |
81de4ba3 RD |
124 | echo "-------------------------------------------------------" |
125 | echo " WARNING: Docs tarball not found, will skip building " | |
126 | echo " the the wxDocsViewer app bundle and etc." | |
28d1454a | 127 | echo " $TARBALLDIR/wxPython-docs-$VERSION.tar.gz" |
81de4ba3 RD |
128 | echo "-------------------------------------------------------" |
129 | fi | |
130 | ||
131 | ||
132 | ||
133 | ||
85245f48 | 134 | PREFIX=/usr/local/lib/wxPython-$CHARTYPE-$VERSION |
132ae51e | 135 | BINPREFIX=/usr/local/bin |
1e4a197e | 136 | |
46456f61 | 137 | WXROOT=`dirname $PWD` |
1e4a197e RD |
138 | PROGDIR="`dirname \"$0\"`" |
139 | TMPDIR=$PWD/_build_dmg | |
140 | ||
141 | BUILDROOT=$TMPDIR/build | |
85245f48 RD |
142 | |
143 | INSTALLROOT=$TMPDIR/install-root | |
85245f48 RD |
144 | INSTALLAPPS=$TMPDIR/install-apps |
145 | ||
1e4a197e | 146 | DMGDIR=$TMPDIR/dmg |
85245f48 RD |
147 | DMGROOT=$DMGDIR/root |
148 | DMGAPPS=$DMGDIR/apps | |
149 | ||
1e4a197e RD |
150 | RESOURCEDIR=$PROGDIR/resources |
151 | DESTDIR=$PWD/dist | |
28d1454a | 152 | SRCROOT=$BUILDROOT/wxPython-src-$VERSION |
1e4a197e RD |
153 | |
154 | ||
155 | #---------------------------------------------------------------------- | |
156 | # Setup builddirs | |
157 | ||
158 | mkdir -p $BUILDROOT | |
159 | mkdir -p $INSTALLROOT | |
85245f48 RD |
160 | mkdir -p $INSTALLAPPS |
161 | ||
1e4a197e | 162 | rm -rf $DMGDIR |
85245f48 RD |
163 | mkdir -p $DMGROOT |
164 | mkdir -p $DMGAPPS/Docs | |
165 | mkdir -p $DMGAPPS/Samples | |
b42b447c | 166 | |
1e4a197e RD |
167 | |
168 | pushd $BUILDROOT | |
169 | ||
170 | ||
171 | #---------------------------------------------------------------------- | |
172 | # Unpack the tarball | |
173 | ||
81de4ba3 | 174 | if [ $skiptar != yes ]; then |
46456f61 RD |
175 | echo Unarchiving tarball... |
176 | tar xzf $TARBALL | |
1e4a197e RD |
177 | fi |
178 | ||
81de4ba3 RD |
179 | if [ $inplace = no ]; then |
180 | # make a build dir and cd to it. | |
28d1454a | 181 | cd wxPython-src-$VERSION |
81de4ba3 RD |
182 | WXDIR=`pwd` |
183 | mkdir -p $WXDIR/bld | |
184 | cd $WXDIR/bld | |
185 | WXBLD=$WXDIR/bld | |
186 | else | |
61074746 RD |
187 | |
188 | # If building "inplace" then our build dir will be off of the | |
189 | # WXROOT like normal, adjust the variables to find things that | |
190 | # way. | |
191 | WXBLD=$WXROOT/build-$CHARTYPE | |
192 | mkdir -p $WXBLD | |
193 | cd $WXBLD | |
194 | WXDIR=.. | |
81de4ba3 | 195 | SRCROOT=$WXROOT |
81de4ba3 RD |
196 | fi |
197 | ||
61074746 | 198 | echo "Using wx root dir: $WXROOT" |
81de4ba3 | 199 | echo "Using build dir: $WXBLD" |
61074746 | 200 | echo "Using source tree: $WXDIR" |
1e4a197e RD |
201 | |
202 | #---------------------------------------------------------------------- | |
203 | ||
204 | ||
b42b447c | 205 | # Configure wxWidgets |
81de4ba3 RD |
206 | if [ $skipconfig != yes ]; then |
207 | $WXDIR/configure \ | |
46456f61 RD |
208 | --prefix=$PREFIX \ |
209 | --with-mac \ | |
eac928f0 | 210 | --enable-monolithic \ |
1e4a197e | 211 | --with-opengl \ |
ec656cfe RD |
212 | --enable-sound \ |
213 | --enable-display \ | |
e2f7f062 | 214 | --enable-geometry \ |
28d1454a | 215 | --enable-debug_flag \ |
46456f61 | 216 | --enable-precomp=no \ |
28d1454a | 217 | --enable-optimise \ |
85245f48 | 218 | $UNICODEOPT |
1e4a197e | 219 | |
e2f7f062 | 220 | |
1e4a197e RD |
221 | fi |
222 | ||
b42b447c | 223 | # Build wxWidgets and wxPython |
81de4ba3 | 224 | if [ $skipbuild != yes ]; then |
1e4a197e | 225 | |
b42b447c | 226 | # Make wxWidgets and some contribs |
28d1454a | 227 | |
851067d0 RD |
228 | # For some reason Rez and DeRez have started locking up if run as |
229 | # root, figure out why, but in the meantime... | |
85245f48 RD |
230 | if [ "$UID" = "0" ]; then |
231 | chmod a+w lib | |
851067d0 RD |
232 | if [ "$CHARTYPE" = "ansi" ]; then |
233 | su robind -c "make lib/libwx_macd-2.5.3.r" | |
234 | else | |
235 | su robind -c "make lib/libwx_macud-2.5.3.r" | |
236 | fi | |
85245f48 | 237 | fi |
28d1454a | 238 | |
61074746 RD |
239 | make $MAKEJOBS |
240 | make $MAKEJOBS -C contrib/src/gizmos | |
241 | make $MAKEJOBS -C contrib/src/ogl CXXFLAGS="-DwxUSE_DEPRECATED=0" | |
242 | make $MAKEJOBS -C contrib/src/stc | |
46456f61 | 243 | |
46456f61 | 244 | # Build wxPython |
61074746 | 245 | cd $WXROOT/wxPython |
46456f61 | 246 | $PYTHON setup.py \ |
85245f48 | 247 | UNICODE=$PYUNICODEOPT \ |
46456f61 | 248 | NO_SCRIPTS=1 \ |
28d1454a | 249 | EP_ADD_OPTS=1 \ |
81de4ba3 RD |
250 | WX_CONFIG="$WXBLD/wx-config --inplace" \ |
251 | BUILD_BASE=$WXBLD/wxPython \ | |
1e4a197e | 252 | build |
1e4a197e RD |
253 | fi |
254 | ||
255 | #---------------------------------------------------------------------- | |
1e4a197e | 256 | |
81de4ba3 | 257 | if [ $skipinstall != yes ]; then |
b42b447c | 258 | # Install wxWidgets |
81de4ba3 | 259 | cd $WXBLD |
46456f61 RD |
260 | make prefix=$INSTALLROOT$PREFIX install |
261 | make -C contrib/src/gizmos prefix=$INSTALLROOT$PREFIX install | |
262 | make -C contrib/src/ogl CXXFLAGS="-DwxUSE_DEPRECATED=0" prefix=$INSTALLROOT/$PREFIX install | |
263 | make -C contrib/src/stc prefix=$INSTALLROOT$PREFIX install | |
1e4a197e RD |
264 | |
265 | ||
28d1454a RD |
266 | # relink wx-config with a relative link |
267 | cd $INSTALLROOT$PREFIX/bin | |
268 | rm wx-config | |
269 | ln -s ../lib/wx/config/* wx-config | |
270 | ||
1e4a197e | 271 | # and wxPython |
61074746 | 272 | cd $WXROOT/wxPython |
46456f61 | 273 | $PYTHON setup.py \ |
85245f48 | 274 | UNICODE=$PYUNICODEOPT \ |
46456f61 | 275 | NO_SCRIPTS=1 \ |
28d1454a | 276 | EP_ADD_OPTS=1 \ |
46456f61 | 277 | WX_CONFIG="$INSTALLROOT/$PREFIX/bin/wx-config --prefix=$INSTALLROOT/$PREFIX" \ |
81de4ba3 | 278 | BUILD_BASE=$WXBLD/wxPython \ |
1e4a197e RD |
279 | install \ |
280 | --root=$INSTALLROOT | |
281 | ||
46456f61 | 282 | |
c6387bc1 RD |
283 | # Apple's Python (on Panther) sym-links the site-packages dir to |
284 | # /Library/Python/$PYVER so we need to move the files so they are | |
285 | # installed in the physical location, not the virtual one. | |
286 | if [ "$KIND" = "panther" ]; then | |
81de4ba3 RD |
287 | if [ -e $INSTALLROOT/Library/Python/$PYVER ]; then |
288 | rm -r $INSTALLROOT/Library/Python/$PYVER | |
289 | fi | |
c6387bc1 RD |
290 | mkdir -p $INSTALLROOT/Library/Python/$PYVER |
291 | mv $INSTALLROOT/$SITEPACKAGES/* $INSTALLROOT/Library/Python/$PYVER | |
292 | rm -r $INSTALLROOT/System | |
293 | SITEPACKAGES=/Library/Python/$PYVER | |
294 | fi | |
295 | ||
79db03c9 RD |
296 | # install wxPython's tool scripts |
297 | mkdir -p $INSTALLROOT$BINPREFIX | |
61074746 | 298 | cd $WXROOT/wxPython/scripts |
79db03c9 | 299 | python$PYVER CreateMacScripts.py $INSTALLROOT $BINPREFIX |
85245f48 | 300 | |
1e4a197e | 301 | |
85245f48 RD |
302 | # Remove the .pyc/.pyo files they just take up space and can be recreated |
303 | # during the install. | |
61074746 | 304 | pushd $WXROOT/wxPython |
85245f48 RD |
305 | $PYTHON $PROGDIR/../zappycfiles.py $INSTALLROOT > /dev/null |
306 | popd | |
c6387bc1 | 307 | |
79db03c9 | 308 | # Set premissions for files in $INSTALLROOT |
132ae51e | 309 | if [ "$UID" = "0" ]; then |
79db03c9 RD |
310 | chown -R root:admin $INSTALLROOT |
311 | chmod -R g+w $INSTALLROOT | |
132ae51e | 312 | fi |
1e4a197e RD |
313 | fi |
314 | ||
85245f48 RD |
315 | if [ "$KIND" = "panther" ]; then |
316 | SITEPACKAGES=/Library/Python/$PYVER | |
317 | fi | |
79db03c9 | 318 | PKGDIR=`cat $INSTALLROOT$SITEPACKAGES/wx.pth` |
28d1454a | 319 | |
1e4a197e RD |
320 | popd |
321 | ||
322 | #---------------------------------------------------------------------- | |
323 | ||
324 | # Make the Installer packages and disk image | |
81de4ba3 | 325 | if [ $skipdmg != yes ]; then |
1e4a197e | 326 | |
85245f48 RD |
327 | #----------------------------------------------- |
328 | # The main runtime installer package | |
1e4a197e RD |
329 | |
330 | # Make the welcome message | |
46456f61 | 331 | case $KIND in |
c6387bc1 RD |
332 | panther) W_MSG="the Panther (OS X 10.3.x) version of" ;; |
333 | jaguar) W_MSG="the Jaguar (OS X 10.2.x) version of" ;; | |
46456f61 | 334 | esac |
85245f48 RD |
335 | |
336 | ||
1e4a197e RD |
337 | cat > $RESOURCEDIR/Welcome.txt <<EOF |
338 | Welcome! | |
339 | ||
85245f48 | 340 | This Installer package will install the wxPython $CHARTYPE runtime $VERSION for $W_MSG MacPython-OSX $PYVER. This includes: |
1e4a197e | 341 | |
85245f48 RD |
342 | * The wxPython packages and modules |
343 | * The wxWidgets shared libraries and headers | |
79db03c9 | 344 | * Some command line tool scripts, installed to /usr/local/bin. |
85245f48 RD |
345 | |
346 | You must install onto your current boot disk, eventhough the installer does not enforce this, otherwise things will not work. | |
347 | ||
79db03c9 | 348 | You can install more than one version of the wxPython runtime if you desire. The most recently installed version will be the default wxPython, but you can choose another by setting the PYTHONPATH or by using the wxversion module. See http://wiki.wxpython.org/index.cgi/MultiVersionInstalls for more details. |
c6387bc1 | 349 | |
1e4a197e RD |
350 | Build date: `date` |
351 | EOF | |
352 | ||
353 | # make the preflight script | |
354 | cat > $RESOURCEDIR/preflight <<EOF | |
355 | #!/bin/sh | |
356 | # Cleanup any old install of the wxPython package | |
357 | rm -rf \$2$SITEPACKAGES/wxPython | |
46456f61 | 358 | rm -rf \$2$SITEPACKAGES/wx |
28d1454a | 359 | rm -rf \$2$SITEPACKAGES/$PKGDIR |
1e4a197e RD |
360 | exit 0 |
361 | EOF | |
362 | chmod +x $RESOURCEDIR/preflight | |
363 | ||
364 | # make the postflight script | |
365 | cat > $RESOURCEDIR/postflight <<EOF | |
366 | #!/bin/sh -e | |
367 | # Compile the .py files in the wxPython pacakge | |
28d1454a RD |
368 | $PYTHON \$2$PYLIB/compileall.py \$2$SITEPACKAGES/$PKGDIR |
369 | $PYTHON -O \$2$PYLIB/compileall.py \$2$SITEPACKAGES/$PKGDIR | |
1e4a197e | 370 | |
c6387bc1 | 371 | # and all of the wxPython pacakge should be group writable |
28d1454a RD |
372 | chgrp -R admin \$2$SITEPACKAGES/$PKGDIR |
373 | chmod -R g+w \$2$SITEPACKAGES/$PKGDIR | |
1e4a197e RD |
374 | |
375 | exit 0 | |
376 | EOF | |
377 | chmod +x $RESOURCEDIR/postflight | |
378 | ||
85245f48 | 379 | |
1e4a197e | 380 | |
c6387bc1 | 381 | # Build the main Installer Package... |
bceb17b2 | 382 | rm -rf wxPython${SHORTVER}-osx-$CHARTYPE-$KIND.pkg |
1e4a197e | 383 | python $PROGDIR/../buildpkg.py \ |
bceb17b2 | 384 | --Title=wxPython${SHORTVER}-osx-$CHARTYPE-$KIND \ |
1e4a197e | 385 | --Version=$VERSION \ |
85245f48 | 386 | --Description="wxPython $CHARTYPE runtime $VERSION for $W_MSG MacPython-OSX $PYVER" \ |
1e4a197e RD |
387 | --NeedsAuthorization="YES" \ |
388 | --Relocatable="NO" \ | |
389 | --InstallOnly="YES" \ | |
390 | $INSTALLROOT \ | |
391 | $RESOURCEDIR | |
392 | ||
85245f48 | 393 | mv wxPython${SHORTVER}-osx-$CHARTYPE-$KIND.pkg $DMGROOT |
1e4a197e | 394 | |
85245f48 RD |
395 | rm $RESOURCEDIR/postflight |
396 | rm $RESOURCEDIR/preflight | |
397 | rm $RESOURCEDIR/Welcome.txt | |
1e4a197e | 398 | |
1e4a197e | 399 | |
85245f48 RD |
400 | #----------------------------------------------- |
401 | # Make a README to go on the disk image | |
402 | cat > "$DMGROOT/README 1st.txt" <<EOF | |
46456f61 RD |
403 | Welcome to wxPython! |
404 | ||
85245f48 RD |
405 | This disk image contains the following items: |
406 | ||
407 | wxPython${SHORTVER}-osx-$CHARTYPE-$VERSION-$KIND | |
408 | ||
79db03c9 RD |
409 | This Installer contains the wxPython runtime, compiled on a |
410 | $KIND OS X system, using the $CHARTYPE build of the wxWidgets | |
411 | library. It includes the Python modules and extension | |
412 | modules, as well as the wxWidgets libraries. | |
46456f61 | 413 | |
79db03c9 RD |
414 | It is possible to have more than one version of the runtime |
415 | installed at once if you wish. The most recently installed | |
416 | version will be the default wxPython, but you can choose | |
417 | another by setting the PYTHONPATH or by using the wxversion | |
418 | module. For more details see: | |
419 | http://wiki.wxpython.org/index.cgi/MultiVersionInstalls | |
85245f48 | 420 | |
85245f48 RD |
421 | |
422 | uninstall_wxPython.py | |
423 | ||
424 | A simple tool to help you manage your installed versions of | |
425 | wxPython. It will allow you to choose from the currently | |
426 | installed wxPython packages and to select one for | |
427 | uninstallation. It is a text-mode tool so you can either run | |
428 | it from a Terminal command line, or you can open it with | |
429 | PythonLauncher and let it create a Terminal to run it in. | |
430 | ||
61074746 RD |
431 | NOTE: If you have versions prior to 2.5.3.1 installed, please |
432 | do run this uninstall tool to remove the older version. | |
433 | ||
85245f48 RD |
434 | EOF |
435 | ||
436 | ||
437 | ||
438 | cp $PROGDIR/../uninstall_wxPython.py $DMGROOT | |
439 | ||
440 | ||
441 | #----------------------------------------------- | |
442 | # Make a disk image to hold these files | |
443 | dmgname=wxPython${SHORTVER}-osx-$CHARTYPE-$VERSION-$KIND-py$PYVER | |
444 | $PROGDIR/../makedmg $DMGROOT $DMGDIR $dmgname | |
445 | ||
446 | echo Moving $DMGDIR/$dmgname.dmg to $DESTDIR | |
447 | mv $DMGDIR/$dmgname.dmg $DESTDIR | |
448 | ||
449 | ||
450 | #--------------------------------------------------------------------------- | |
451 | # Now create app bundles for the demo, docs, and tools and make another | |
452 | # disk image to hold it all. | |
453 | #--------------------------------------------------------------------------- | |
454 | ||
455 | cat > "$DMGAPPS/README 1st.txt" <<EOF | |
456 | Welcome to wxPython! | |
1e4a197e | 457 | |
85245f48 RD |
458 | On this disk image you will find Demo, Tools, Docs, and etc. for |
459 | wxPython $VERSION. Everything here is optional and you can drag them | |
460 | out of the disk image and drop them wherever you want. You will need | |
461 | to have an installed wxPython runtime to be able to use any of them. | |
1e4a197e | 462 | |
46456f61 | 463 | |
85245f48 RD |
464 | wxPython Demo An application bundle version of the demo. |
465 | (This has it's own copy of the demo sources | |
466 | within the bundle.) | |
c6387bc1 | 467 | |
85245f48 | 468 | XRCed An application for editing wxPython resource |
c6387bc1 RD |
469 | files (XRC files.) |
470 | ||
85245f48 | 471 | PyCrust An application that provides an interactive |
c6387bc1 RD |
472 | Python shell and also namespace inspectors. |
473 | ||
b42b447c RD |
474 | |
475 | ||
81de4ba3 | 476 | Docs/wxDocsViewer An application that allows you to view the |
dcb1fb69 | 477 | wxWidgets documentation. |
b42b447c RD |
478 | |
479 | Docs/licence License files. | |
480 | ||
81de4ba3 | 481 | Docs/other A few readmes, change log, etc. |
b42b447c RD |
482 | |
483 | ||
81de4ba3 | 484 | Samples/samples Several small sample applications that |
b42b447c RD |
485 | demonstrate how to use wxPython. |
486 | ||
81de4ba3 | 487 | Samples/demo A copy of the wxPython demo source code, |
b42b447c RD |
488 | just open the folder and run demo.pyw. |
489 | ||
1e4a197e RD |
490 | Happy Hacking! |
491 | EOF | |
492 | ||
81de4ba3 | 493 | # PyAlaMode An extension of PyCrust that includes source |
c6387bc1 RD |
494 | # file editing capabilities. |
495 | ||
1e4a197e | 496 | |
b42b447c | 497 | # wxDocs |
28d1454a | 498 | if [ ! -e $TARBALLDIR/wxPython-docs-$VERSION.tar.gz ]; then |
85245f48 | 499 | cat > "$DMGAPPS/Docs/Build ERROR.txt" <<EOF |
dcb1fb69 | 500 | |
28d1454a | 501 | The wxPython-docs tarball was not found when building this disk image! |
81de4ba3 RD |
502 | |
503 | EOF | |
504 | ||
505 | else | |
506 | pushd $BUILDROOT | |
28d1454a | 507 | tar xzvf $TARBALLDIR/wxPython-docs-$VERSION.tar.gz |
81de4ba3 | 508 | popd |
dcb1fb69 | 509 | |
81de4ba3 RD |
510 | # Make an app to launch viewdocs.py |
511 | $PYTHONW $PROGDIR/../buildapp.py \ | |
85245f48 | 512 | --builddir=$DMGAPPS/Docs \ |
81de4ba3 RD |
513 | --name=wxDocsViewer \ |
514 | --mainprogram=$BUILDROOT/wxPython-$VERSION/docs/viewdocs.py \ | |
515 | --iconfile=$PROGDIR/Info.icns \ | |
516 | build | |
dcb1fb69 | 517 | |
85245f48 | 518 | cp $BUILDROOT/wxPython-$VERSION/docs/*.zip $DMGAPPS/Docs/wxDocsViewer.app/Contents/Resources |
81de4ba3 | 519 | |
85245f48 | 520 | cat > "$DMGAPPS/Docs/README 1st.txt" <<EOF |
dcb1fb69 RD |
521 | |
522 | The wxDocsViewer application needs to be copied to your Desktop (or | |
523 | someplace else you have write access to) before you can run it, so it | |
524 | can cache some indexes within its bundle. | |
525 | ||
526 | EOF | |
46456f61 | 527 | |
81de4ba3 RD |
528 | fi |
529 | ||
b42b447c | 530 | # license files, docs, etc. |
85245f48 | 531 | pushd $DMGAPPS/Docs |
b42b447c RD |
532 | cp -pR $SRCROOT/wxPython/licence . |
533 | cp -pR $SRCROOT/wxPython/docs . | |
534 | rm -rf docs/bin | |
535 | rm -rf docs/xml-raw | |
536 | mv docs other | |
537 | popd | |
81de4ba3 RD |
538 | |
539 | ||
28d1454a | 540 | if [ ! -e $TARBALLDIR/wxPython-demo-$VERSION.tar.gz ]; then |
85245f48 | 541 | cat > "$DMGAPPS/Samples/Build ERROR.txt" <<EOF |
81de4ba3 | 542 | |
28d1454a | 543 | The wxPython-demo tarball was not found when building this disk image! |
81de4ba3 RD |
544 | |
545 | EOF | |
85245f48 | 546 | cp "$DMGAPPS/Samples/Build ERROR.txt" $DMGAPPS |
81de4ba3 RD |
547 | |
548 | else | |
549 | ||
550 | # Copy the demo and samples to the disk image from the tarball | |
85245f48 | 551 | pushd $DMGAPPS/Samples |
28d1454a | 552 | tar xzvf $TARBALLDIR/wxPython-demo-$VERSION.tar.gz |
81de4ba3 RD |
553 | mv wxPython-$VERSION/* . |
554 | rm -rf wxPython-$VERSION | |
555 | rm demo/b demo/.setup.sh | |
556 | mv demo/demo.py demo/demo.pyw | |
557 | popd | |
558 | ||
559 | # Make an app bundle to run the demo | |
560 | $PYTHONW $PROGDIR/../buildapp.py \ | |
85245f48 | 561 | --builddir=$DMGAPPS \ |
81de4ba3 | 562 | --name="wxPython Demo" \ |
85245f48 | 563 | --mainprogram=$DMGAPPS/Samples/demo/demo.pyw \ |
81de4ba3 RD |
564 | --iconfile=$PROGDIR/RunDemo.icns \ |
565 | build | |
85245f48 | 566 | cp -pR $DMGAPPS/Samples/demo/* "$DMGAPPS/wxPython Demo.app/Contents/Resources" |
81de4ba3 RD |
567 | fi |
568 | ||
b42b447c | 569 | |
46456f61 RD |
570 | # Make an app bundle to launch PyCrust |
571 | $PYTHONW $PROGDIR/../buildapp.py \ | |
85245f48 | 572 | --builddir=$DMGAPPS \ |
46456f61 | 573 | --name=PyCrust \ |
79db03c9 | 574 | --mainprogram=$INSTALLROOT$BINPREFIX/pycrust.py \ |
46456f61 RD |
575 | --iconfile=$PROGDIR/PieShell.icns \ |
576 | build | |
577 | ||
79db03c9 RD |
578 | ## TODO: PyAlaMode needs tweaked to be able to run from a bundle. It |
579 | ## needs to know to ignore command line parameters and etc... | |
85245f48 RD |
580 | # # and PyAlaMode |
581 | # $PYTHONW $PROGDIR/../buildapp.py \ | |
582 | # --builddir=$DMGAPPS \ | |
583 | # --name=PyAlaMode \ | |
79db03c9 | 584 | # --mainprogram=$INSTALLROOT$BINPREFIX/pyalamode.py \ |
85245f48 RD |
585 | # --iconfile=$PROGDIR/PieShell.icns \ |
586 | # build | |
c6387bc1 | 587 | |
46456f61 RD |
588 | # Make an app to launch XRCed |
589 | $PYTHONW $PROGDIR/../buildapp.py \ | |
85245f48 | 590 | --builddir=$DMGAPPS \ |
46456f61 | 591 | --name=XRCed \ |
79db03c9 | 592 | --mainprogram=$INSTALLROOT$BINPREFIX/xrced.py \ |
46456f61 RD |
593 | --iconfile=$PROGDIR/XRCed.icns \ |
594 | build | |
595 | ||
81de4ba3 | 596 | |
1e4a197e | 597 | |
85245f48 | 598 | # and then finally make a disk image containing everything |
a74ed704 | 599 | dmgname=wxPython${SHORTVER}-osx-docs-demos-$VERSION-$KIND |
85245f48 | 600 | $PROGDIR/../makedmg $DMGAPPS $DMGDIR $dmgname |
1e4a197e | 601 | |
85245f48 RD |
602 | echo Moving $DMGDIR/$dmgname.dmg to $DESTDIR |
603 | mv $DMGDIR/$dmgname.dmg $DESTDIR | |
1e4a197e RD |
604 | fi |
605 | ||
606 | ||
607 | # Cleanup build/install dirs | |
81de4ba3 | 608 | if [ $skipclean != yes ]; then |
1e4a197e RD |
609 | echo "Cleaning up..." |
610 | rm -rf $TMPDIR | |
611 | else | |
612 | echo "Cleanup is disabled. You should remove $TMPDIR when finished" | |
613 | fi | |
614 |