Skip to content

Commit 2e387a9

Browse files
committed
Added py2app support
1 parent e52ab7a commit 2e387a9

File tree

2 files changed

+52
-2
lines changed

2 files changed

+52
-2
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
*.pyc
2+
dist/
23
build/
3-
buildexe.bat
4+
*egg-info/
45
exedist/
6+
buildexe.bat
57
innosetup.iss
68
run.bat
79
msvcx90/

setup.py

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def iter_static():
3232
pass
3333
else:
3434
extra_options.update(dict(
35+
name='LDOCE5 Viewer',
3536
windows = [{
3637
'script': 'ldoce5viewer.py',
3738
'icon_resources': [(1, 'ldoce5viewer/resources/ldoce5viewer.ico')],
@@ -51,11 +52,58 @@ def iter_static():
5152
))
5253

5354

55+
#--------
56+
# py2app
57+
#--------
58+
try:
59+
import py2app
60+
except ImportError:
61+
pass
62+
else:
63+
extra_options.update(dict(
64+
name='LDOCE5 Viewer',
65+
app=['ldoce5viewer.py'],
66+
options={'py2app': {
67+
'iconfile': './ldoce5viewer/qtgui/resources/ldoce5viewer.icns',
68+
'argv_emulation': False,
69+
'optimize': 0,
70+
'includes': ['sip', 'lxml._elementpath'],
71+
'packages': [],
72+
'excludes': [
73+
'email', 'sqlite3',
74+
'PyQt4.QtCLucene',
75+
'PyQt4.QtHtml',
76+
'PyQt4.QtHelp',
77+
'PyQt4.QtTest',
78+
'PyQt4.QtOpenGL',
79+
'PyQt4.QtScript',
80+
'PyQt4.QtScriptTools',
81+
'PyQt4.QtSql',
82+
'PyQt4.QtDeclarative',
83+
'PyQt4.QtMultimedia',
84+
'PyQt4.QtDesigner',
85+
'PyQt4.QtXml',
86+
'PyQt4.QtXmlPatterns',
87+
],
88+
#'qt_plugins': [
89+
# 'imageformats/libqjpeg.dylib',
90+
#]
91+
}},
92+
data_files=[
93+
('qt_plugins/imageformats', ['/opt/local/share/qt4/plugins/imageformats/libqjpeg.dylib']),
94+
('', ['ldoce5viewer/static']),
95+
],
96+
))
97+
98+
5499
#------------
55100
# setup(...)
56101
#------------
102+
103+
if 'name' not in extra_options:
104+
extra_options['name'] = 'ldoce5viewer'
105+
57106
setup(
58-
name = 'ldoce5viewer',
59107
version = __version__,
60108
description = 'LDOCE5 Viewer',
61109
url = 'http://hakidame.net/ldoce5viewer/',

0 commit comments

Comments
 (0)