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