syncplay/buildPy2app.py

59 lines
1.4 KiB
Python
Raw Normal View History

2017-09-07 17:37:03 +00:00
"""
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
from setuptools import setup, Command
2017-09-07 17:37:03 +00:00
from glob import glob
import shutil
2017-09-07 17:37:03 +00:00
import syncplay
cmdlist = {}
2017-09-07 17:37:03 +00:00
APP = ['syncplayClient.py']
DATA_FILES = [
2017-10-02 13:14:13 +00:00
('resources', glob('resources/*.png') + glob('resources/*.rtf')),
2017-09-07 17:37:03 +00:00
]
OPTIONS = {
'iconfile':'resources/icon.icns',
'includes': {'PySide.QtCore', 'PySide.QtUiTools', 'PySide.QtGui'},
'plist': {
2017-09-07 17:37:03 +00:00
'CFBundleName':'Syncplay',
'CFBundleShortVersionString':syncplay.version,
'CFBundleIdentifier':'pl.syncplay.Syncplay',
'NSHumanReadableCopyright': '@ 2017 Syncplay All Rights Reserved'
}
}
class Fix(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def trim_packages(self):
"""Remove big files in external dependencies that Syncplay doesn't need"""
shutil.rmtree('dist/Syncplay.app/Contents/Frameworks/QtDesigner.framework', ignore_errors=True)
shutil.rmtree('dist/Syncplay.app/Contents/Frameworks/QtScript.framework', ignore_errors=True)
shutil.rmtree('dist/Syncplay.app/Contents/Frameworks/QtXml.framework', ignore_errors=True)
def run(self):
self.trim_packages()
cmdlist['fix'] = Fix
2017-09-07 17:37:03 +00:00
setup(
app=APP,
name='Syncplay',
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
cmdclass=cmdlist
2017-09-07 17:37:03 +00:00
)