]> git.saurik.com Git - wxWidgets.git/blame - wxPython/distrib/mac/wxPythonOSX/build
Don't uninstall common files if there is more than one wxPython installed
[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 220
851067d0
RD
221 # For some reason Rez and DeRez have started locking up if run as
222 # root, figure out why, but in the meantime...
85245f48
RD
223 if [ "$UID" = "0" ]; then
224 chmod a+w lib
851067d0
RD
225 if [ "$CHARTYPE" = "ansi" ]; then
226 su robind -c "make lib/libwx_macd-2.5.3.r"
227 else
228 su robind -c "make lib/libwx_macud-2.5.3.r"
229 fi
85245f48 230 fi
28d1454a 231
81de4ba3
RD
232 make
233 make -C contrib/src/gizmos
46456f61
RD
234 make -C contrib/src/ogl CXXFLAGS="-DwxUSE_DEPRECATED=0"
235 make -C contrib/src/stc
46456f61 236
46456f61 237 # Build wxPython
1e4a197e 238 cd $WXDIR/wxPython
46456f61 239 $PYTHON setup.py \
85245f48 240 UNICODE=$PYUNICODEOPT \
46456f61 241 NO_SCRIPTS=1 \
28d1454a 242 EP_ADD_OPTS=1 \
81de4ba3
RD
243 WX_CONFIG="$WXBLD/wx-config --inplace" \
244 BUILD_BASE=$WXBLD/wxPython \
1e4a197e 245 build
1e4a197e
RD
246fi
247
248#----------------------------------------------------------------------
1e4a197e 249
81de4ba3 250if [ $skipinstall != yes ]; then
b42b447c 251 # Install wxWidgets
81de4ba3 252 cd $WXBLD
46456f61
RD
253 make prefix=$INSTALLROOT$PREFIX install
254 make -C contrib/src/gizmos prefix=$INSTALLROOT$PREFIX install
255 make -C contrib/src/ogl CXXFLAGS="-DwxUSE_DEPRECATED=0" prefix=$INSTALLROOT/$PREFIX install
256 make -C contrib/src/stc prefix=$INSTALLROOT$PREFIX install
1e4a197e
RD
257
258
28d1454a
RD
259 # relink wx-config with a relative link
260 cd $INSTALLROOT$PREFIX/bin
261 rm wx-config
262 ln -s ../lib/wx/config/* wx-config
263
1e4a197e
RD
264 # and wxPython
265 cd $WXDIR/wxPython
46456f61 266 $PYTHON setup.py \
85245f48 267 UNICODE=$PYUNICODEOPT \
46456f61 268 NO_SCRIPTS=1 \
28d1454a 269 EP_ADD_OPTS=1 \
46456f61 270 WX_CONFIG="$INSTALLROOT/$PREFIX/bin/wx-config --prefix=$INSTALLROOT/$PREFIX" \
81de4ba3 271 BUILD_BASE=$WXBLD/wxPython \
1e4a197e
RD
272 install \
273 --root=$INSTALLROOT
274
46456f61 275
c6387bc1
RD
276 # Apple's Python (on Panther) sym-links the site-packages dir to
277 # /Library/Python/$PYVER so we need to move the files so they are
278 # installed in the physical location, not the virtual one.
279 if [ "$KIND" = "panther" ]; then
81de4ba3
RD
280 if [ -e $INSTALLROOT/Library/Python/$PYVER ]; then
281 rm -r $INSTALLROOT/Library/Python/$PYVER
282 fi
c6387bc1
RD
283 mkdir -p $INSTALLROOT/Library/Python/$PYVER
284 mv $INSTALLROOT/$SITEPACKAGES/* $INSTALLROOT/Library/Python/$PYVER
285 rm -r $INSTALLROOT/System
286 SITEPACKAGES=/Library/Python/$PYVER
287 fi
288
85245f48
RD
289 # move the common files to $INSTALLCOMMON
290 mkdir -p $INSTALLCOMMON$SITEPACKAGES
291 mv $INSTALLROOT$SITEPACKAGES/wx.pth $INSTALLCOMMON$SITEPACKAGES
292 mv $INSTALLROOT$SITEPACKAGES/wxversion.py $INSTALLCOMMON$SITEPACKAGES
c6387bc1 293
85245f48
RD
294 # install wxPython's tool scripts in COMMON too
295 mkdir -p $INSTALLCOMMON$BINPREFIX
1e4a197e 296 cd $WXDIR/wxPython/scripts
85245f48
RD
297 python$PYVER CreateMacScripts.py $INSTALLCOMMON $BINPREFIX
298
1e4a197e 299
85245f48
RD
300 # Remove the .pyc/.pyo files they just take up space and can be recreated
301 # during the install.
302 pushd $WXDIR/wxPython
303 $PYTHON $PROGDIR/../zappycfiles.py $INSTALLROOT > /dev/null
304 popd
c6387bc1 305
85245f48 306 # Set premissions for files in $INSTALLROOT and $INSTALLCOMMON
132ae51e 307 if [ "$UID" = "0" ]; then
85245f48
RD
308 chown -R root:admin $INSTALLROOT $INSTALLCOMMON
309 chmod -R g+w $INSTALLROOT $INSTALLCOMMON
132ae51e 310 fi
1e4a197e
RD
311fi
312
85245f48
RD
313if [ "$KIND" = "panther" ]; then
314 SITEPACKAGES=/Library/Python/$PYVER
315fi
316PKGDIR=`cat $INSTALLCOMMON$SITEPACKAGES/wx.pth`
28d1454a 317
1e4a197e
RD
318popd
319
320#----------------------------------------------------------------------
321
322# Make the Installer packages and disk image
81de4ba3 323if [ $skipdmg != yes ]; then
1e4a197e 324
85245f48
RD
325 #-----------------------------------------------
326 # The main runtime installer package
1e4a197e
RD
327
328 # Make the welcome message
46456f61 329 case $KIND in
c6387bc1
RD
330 panther) W_MSG="the Panther (OS X 10.3.x) version of" ;;
331 jaguar) W_MSG="the Jaguar (OS X 10.2.x) version of" ;;
46456f61 332 esac
85245f48
RD
333
334
1e4a197e
RD
335 cat > $RESOURCEDIR/Welcome.txt <<EOF
336Welcome!
337
85245f48 338This Installer package will install the wxPython $CHARTYPE runtime $VERSION for $W_MSG MacPython-OSX $PYVER. This includes:
1e4a197e 339
85245f48
RD
340 * The wxPython packages and modules
341 * The wxWidgets shared libraries and headers
342
343You must install onto your current boot disk, eventhough the installer does not enforce this, otherwise things will not work.
344
345You 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 346
1e4a197e
RD
347Build date: `date`
348EOF
349
350 # make the preflight script
351 cat > $RESOURCEDIR/preflight <<EOF
352#!/bin/sh
353# Cleanup any old install of the wxPython package
354rm -rf \$2$SITEPACKAGES/wxPython
46456f61 355rm -rf \$2$SITEPACKAGES/wx
28d1454a 356rm -rf \$2$SITEPACKAGES/$PKGDIR
1e4a197e
RD
357exit 0
358EOF
359 chmod +x $RESOURCEDIR/preflight
360
361 # make the postflight script
362 cat > $RESOURCEDIR/postflight <<EOF
363#!/bin/sh -e
364# Compile the .py files in the wxPython pacakge
28d1454a
RD
365$PYTHON \$2$PYLIB/compileall.py \$2$SITEPACKAGES/$PKGDIR
366$PYTHON -O \$2$PYLIB/compileall.py \$2$SITEPACKAGES/$PKGDIR
1e4a197e 367
c6387bc1 368# and all of the wxPython pacakge should be group writable
28d1454a
RD
369chgrp -R admin \$2$SITEPACKAGES/$PKGDIR
370chmod -R g+w \$2$SITEPACKAGES/$PKGDIR
1e4a197e
RD
371
372exit 0
373EOF
374 chmod +x $RESOURCEDIR/postflight
375
85245f48 376
1e4a197e 377
c6387bc1 378 # Build the main Installer Package...
bceb17b2 379 rm -rf wxPython${SHORTVER}-osx-$CHARTYPE-$KIND.pkg
1e4a197e 380 python $PROGDIR/../buildpkg.py \
bceb17b2 381 --Title=wxPython${SHORTVER}-osx-$CHARTYPE-$KIND \
1e4a197e 382 --Version=$VERSION \
85245f48 383 --Description="wxPython $CHARTYPE runtime $VERSION for $W_MSG MacPython-OSX $PYVER" \
1e4a197e
RD
384 --NeedsAuthorization="YES" \
385 --Relocatable="NO" \
386 --InstallOnly="YES" \
387 $INSTALLROOT \
388 $RESOURCEDIR
389
85245f48 390 mv wxPython${SHORTVER}-osx-$CHARTYPE-$KIND.pkg $DMGROOT
1e4a197e 391
85245f48
RD
392 rm $RESOURCEDIR/postflight
393 rm $RESOURCEDIR/preflight
394 rm $RESOURCEDIR/Welcome.txt
1e4a197e 395
1e4a197e 396
85245f48
RD
397 #-----------------------------------------------
398 # The common files package
399
400 # Make the welcome message
401 cat > $RESOURCEDIR/Welcome.txt <<EOF
402Welcome!
403
404This 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.
405
406EOF
407
408 # Build the common Installer Package...
409 rm -rf wxPython-common-osx-$KIND.pkg
410 python $PROGDIR/../buildpkg.py \
411 --Title=wxPython-common-osx-$KIND \
412 --Version=$VERSION \
413 --Description="Common files for the wxPython runtime ($CHARTYPE-$VERSION)" \
414 --NeedsAuthorization="YES" \
415 --Relocatable="NO" \
416 --InstallOnly="YES" \
417 $INSTALLCOMMON \
418 $RESOURCEDIR
419
420 mv wxPython-common-osx-$KIND.pkg $DMGROOT
421
422 rm $RESOURCEDIR/Welcome.txt
423
424
425
426 #-----------------------------------------------
427 # Make a README to go on the disk image
428 cat > "$DMGROOT/README 1st.txt" <<EOF
46456f61
RD
429Welcome to wxPython!
430
85245f48
RD
431This disk image contains the following items:
432
433 wxPython${SHORTVER}-osx-$CHARTYPE-$VERSION-$KIND
434
435 This is the main component of the wxPython runtime. It
436 includes the Python modules and extension modules, as well as
437 the wxWidgets libraries. It is possible to have more than one
438 version of the runtime installed at once if you wish, See
439 http://wkik.wxpython.org/index.cgi/MultiVersionInstalls
440 for details on how to choose which version is installed.
441
46456f61 442
85245f48
RD
443 wxPython-common-osx-$CHARTYPE-$VERSION-$KIND
444
445 This is the common files for the runtime that are shared
446 between all versions of the runtime. You need to have one of
447 these installed and it will determine which of the runtimes is
448 the default one that is imported with "import wx", so it
449 should match the version and character type of one of the
450 installed runtimes. If you are wanting to have only one
451 wxPython installed then be sure to install both of the
452 packages in this disk image.
453
454 uninstall_wxPython.py
455
456 A simple tool to help you manage your installed versions of
457 wxPython. It will allow you to choose from the currently
458 installed wxPython packages and to select one for
459 uninstallation. It is a text-mode tool so you can either run
460 it from a Terminal command line, or you can open it with
461 PythonLauncher and let it create a Terminal to run it in.
462
463EOF
464
465
466
467 cp $PROGDIR/../uninstall_wxPython.py $DMGROOT
468
469
470 #-----------------------------------------------
471 # Make a disk image to hold these files
472 dmgname=wxPython${SHORTVER}-osx-$CHARTYPE-$VERSION-$KIND-py$PYVER
473 $PROGDIR/../makedmg $DMGROOT $DMGDIR $dmgname
474
475 echo Moving $DMGDIR/$dmgname.dmg to $DESTDIR
476 mv $DMGDIR/$dmgname.dmg $DESTDIR
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 \
85245f48 603 --mainprogram=$INSTALLCOMMON$BINPREFIX/pycrust.py \
46456f61
RD
604 --iconfile=$PROGDIR/PieShell.icns \
605 build
606
85245f48
RD
607# # and PyAlaMode
608# $PYTHONW $PROGDIR/../buildapp.py \
609# --builddir=$DMGAPPS \
610# --name=PyAlaMode \
611# --mainprogram=$INSTALLCOMMON$BINPREFIX/pyalamode.py \
612# --iconfile=$PROGDIR/PieShell.icns \
613# build
c6387bc1 614
46456f61
RD
615 # Make an app to launch XRCed
616 $PYTHONW $PROGDIR/../buildapp.py \
85245f48 617 --builddir=$DMGAPPS \
46456f61 618 --name=XRCed \
85245f48 619 --mainprogram=$INSTALLCOMMON$BINPREFIX/xrced.py \
46456f61
RD
620 --iconfile=$PROGDIR/XRCed.icns \
621 build
622
81de4ba3 623
1e4a197e 624
85245f48
RD
625 # and then finally make a disk image containing everything
626 dmgname=wxPython${SHORTVER}-osx-docs-demos-$VERSION
627 $PROGDIR/../makedmg $DMGAPPS $DMGDIR $dmgname
1e4a197e 628
85245f48
RD
629 echo Moving $DMGDIR/$dmgname.dmg to $DESTDIR
630 mv $DMGDIR/$dmgname.dmg $DESTDIR
1e4a197e
RD
631fi
632
633
634# Cleanup build/install dirs
81de4ba3 635if [ $skipclean != yes ]; then
1e4a197e
RD
636 echo "Cleaning up..."
637 rm -rf $TMPDIR
638else
639 echo "Cleanup is disabled. You should remove $TMPDIR when finished"
640fi
641