view setup.py @ 55:a61120c749da default tip

add artwork sources
author Radomir Dopieralski <sheep-devel@sheep.art.pl>
date Tue, 29 Apr 2014 21:40:09 +0200
parents 518f2a5466b1
children
line wrap: on
line source

#!/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("undermine/*.png"))
        files.extend(os.path.abspath(d) for d in glob.glob("undermine/*.ogg"))
        files.extend(os.path.abspath(d) for d in glob.glob("undermine/*.wav"))
        return files
    py2exe.build_exe.byte_compile = byte_compile

setup(
    name='undermine',
    version='4.0',
    author='Radomir Dopieralski',
    packages=['undermine'],
    include_package_data=True,
    zip_safe=True,
    install_requires=['pygame'],
    platforms='any',
    options = {
        'py2exe': {
            'bundle_files': 1,
            'packages': 'undermine',
            'compressed': True,
            'ascii': False,
            'excludes': [
                'doctest',
                'pdb',
                'unittest',
                'difflib',
                'inspect',
                'locale',
                'pyreadline',
                'optparse',
                'calendar',
                'pickle',
                'email',
                '_ssl',
            ]
        },
    },
    data_files = [
        ("undermine",
             glob.glob("undermine/*.png") +
             glob.glob("undermine/*.ogg") +
             glob.glob("undermine/*.wav")
        ),
    ],
    windows = [
        {
            'script': "__main__.py",
        }
    ],
    zipfile = None,
)