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