~ubuntu-branches/ubuntu/maverick/wxwidgets2.8/maverick-proposed

« back to all changes in this revision

Viewing changes to wxPython/distrib/all/do-build-osx

  • Committer: Bazaar Package Importer
  • Author(s): Devid Filoni
  • Date: 2007-11-06 18:25:13 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20071106182513-809agqds6igh7mqo
Tags: 2.8.6.1-0ubuntu1
* New upstream version, based on the upstream tarball
  wxPython-src-2.8.6.1.tar.bz2, renamed debian to debian-upstream.
* Provide a get-orig-source target to do the repackaging.
* Fix "substvar-source-version-is-deprecated" lintian warnings.
* Remove duplicate Description field in debian/control.
* Add "\" at the end of line 8 in debian/python-wxtools.menu to fix
  "bad-test-in-menu-item" lintian error.
* Provide .xpm icons to fix "menu-icon-not-in-xpm-format" lintian errors,
  changed Icon field in debian/python-wxtools.menu.
* Fix "wrong-name-for-upstream-changelog" lintian warnings.
* Remove "Application;" from Categories field in debian/pycrust.desktop,
  debian/pyshell.desktop, debian/xrced.desktop.
* Switch "Apps" to "Applications" in debian/python-wxtools.menu to fix
  "menu-item-uses-apps-section" lintian warnings.
* Drop the icon extension from debian/pycrust.desktop,
  debian/pyshell.desktop, debian/xrced.desktop.
* Add dpatch support.
* Add "WX_CONFIG" patch.
* debian/rules:
  - added .xpm icons to install-gtk-py-tools target
  - added "docs/changes.txt" to dh_installchangelogs in binary-common target
  - added "\" at the end of "install-examples install-msw-dev
    install-msw-dbg install-headers-msw" line in .PHONY

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/bash
2
2
# ---------------------------------------------------------------------------
3
 
# Build wxWidgets and wxPython on a OSX box.  This is normally 
4
 
# called from build-all but it should be able to be used standalone too...
 
3
# Build wxWidgets and wxPython on a OSX box.  This is normally called
 
4
# remotely from build-all but it should be able to be used standalone
 
5
# too...
5
6
6
7
# The command line must have the following parameters:
7
8
#
11
12
#    4. the VERSION
12
13
#    5. the version of Python to build for
13
14
#    6. the character type (ansi|unicode|both)
14
 
#    7. optional flags to pass on to the build script
15
15
#
16
16
# ---------------------------------------------------------------------------
17
17
 
18
18
set -o errexit
19
 
#set -o xtrace
 
19
set -o xtrace
20
20
 
21
21
echo "-=-=-=-  Hello from $HOSTNAME  -=-=-=-"
22
22
 
31
31
VERSION=$4
32
32
PYVER=$5
33
33
CHARTYPE=$6
34
 
FLAGS=$7
35
34
 
36
35
 
37
36
#export PATH=/sw/bin:/usr/local/bin:$PATH
38
37
export PATH=/sw/bin:/sw/sbin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin:.:/usr/X11R6/bin
39
 
echo "PATH =" $PATH
40
 
echo "which gcc = " `which gcc`
41
 
#exit 0
42
38
 
43
39
# untar the source 
44
40
echo "Unarchiving wxPython-src-$VERSION.tar.bz2"
47
43
rm wxPython-src-$VERSION.tar.bz2
48
44
 
49
45
 
50
 
echo "Invoking wxPythonOSX build script..."
51
46
cd $WXDIR/wxPython
52
47
export TARBALLDIR=$DESTDIR
53
48
mkdir -p dist
 
49
 
 
50
 
 
51
#----------------------------------------------------------------------
 
52
# Do a universal build of wxWidgets and wxPython.  This is a
 
53
# simplified version of parts of the old distrib/mac/wxPythonOSX/build 
 
54
# script.
 
55
 
 
56
OSX_VERSION=`sw_vers -productVersion`
 
57
OSX_VERSION=${OSX_VERSION:0:4}
 
58
TAG=universal
 
59
PYTHON=`which python$PYVER`
 
60
PYTHONW=`which pythonw$PYVER`
 
61
SHORTVER=${VERSION:0:3}
 
62
PYPREFIX=`$PYTHON -c "import sys; print sys.exec_prefix"`
 
