annotate scripts/darwin-py2app.sh @ 570:1b720cf4d730

Make port an int.
author Simon Cross <hodgestar@gmail.com>
date Tue, 20 Nov 2012 23:41:10 +0200
parents 5da148acb36a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
433
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
1 #!/bin/sh
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
2 # Copyright 2009 Jeremy Thurgood <firxen+rinkhals@gmail.com>
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
3 # GPL - see COPYING for details
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
4 #
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
5 # Usage: darwin-py2app
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
6
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
7 GAME_NAME="mutable-mamba"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
8
453
4f3c55b09fda Fix version variable names.
Simon Cross <hodgestar@gmail.com>
parents: 433
diff changeset
9 MM_VERSION=`sed -ne 's/VERSION_STR = "\(.*\)"/\1/p' setup.py`
4f3c55b09fda Fix version variable names.
Simon Cross <hodgestar@gmail.com>
parents: 433
diff changeset
10 BUILD_NAME="${GAME_NAME}-${MM_VERSION}"
433
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
11 BUILD_FOLDER="build/${GAME_NAME}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
12 DMG_NAME="${BUILD_NAME}.dmg"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
13 PY2APP_LOG="py2app.log"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
14
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
15 BASEDIR=`pwd`
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
16
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
17 echo "=== Setting up build environment ==="
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
18
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
19 ./scripts/build_unix.sh
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
20
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
21 cd ${BUILD_FOLDER}
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
22
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
23 # find data -name '*.svg' -delete
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
24
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
25 echo ""
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
26 echo "=== Running python setup.py ==="
453
4f3c55b09fda Fix version variable names.
Simon Cross <hodgestar@gmail.com>
parents: 433
diff changeset
27 echo " Mutable Mamba version: ${MM_VERSION}"
433
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
28 echo " Writing log to ${PY2APP_LOG}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
29
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
30 python setup.py py2app >${PY2APP_LOG} 2>&1
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
31
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
32 echo ""
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
33 echo "=== Removing useless cruft that just takes up space ==="
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
34 echo ""
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
35
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
36 for dir in docs examples tests; do
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
37 find "dist/" -path "*/Resources/lib/*/pygame/${dir}/*" -delete
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
38 done
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
39
466
5da148acb36a Fixed icon in .app file. \o/ (Why does py2app not just do this for us?)
Jeremy Thurgood <firxen@gmail.com>
parents: 453
diff changeset
40 echo "=== Adding magic icon ==="
5da148acb36a Fixed icon in .app file. \o/ (Why does py2app not just do this for us?)
Jeremy Thurgood <firxen@gmail.com>
parents: 453
diff changeset
41 echo ""
5da148acb36a Fixed icon in .app file. \o/ (Why does py2app not just do this for us?)
Jeremy Thurgood <firxen@gmail.com>
parents: 453
diff changeset
42
5da148acb36a Fixed icon in .app file. \o/ (Why does py2app not just do this for us?)
Jeremy Thurgood <firxen@gmail.com>
parents: 453
diff changeset
43 cp data/icons/program/icon.icns dist/${GAME_NAME}.app/Contents/Resources/
5da148acb36a Fixed icon in .app file. \o/ (Why does py2app not just do this for us?)
Jeremy Thurgood <firxen@gmail.com>
parents: 453
diff changeset
44
433
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
45 echo "=== Building DMG ==="
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
46 echo ""
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
47
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
48 cd ${BASEDIR}
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
49
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
50 pwd
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
51 rm dist/${DMG_NAME} > /dev/null
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
52 hdiutil create -srcfolder ${BUILD_FOLDER}/dist/*.app/ dist/${DMG_NAME}
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
53
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
54 echo ""
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
55 echo "=== Done ==="
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
56 echo ""
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
57 du -sh dist/* | sed 's/^/ /'
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
58 echo ""
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
59