source: scripts/darwin-py2app.sh@ 676:da7c9e269a70

Last change on this file since 676:da7c9e269a70 was 676:da7c9e269a70, checked in by Jeremy Thurgood <firxen@…>, 8 years ago

Maybe build a dmg?

  • Property exe set to *
File size: 1.5 KB
Line 
1#!/bin/sh
2# Copyright 2009 Jeremy Thurgood <firxen@gmail.com>
3# GPL - see COPYING for details
4#
5# Usage: darwin-py2app
6
7GAME_NAME="nagslang"
8
9GAME_VERSION=`sed -ne 's/VERSION_STR = "\(.*\)"/\1/p' setup.py`
10BUILD_NAME="${GAME_NAME}-${GAME_VERSION}"
11BUILD_FOLDER="build/${GAME_NAME}"
12DMG_NAME="${BUILD_NAME}.dmg"
13PY2APP_LOG="py2app.log"
14
15BASEDIR=`pwd`
16
17echo "=== Setting up build environment ==="
18
19./scripts/build_unix.sh
20
21cd ${BUILD_FOLDER}
22
23# find data -name '*.svg' -delete
24
25mkdir data/icons/program
26for f in $(find data/icons/werewolf-sonata*); do
27 cp $f $(echo $f | sed 's@werewolf-sonata@program/icon@')
28done
29
30
31echo ""
32echo "=== Running python setup.py ==="
33echo " Werewolf Sonata version: ${GAME_VERSION}"
34echo " Writing log to ${PY2APP_LOG}"
35
36python setup.py py2app >${PY2APP_LOG} 2>&1
37
38echo ""
39echo "=== Removing useless cruft that just takes up space ==="
40echo ""
41
42for dir in docs examples tests; do
43 find "dist/" -path "*/Resources/lib/*/pygame/${dir}/*" -delete
44done
45
46echo "=== Adding magic icon ==="
47echo ""
48
49cp data/icons/werewolf-sonata.icns dist/${GAME_NAME}.app/Contents/Resources/
50
51echo "=== Copying libchipmunk ==="
52echo ""
53
54cp dist/${GAME_NAME}.app/Contents/Resources/lib/python2.7/pymunk/libchipmunk.dylib dist/${GAME_NAME}.app/Contents/MacOS/
55
56echo "=== Building DMG ==="
57echo ""
58
59cd ${BASEDIR}
60
61pwd
62rm dist/${DMG_NAME} > /dev/null
63hdiutil create -srcfolder ${BUILD_FOLDER}/dist/*.app/ dist/${DMG_NAME}
64
65echo ""
66echo "=== Done ==="
67echo ""
68du -sh dist/* | sed 's/^/ /'
69echo ""
70
Note: See TracBrowser for help on using the repository browser.