--- /dev/null
+#!/bin/sh
+# Copyright 2009 Jeremy Thurgood <firxen@gmail.com>
+# GPL - see COPYING for details
+#
+# Usage: darwin-py2app
+
+GAME_NAME=`sed -ne 's/NAME_STR = "\(.*\)"/\1/p' setup.py`
+GAME_VERSION=`sed -ne 's/VERSION_STR = "\(.*\)"/\1/p' setup.py`
+BUILD_NAME="${GAME_NAME}-${GAME_VERSION}"
+BUILD_FOLDER="build/${BUILD_NAME}"
+DMG_NAME="${BUILD_NAME}.dmg"
+PY2APP_LOG="py2app.log"
+
+BASEDIR=`pwd`
+
+echo "=== Setting up build environment ==="
+
+python setup.py sdist > /dev/null
+mkdir build
+(cd build; tar xzf ../dist/${BUILD_NAME}.tar.gz)
+
+echo "[${BUILD_FOLDER}]"
+cd ${BUILD_FOLDER}
+echo "$PWD"
+
+echo ""
+echo "=== Running python setup.py ==="
+echo " ${GAME_NAME} version: ${GAME_VERSION}"
+echo " Writing log to ${PY2APP_LOG}"
+
+python setup.py py2app >${PY2APP_LOG} 2>&1
+
+echo ""
+echo "=== Removing useless cruft that just takes up space ==="
+echo ""
+
+for dir in docs examples tests; do
+ find "dist/" -path "*/Resources/lib/*/pygame/${dir}/*" -delete
+done
+
+echo "=== Adding magic icon ==="
+echo ""
+
+cp data/icons/*.icns dist/${GAME_NAME}.app/Contents/Resources/
+
+echo "=== Building DMG ==="
+echo ""
+
+cd ${BASEDIR}
+
+pwd
+rm dist/${DMG_NAME} > /dev/null
+
+echo -e "For some reason the game starts without a foreground window. Click on the icon in the dock (or minimize and restore from the menu) to get it back.\n\nIf this doesn't work, please let me (<firxen@gmail.com>) know, especially if you have any ideas about how to fix it.\n\nYou should also be able to use the unix tarball available at the same place you got this dmg.\n\nThanks." > ${BUILD_FOLDER}/dist/IMPORTANT\ NOTE.txt
+
+hdiutil create -volname ${GAME_NAME} -srcfolder ${BUILD_FOLDER}/dist/*.app/ -srcfolder ${BUILD_FOLDER}/dist/IMPORTANT\ NOTE.txt dist/${DMG_NAME}
+
+echo ""
+echo "=== Done ==="
+echo ""
+du -sh dist/* | sed 's/^/ /'
+echo ""
+
except ImportError:
pass
+
# This should probably be pulled from constants.py
+# These two constants are used by darwin-py2app.sh.
VERSION_STR = "0.1"
+NAME_STR = "robolock-II"
class NajaSdist(sdist):
setup(
- name="robolock-II",
+ name=NAME_STR,
version=VERSION_STR,
description="Robolock II - a puzzle game",
'pygame',
],
'excludes': [
- 'numpy', 'pygame.sdlmain_osx', 'winreg', 'AppKit', 'Foundation',
- 'Numeric', 'OpenGL.GL', '_scproxy', '_sysconfigdata',
- 'copyreg', 'dummy.Process', 'pkg_resources', 'queue',
- 'win32evtlog', 'win32evtlogutil',
+ 'numpy', 'pygame.sdlmain_osx', 'winreg', 'AppKit',
+ 'Foundation', 'Numeric', 'OpenGL.GL', '_scproxy',
+ '_sysconfigdata', 'copyreg', 'dummy.Process', 'pkg_resources',
+ 'queue', 'win32evtlog', 'win32evtlogutil',
],
'ignores': [
# all database modules
'py2app': {
'app': ['run_game.py'],
'argv_emulation': True,
- 'iconfile': 'data/icons/program/icon.icns',
+ 'iconfile': 'data/icons/robolock.icns',
'packages': [
'logging', 'encodings', 'pygame', 'naja', 'data',
],