changeset 18:c2d7adb7ef41

Add setup.py for py2exe
author Radomir Dopieralski <sheep-devel@sheep.art.pl>
date Mon, 29 Apr 2013 13:20:58 +0200
parents 64a9b41109e3
children 64dfb9a4d35a
files __main__.py blow/blow.ico setup.py
diffstat 3 files changed, 75 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/__main__.py	Mon Apr 29 13:20:58 2013 +0200
@@ -0,0 +1,4 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+from blow import __main__
Binary file blow/blow.ico has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/setup.py	Mon Apr 29 13:20:58 2013 +0200
@@ -0,0 +1,71 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+from setuptools import setup
+import os
+import glob
+try:
+    import py2exe
+except ImportError:
+    pass
+else:
+    origIsSystemDLL = py2exe.build_exe.isSystemDLL
+    def isSystemDLL(pathname):
+        if os.path.basename(pathname).lower() in (
+            "libfreetype-6.dll", "sdl_ttf.dll", "libogg-0.dll"):
+            return 0
+        return origIsSystemDLL(pathname)
+    py2exe.build_exe.isSystemDLL = isSystemDLL
+
+    orig_byte_compile = py2exe.build_exe.byte_compile
+    def byte_compile(*args, **kwargs):
+        files = orig_byte_compile(*args, **kwargs)
+        files.extend(os.path.abspath(d) for d in glob.glob("jelly/*.png"))
+        files.extend(os.path.abspath(d) for d in glob.glob("jelly/*.wav"))
+        files.extend(os.path.abspath(d) for d in glob.glob("jelly/*.ogg"))
+        return files
+    py2exe.build_exe.byte_compile = byte_compile
+
+setup(
+    name='blow',
+    version='1.0',
+    author='Radomir Dopieralski',
+    packages=['blow'],
+    scripts=['__main__.py'],
+    include_package_data=True,
+    zip_safe=True,
+    install_requires=['distribute', 'pygame'],
+    platforms='any',
+    options = {
+        'py2exe': {
+            'bundle_files': 1,
+            'packages': 'blow',
+            'compressed': True,
+            'ascii': True,
+            'excludes': [
+                'doctest',
+                'pdb',
+                'unittest',
+                'difflib',
+                'inspect',
+                'locale',
+                'pyreadline',
+                'optparse',
+                'calendar',
+                'pickle',
+                'email',
+                '_ssl',
+            ]
+        },
+    },
+    data_files = [],
+    windows = [
+        {
+            'script': "__main__.py",
+            'icon_resources': [
+                (0, "blow.ico"),
+            ]
+        }
+    ],
+    zipfile = None,
+)