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