63
PYLIB=$PYPREFIX/lib/python$PYVER
 
64
 
 
65
# Test if the python we are using is the System installed framework 
 
66
# or one that was installed by the user.  This changes where the 
 
67
# site-packages (or its alias) is located in the installer tree.
 
68
APPLE_PYTHON=no
 
69
if [ -e /Library/Python/$PYVER ] && [ `dirname $PYTHON` == "/usr/bin" ]; then
 
70
    APPLE_PYTHON=yes
 
71
fi
 
72
 
 
73
 
 
74
TARBALL=$TARBALLDIR/wxPython-src-$VERSION.tar.bz2
 
75
 
 
76
if [ ! -e $TARBALLDIR/wxPython-demo-$VERSION.tar.bz2 ]; then 
 
77
    echo "-------------------------------------------------------"
 
78
    echo " WARNING:  Demo tarball not found, will skip building "
 
79
    echo "           the Demo app bundle and etc."
 
80
    echo " $TARBALLDIR/wxPython-demo-$VERSION.tar.bz2"
 
81
    echo "-------------------------------------------------------"
 
82
fi
 
83
 
 
84
if [ ! -e $TARBALLDIR/wxPython-docs-$VERSION.tar.bz2 ]; then
 
85
    echo "-------------------------------------------------------"
 
86
    echo " WARNING:  Docs tarball not found, will skip building "
 
87
    echo "           the the wxDocsViewer app bundle and etc."
 
88
    echo " $TARBALLDIR/wxPython-docs-$VERSION.tar.bz2"
 
89
    echo "-------------------------------------------------------"
 
90
fi
 
