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