forked from bpbible/bpbible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_py2app.py
57 lines (48 loc) · 1.76 KB
/
make_py2app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
"""
Make a Mac .app folder. Requires py2app, and XULRunner 1.9.2.x installed.
Usage:
python make_py2app.py -A --use-pythonpath (for development)
python make_py2app.py (for standalone)
"""
import os
from util.i18n import find_languages
import contrib
import sys
from setuptools import setup
APP = ['bpbible.py']
DATA_FILES = []#"locales", "graphics"]
OPTIONS = {
'argv_emulation': True,
'iconfile': 'graphics/bpbible.icns',
}
if "py2app" not in sys.argv:
print sys.argv
sys.argv.insert(1, "py2app")
languages = find_languages(is_release=True)
def sh(x):
print x
assert os.system(x) == 0
if setup(
app=APP,
name="BPBible",
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
):
if "-A" not in sys.argv:
subdirs = r"xrc graphics css js xulrunner resources locales locales/locales.d".split()
subdirs += ["locales/%s/LC_MESSAGES/" % l for l in languages]
for subdir in subdirs:
sh(r"mkdir -p dist/bpbible.app/Contents/Resources/%s" % subdir)
sh("cp xrc/*.xrc dist/bpbible.app/Contents/Resources/xrc")
for item in "png gif".split():
sh("cp graphics/*.%s dist/bpbible.app/Contents/Resources/graphics" % item)
sh("cp LICENSE.txt dist/bpbible.app/Contents/Resources")
sh(r"cp locales/locales.d/*.conf dist/bpbible.app/Contents/Resources/locales/locales.d")
sh(r"rm -rf dist/bpbible.app/Contents/Resources/resources")
sh(r"rm -rf dist/bpbible.app/Contents/Resources/css")
sh(r"rm -rf dist/bpbible.app/Contents/Resources/js")
sh(r"cp -r resources dist/bpbible.app/Contents/Resources/resources")
sh(r"cp -r css dist/bpbible.app/Contents/Resources/css")
sh(r"cp -r js dist/bpbible.app/Contents/Resources/js")
sh(r"cp -r /Library/Frameworks/XUL.framework/Versions/Current/* dist/bpbible.app/Contents/MacOS")