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