91
 
 
92
 
 
93
 
 
94
 
 
95
 
 
96
function do_universal_build {
 
97
 
 
98
    CTYPE=$1
 
99
    if [ $CTYPE = unicode ]; then 
 
100
        PYUNICODEOPT=1
 
101
    else
 
102
        PYUNICODEOPT=0
 
103
    fi
 
104
 
 
105
    SITEPACKAGES=$PYLIB/site-packages
 
106
    PREFIX=/usr/local/lib/wxPython-$CTYPE-$VERSION
 
107
    BINPREFIX=/usr/local/bin
 
108
    WXROOT=$WXDIR
 
109
    TMPDIR=$DESTDIR/_build_
 
110
    BUILDROOT=$TMPDIR/build
 
111
    INSTALLROOT=$TMPDIR/install-root
 
112
    INSTALLAPPS=$TMPDIR/install-apps
 
113
 
 
114
    DMGDIR=$TMPDIR/dmg
 
115
    DMGROOT=$DMGDIR/root
 
116
    DMGAPPS=$DMGDIR/apps
 
117
 
 
118
    PROGDIR=$WXDIR/wxPython/distrib/mac
 
119
    RESOURCEDIR=$PROGDIR/resources
 
120
 
 
121
 
 
122
    # Setup build dirs
 
123
    mkdir -p $BUILDROOT
 
124
    mkdir -p $INSTALLROOT
 
125
    mkdir -p $INSTALLAPPS
 
126
 
 
127
    rm -rf $DMGDIR
 
128
    mkdir -p $DMGROOT
 
129
    mkdir -p $DMGAPPS/Docs
 
130
    mkdir -p $DMGAPPS/Samples
 
131
 
 
132
    pushd $BUILDROOT
 
133
 
 
134
 
 
135
    #-----------------------------------------------------------------
 
136
    # Build and install wxWidgets
 
137
    export WXROOT
 
138
    export BUILDPREFIX=$PREFIX
 
139
    export INSTALLDIR=$INSTALLROOT$PREFIX
 
140
    $WXDIR/distrib/scripts/mac/macbuild-lipo wxpython $CTYPE
 
141
 
 
142
    # relink wx-config with a relative link
 
143
    cd $INSTALLROOT$PREFIX/bin
 
144
    rm wx-config
 
145
    ln -s ../lib/wx/config/* wx-config
 
146
 
 
147
    #-----------------------------------------------------------------
 
148
    # Now wxPython.  Build ppc, then i386
 
149
    ARCH=ppc
 
150
    export CXX="g++-3.3 -arch $ARCH -DMAC_OS_X_VERSION_MAX_ALLOWED=1030"
 
151
    export CC="gcc-3.3 -arch $ARCH -DMAC_OS_X_VERSION_MAX_ALLOWED=1030"
 
152
    export MACOSX_DEPLOYMENT_TARGET=10.3
 
153
    mkdir -p $INSTALLROOT/$ARCH
 
154
    mkdir -p $BUILDROOT/$ARCH
 
155
        
 
156
    echo "Building wxPython for PPC..."
 
157
    cd $WXROOT/wxPython
 
158
    $PYTHON setup.py \
 
159
        UNICODE=$PYUNICODEOPT \
 
160
        NO_SCRIPTS=1 \
 
161
        EP_ADD_OPTS=1 \
 
162
        WX_CONFIG="$INSTALLROOT/$PREFIX/bin/wx-config --prefix=$INSTALLROOT$PREFIX" \
 
163
        BUILD_BASE=$BUILDROOT/$ARCH/wxPython \
 
164
        ARCH="$ARCH" \
 
165
        build
 
166
        
 
167
    ARCH=i386
 
168
    export CXX="g++-4.0 -arch $ARCH"
 
169
    export CC="gcc-4.0 -arch $ARCH"
 
170
    export MACOSX_DEPLOYMENT_TARGET=10.4
 
171
    mkdir -p $INSTALLROOT/$ARCH
 
172
    mkdir -p $BUILDROOT/$ARCH
 
173
        
 
174
    echo "Building wxPython for Intel..."        
 
175
    cd $WXROOT/wxPython
 
176
    $PYTHON setup.py \
 
177
        UNICODE=$PYUNICODEOPT \
 
178
        NO_SCRIPTS=1 \
 
179
        EP_ADD_OPTS=1 \
 
180
        WX_CONFIG="$INSTALLROOT/$PREFIX/bin/wx-config --prefix=$INSTALLROOT$PREFIX" \
 
181
        BUILD_BASE=$BUILDROOT/$ARCH/wxPython \
 
182
        ARCH="$ARCH" \
 
183
        build
 
184
 
 
185
 
 
186
 
 
187
    #-----------------------------------------------------------------
 
188
    # Install the two builds of wxPython
 
189
 
 
190
    ARCH=ppc
 
191
    export CXX="g++-3.3 -arch $ARCH -DMAC_OS_X_VERSION_MAX_ALLOWED=1030"
 
192
    export CC="gcc-3.3 -arch $ARCH -DMAC_OS_X_VERSION_MAX_ALLOWED=1030"
 
193
    export MACOSX_DEPLOYMENT_TARGET=10.3
 
194
    cd $WXROOT/wxPython
 
195
    $PYTHON setup.py \
 
196
        UNICODE=$PYUNICODEOPT \
 
197
        NO_SCRIPTS=1 \
 
198
        EP_ADD_OPTS=1 \
 
199
        WX_CONFIG="$INSTALLROOT$PREFIX/bin/wx-config --prefix=$INSTALLROOT$PREFIX" \
 
200
        BUILD_BASE=$BUILDROOT/$ARCH/wxPython \
 
201
        install \
 
202
        --root=$INSTALLROOT/$ARCH
 
203
 
 
204
    ARCH=i386
 
205
    export CXX="g++-4.0 -arch $ARCH"
 
206
    export CC="gcc-4.0 -arch $ARCH"
 
207
    export MACOSX_DEPLOYMENT_TARGET=10.4
 
208
    cd $WXROOT/wxPython
 
209
    $PYTHON setup.py \
 
210
        UNICODE=$PYUNICODEOPT \
 
211
        NO_SCRIPTS=1 \
 
212
        EP_ADD_OPTS=1 \
 
213
        WX_CONFIG="$INSTALLROOT$PREFIX/bin/wx-config --prefix=$INSTALLROOT$PREFIX" \
 
214
        BUILD_BASE=$BUILDROOT/$ARCH/wxPython \
 
215
        install \
 
216
        --root=$INSTALLROOT/$ARCH
 
217
 
 
218
    # Lipo them together
 
219
    echo "Lipoing $INSTALLROOT/ppc and $INSTALLROOT/i386..."
 
220
    $PYTHON $WXROOT/distrib/scripts/mac/lipo-dir.py $INSTALLROOT/ppc $INSTALLROOT/i386 $INSTALLROOT
 
221
    
 
222
    rm -rf $INSTALLROOT/ppc $INSTALLROOT/i386
 
223
 
 
224
 
 
225
    # Apple's Python Framework (such as what comes with Panther)
 
226
    # sym-links the site-packages dir in the framework to
 
227
    # /Library/Python/$PYVER so we need to move the files so they are
 
228
    # installed in the physical location, not the virtual one.
 
229
    if [ $APPLE_PYTHON == yes ]; then
 
230
        if [ -e $INSTALLROOT/Library/Python/$PYVER ]; then
 
231
            rm -r $INSTALLROOT/Library/Python/$PYVER
 
232
        fi          
 
233
        mkdir -p $INSTALLROOT/Library/Python/$PYVER
 
234
        mv $INSTALLROOT/$SITEPACKAGES/* $INSTALLROOT/Library/Python/$PYVER
 
235
        rm -r $INSTALLROOT/System
 
236
        SITEPACKAGES=/Library/Python/$PYVER
 
237
    fi
 
238
    PKGDIR=`cat $INSTALLROOT$SITEPACKAGES/wx.pth`
 
239
 
 
240
    # install wxPython's tool scripts
 
241
    mkdir -p $INSTALLROOT$BINPREFIX
 
242
    cd $WXROOT/wxPython/scripts
 
243
    $PYTHON CreateMacScripts.py $INSTALLROOT $BINPREFIX
 
244
 
 
245
 
 
246
    # Remove the .pyc/.pyo files they just take up space and can be recreated
 
247
    # during the install.
 
248
    pushd $WXROOT/wxPython
 
249
    $PYTHON $WXROOT/wxPython/distrib/mac/zappycfiles.py $INSTALLROOT > /dev/null
 
250
    popd
 
251
 
 
252
    # Set premissions for files in $INSTALLROOT
 
253
    if [ "$UID" = "0" ]; then
 
254
        chown -R root:admin $INSTALLROOT
 
255
        chmod -R g+w        $INSTALLROOT
 
256
    fi
 
257
 
 
258
 
 
259
 
 
260
    #-----------------------------------------------------------------
 
261
    # Make the Installer package and disk image
 
262
 
 
263
    # first some resource files
 
264
    cat > $RESOURCEDIR/Welcome.txt <<EOF
 
265
Welcome!
 
266
 
 
267
This Installer package will install the wxPython $CTYPE runtime $VERSION for the Universal version of MacPython-OSX $PYVER.  This includes:
 
268
 
 
269
    * The wxPython extension modules and library packages
 
270
    * The wxWidgets shared libraries and headers
 
271
    * Some command line tool scripts, installed to /usr/local/bin.
 
272
 
 
273
You must install onto your current boot disk, even though the installer does not enforce this, otherwise things will not work.
 
274
 
 
275
You 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.
 
276
 
 
277
Build date:   `date`
 
278
EOF
 
279
 
 
280
    # make the preflight script
 
281
    cat > $RESOURCEDIR/preflight <<EOF
 
282
#!/bin/sh
 
283
# Cleanup any old install of the wxPython package
 
284
rm -rf \$2$SITEPACKAGES/wxPython
 
285
rm -rf \$2$SITEPACKAGES/wx
 
286
rm -rf \$2$SITEPACKAGES/$PKGDIR
 
287
exit 0
 
288
EOF
 
289
    chmod +x $RESOURCEDIR/preflight
 
290
 
 
291
    # make the postflight script
 
292
    cat > $RESOURCEDIR/postflight <<EOF
 
293
#!/bin/sh -e
 
294
 
 
295
# Compile the .py files in the wxPython pacakge
 
296
COMPILE=\$2$PYLIB/compileall.py
 
297
if [ ! -e \$COMPILE ]; then
 
298
    COMPILE=\$2$PYLIB/compileall.pyc
 
299
fi
 
300
if [ -e \$COMPILE ]; then 
 
301
    $PYTHON    \$COMPILE \$2$SITEPACKAGES/$PKGDIR
 
302
    $PYTHON -O \$COMPILE \$2$SITEPACKAGES/$PKGDIR
 
303
fi
 
304
 
 
305
# and all of the wxPython pacakge should be group writable
 
306
chgrp -R admin \$2$SITEPACKAGES/$PKGDIR
 
307
chmod -R g+w \$2$SITEPACKAGES/$PKGDIR
 
308
 
 
309
EOF
 
310
 
 
311
    # On Tiger the structure of the user installable dir changed
 
312
    # slightly.  Since we are installing the files as if it were
 
313
    # Panther then we need this little tweak to make it compatible.
 
314
    if [ $APPLE_PYTHON == yes ]; then
 
315
        cat >> $RESOURCEDIR/postflight <<EOF
 
316
# Add a .pth file for Tiger so our wx.pth can be found before the default wx from Apple
 
317
if [ -e \$2$SITEPACKAGES/site-packages ]; then
 
318
    echo "import site; site.addsitedir('$SITEPACKAGES')" > \$2$SITEPACKAGES/site-packages/00-compat-wx-path.pth
 
319
fi
 
320
EOF
 
321
    fi
 
322
 
 
323
cat >> $RESOURCEDIR/postflight <<EOF
 
324
exit 0
 
325
EOF
 
326
    chmod +x $RESOURCEDIR/postflight
 
327
 
 
328
 
 
329
 
 
330
    # Build the main Installer Package...
 
331
    PKGNAME=wxPython${SHORTVER}-osx-$CTYPE-$TAG-py$PYVER
 
332
    rm -rf $PKGNAME.pkg
 
333
    $PYTHON $PROGDIR/buildpkg.py \
 
334
        --Title=$PKGNAME \
 
335
        --Version=$VERSION \
 
336
        --Description="wxPython $CTYPE runtime $VERSION for the Universal version of MacPython-OSX $PYVER" \
 
337
        --NeedsAuthorization="YES" \
 
338
        --Relocatable="NO" \
 
339
        --InstallOnly="YES" \
 
340
        $INSTALLROOT \
 
341
        $RESOURCEDIR
 
342
 
 
343
    mv $PKGNAME.pkg $DMGROOT/$PKGNAME.pkg
 
344
 
 
345
    rm $RESOURCEDIR/postflight
 
346
    rm $RESOURCEDIR/preflight
 
347
    rm $RESOURCEDIR/Welcome.txt
 
348
 
 
349
 
 
350
    cat > "$DMGROOT/README 1st.txt" <<EOF
 
351
Welcome to wxPython!
 
352
 
 
353
This disk image contains the following items:
 
354
 
 
355
    wxPython${SHORTVER}-osx-$CTYPE-$VERSION-$TAG
 
356
 
 
357
        This Installer contains the wxPython runtime, built using the
 
358
        $CTYPE build of the wxWidgets library.  It includes the
 
359
        Python modules and extension modules for wxPython, as well as
 
360
        the wxWidgets libraries.
 
361
 
 
362
        It is possible to have more than one version of the runtime
 
363
        installed at once if you wish.  The most recently installed
 
364
        version will be the default wxPython, but you can choose
 
365
        another by setting the PYTHONPATH or by using the wxversion
 
366
        module.  For more details see:
 
367
        http://wiki.wxpython.org/index.cgi/MultiVersionInstalls 
 
368
 
 
369
 
 
370
    uninstall_wxPython.py
 
371
 
 
372
        A simple tool to help you manage your installed versions of
 
373
        wxPython.  It will allow you to choose from the currently
 
374
        installed wxPython packages and to select one for
 
375
        uninstallation.  It is a text-mode tool so you can either run
 
376
        it from a Terminal command line, or you can open it with
 
377
        PythonLauncher and let it create a Terminal to run it in.
 
378
 
 
379
        NOTE: If you have versions prior to 2.5.3.1 installed, please
 
380
        do run this uninstall tool to remove the older version.
 
381
 
 
382
EOF
 
383
 
 
384
 
 
385
    cp $PROGDIR/uninstall_wxPython.py $DMGROOT
 
386
 
 
387
    # Make a disk image to hold these files
 
388
    dmgname=wxPython${SHORTVER}-osx-$CTYPE-$VERSION-$TAG-py$PYVER
 
389
    $PROGDIR/makedmg $DMGROOT $DMGDIR $dmgname
 
390
 
 
391
    echo Moving $DMGDIR/$dmgname.dmg to $DESTDIR
 
392
    mv $DMGDIR/$dmgname.dmg  $DESTDIR/$dmgname.dmg
 
393
 
 
394
 
 
395
 
 
396
    #-----------------------------------------------------------------
 
397
    # Now create app bundles for the demo, docs, and tools and make
 
398
    # another disk image to hold it all.
 
399
 
 
400
    cat > "$DMGAPPS/README 1st.txt" <<EOF
 
401
Welcome to wxPython!
 
402
 
 
403
On this disk image you will find Demo, Tools, Docs, and etc. for
 
404
wxPython $VERSION.  
 
405
 
 
406
Everything here is optional and you can drag them out of the disk
 
407
image and drop them wherever you want.  You will need to have an
 
408
installed wxPython runtime to be able to use any of them.
 
409
 
 
410
 
 
411
   wxPython Demo        An application bundle version of the demo.
 
412
                        (This has it's own copy of the demo sources 
 
413
                        within the bundle so you can move the whole 
 
414
                        bundle around as needed.)
 
415
 
 
416
   XRCed                An application for editing wxPython resource
 
417
                        files  (XRC files.)
 
418
 
 
419
   PyCrust              An application that provides an interactive
 
420
                        Python shell and also namespace inspectors.
 
421
 
 
422
 
 
423
 
 
424
   Docs/wxDocsViewer    An application that allows you to view the
 
425
                        wxWidgets documentation.
 
426
 
 
427
   Docs/licence         License files.
 
428
 
 
429
   Docs/other           A few readmes, change log, etc.
 
430
 
 
431
 
 
432
   Samples/samples      Several small sample applications that
 
433
                        demonstrate how to use wxPython.
 
434
 
 
435
   Samples/demo         A copy of the wxPython demo source code,
 
436
                        just open the folder and run demo.pyw.
 
437
 
 
438
Happy Hacking!
 
439
EOF
 
440
 
 
441
#   PyAlaMode            An extension of PyCrust that includes source
 
442
#                        file editing capabilities.
 
443
 
 
444
 
 
445
    # wxDocs
 
446
    if [ ! -e $TARBALLDIR/wxPython-docs-$VERSION.tar.bz2 ]; then
 
447
        cat > "$DMGAPPS/Docs/Build ERROR.txt" <<EOF
 
448
 
 
449
The wxPython-docs tarball was not found when building this disk image!
 
450
 
 
451
EOF
 
452
 
 
453
    else
 
454
        pushd $BUILDROOT
 
455
        tar xjvf $TARBALLDIR/wxPython-docs-$VERSION.tar.bz2
 
456
        popd
 
457
 
 
458
        # Make an app to launch viewdocs.py
 
459
        $PYTHONW $PROGDIR/buildapp.py \
 
460
            --builddir=$DMGAPPS/Docs \
 
461
            --name=wxDocsViewer \
 
462
            --mainprogram=$BUILDROOT/wxPython-$VERSION/docs/viewdocs.py \
 
463
            --iconfile=$PROGDIR/Info.icns \
 
464
            build
 
465
 
 
466
        cp $BUILDROOT/wxPython-$VERSION/docs/*.zip $DMGAPPS/Docs/wxDocsViewer.app/Contents/Resources
 
467
 
 
468
        cat > "$DMGAPPS/Docs/README 1st.txt" <<EOF
 
469
 
 
470
The wxDocsViewer application needs to be copied to your Desktop (or
 
471
someplace else you have write access to) before you can run it, so it
 
472
can cache some indexes within its bundle.
 
473
 
 
474
EOF
 
475
 
 
476
    fi
 
477
 
 
478
    # license files, docs, etc.
 
479
    pushd $DMGAPPS/Docs
 
480
    cp -pR $WXDIR/wxPython/licence   .
 
481
    cp -pR $WXDIR/wxPython/docs      .
 
482
    rm -rf docs/bin
 
483
    rm -rf docs/xml-raw
 
484
    mv docs other
 
485
    popd
 
486
 
 
487
 
 
488
    if [ ! -e $TARBALLDIR/wxPython-demo-$VERSION.tar.bz2 ]; then
 
489
        cat > "$DMGAPPS/Samples/Build ERROR.txt" <<EOF
 
490
 
 
491
The wxPython-$VERSION-demo tarball was not found when building this disk image!
 
492
 
 
493
EOF
 
494
        cp "$DMGAPPS/Samples/Build ERROR.txt" $DMGAPPS
 
495
 
 
496
    else
 
497
 
 
498
        # Copy the demo and samples to the disk image from the tarball
 
499
        pushd $DMGAPPS/Samples
 
500
        tar xjvf $TARBALLDIR/wxPython-demo-$VERSION.tar.bz2
 
501
        mv wxPython-$VERSION/* .
 
502
        rm -rf wxPython-$VERSION
 
503
        rm -f demo/b demo/.setup.sh
 
504
        mv demo/demo.py demo/demo.pyw
 
505
        popd
 
506
 
 
507
        # Make an app bundle to run the demo
 
508
        $PYTHONW $PROGDIR/buildapp.py \
 
509
            --builddir=$DMGAPPS \
 
510
            --name="wxPython Demo" \
 
511
            --mainprogram=$DMGAPPS/Samples/demo/demo.pyw \
 
512
            --iconfile=$PROGDIR/RunDemo.icns \
 
513
            build
 
514
        cp -pR $DMGAPPS/Samples/demo/* "$DMGAPPS/wxPython Demo.app/Contents/Resources"
 
515
    fi
 
516
 
 
517
 
 
518
    # Make an app bundle to launch PyCrust
 
519
    $PYTHONW $PROGDIR/buildapp.py \
 
520
        --builddir=$DMGAPPS \
 
521
        --name=PyCrust \
 
522
        --mainprogram=$INSTALLROOT$BINPREFIX/pycrust.py \
 
523
        --iconfile=$PROGDIR/PieShell.icns \
 
524
        build
 
525
 
 
526
## TODO: PyAlaMode needs tweaked to be able to run from a bundle.  It
 
527
## needs to know to ignore command line parameters and etc...
 
528
#      # and PyAlaMode
 
529
#      $PYTHONW $PROGDIR/buildapp.py \
 
530
#       --builddir=$DMGAPPS \
 
531
#       --name=PyAlaMode \
 
532
#       --mainprogram=$INSTALLROOT$BINPREFIX/pyalamode.py \
 
533
#       --iconfile=$PROGDIR/PieShell.icns \
 
534
#       build
 
535
 
 
536
    # Make an app to launch XRCed
 
537
    $PYTHONW $PROGDIR/buildapp.py \
 
538
        --builddir=$DMGAPPS \
 
539
        --name=XRCed \
 
540
        --mainprogram=$INSTALLROOT$BINPREFIX/xrced.py \
 
541
        --iconfile=$PROGDIR/XRCed.icns \
 
542
        build
 
543
 
 
544
 
 
545
    # and then finally make a disk image containing everything
 
546
    dmgname=wxPython${SHORTVER}-osx-docs-demos-$VERSION-$TAG-py$PYVER
 
547
    $PROGDIR/makedmg $DMGAPPS $DMGDIR $dmgname
 
548
 
 
549
    echo Moving $DMGDIR/$dmgname.dmg to $DESTDIR
 
550
    mv $DMGDIR/$dmgname.dmg  $DESTDIR/$dmgname.dmg
 
551
 
 
552
 
 
553
    rm -r $TMPDIR || true
 
554
}
 
555
 
 
556
 
 
557
 
54
558
if [ $CHARTYPE = both ]; then
55
 
    distrib/mac/wxPythonOSX/build $PYVER inplace ansi $FLAGS
56
 
    distrib/mac/wxPythonOSX/build $PYVER inplace unicode $FLAGS
 
559
    do_universal_build ansi 
 
560
    do_universal_build unicode 
57
561
else
58
 
    distrib/mac/wxPythonOSX/build $PYVER inplace $CHARTYPE $FLAGS
 
562
    do_universal_build $CHARTYPE 
59
563
fi
60
564
 
61
 
echo "Copying installers to $DESTDIR..."
62
 
cp dist/*.dmg $DESTDIR
63
 
cd $DESTDIR
 
565
 
 
566
#----------------------------------------------------------------------
64
567
 
65
568
 
66
569
if [ $SKIPCLEAN != yes ]; then 
67
570
    echo "Cleaning up..."
 
571
    cd $DESTDIR
68
572
    rm -r $WXDIR || true
69
 
    rm wxPython-docs-$VERSION.tar.bz2
70
 
    rm wxPython-demo-$VERSION.tar.bz2
 
573
    rm wxPython-docs-$VERSION.tar.bz2 || true
 
574
    rm wxPython-demo-$VERSION.tar.bz2 || true
71
575
fi
72
576
 
73
577
echo "-=-=-=-  Goodbye!  -=-=-=-"