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