annotate scripts/darwin-py2app.sh @ 433:e07b42656d22

Untested build scripts.
author Simon Cross <hodgestar@gmail.com>
date Sat, 17 Sep 2011 19:31:31 +0200
parents
children 4f3c55b09fda
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
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
9 NT_VERSION=`sed -ne 's/VERSION_STR = "\(.*\)"/\1/p' setup.py`
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
10 BUILD_NAME="${GAME_NAME}-${NT_VERSION}"
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 ==="
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
27 echo " Mutable Mamba version: ${NT_VERSION}"
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
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
40 echo "=== Building DMG ==="
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
41 echo ""
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
42
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
43 cd ${BASEDIR}
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
44
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
45 pwd
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
46 rm dist/${DMG_NAME} > /dev/null
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
47 hdiutil create -srcfolder ${BUILD_FOLDER}/dist/*.app/ dist/${DMG_NAME}
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
48
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
49 echo ""
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
50 echo "=== Done ==="
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
51 echo ""
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
52 du -sh dist/* | sed 's/^/ /'
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
53 echo ""
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
54