-
Notifications
You must be signed in to change notification settings - Fork 0
/
grow.spec
156 lines (135 loc) · 3.77 KB
/
grow.spec
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# -*- mode: python -*-
import os
import glob
import sys
try:
# PyInstaller==3.1
from PyInstaller.utils.hooks import collect_submodules
except:
# PyInstaller==2.1.1
from PyInstaller.hooks.hookutils import collect_submodules
IS_DARWIN = sys.platform == 'darwin'
def glob_datas(dir_path):
files = []
def recursive_glob(main_path, files):
for path in glob.glob(main_path):
if os.path.isfile(path):
files.append(path)
recursive_glob(path + '/*', files)
recursive_glob(dir_path + '/*', files)
return [(path.replace('grow/', ''), path, 'DATA') for path in files]
# Only include PIL.Imaging and PyQt4 on Darwin.
# TODO(jeremydw): See if we can kill this.
if IS_DARWIN:
hiddenimports = [
'PIL.Imaging',
'PyQt4.QtCore',
]
else:
hiddenimports = []
hiddenimports += [
'babel.dates',
'babel.numbers',
'babel.plural',
'keyring',
'keyring.backends.Gnome',
'keyring.backends.Google',
'keyring.backends.OS_X',
'keyring.backends.SecretService',
'keyring.backends.Windows',
'keyring.backends.file',
'keyring.backends.keyczar',
'keyring.backends.kwallet',
'keyring.backends.multi',
'keyring.backends.pyfs',
'keyring.credentials',
'keyring.util.XDG',
'keyring.util.escape',
'markdown',
'markdown.extensions',
'pygments.formatters',
'pygments.formatters.html',
'pygments.lexers',
'pygments.lexers.configs',
'pygments.lexers.data',
'pygments.lexers.php',
'pygments.lexers.shell',
'pygments.lexers.special',
'pygments.lexers.templates',
'werkzeug',
'werkzeug._internal',
'werkzeug.datastructures',
'werkzeug.debug',
'werkzeug.exceptions',
'werkzeug.formparser',
'werkzeug.http',
'werkzeug.local',
'werkzeug.routing',
'werkzeug.script',
'werkzeug.security',
'werkzeug.serving',
'werkzeug.test',
'werkzeug.testapp',
'werkzeug.urls',
'werkzeug.useragents',
'werkzeug.utils',
'werkzeug.wrappers',
'werkzeug.wsgi',
]
try:
hiddenimports += collect_submodules('pkg_resources._vendor')
except AssertionError:
pass # Environment doesn't need this to be collected.
a = Analysis([
'bin/grow',
],
pathex=[
# Longer paths precede shorter paths for path-stripping.
'./env/lib/python2.7/site-packages/',
'.',
],
hiddenimports=hiddenimports,
hookspath=None,
runtime_hooks=None)
a.datas += [
('VERSION', 'grow/VERSION', 'DATA'),
('data/cacerts.txt', 'grow/data/cacerts.txt', 'DATA'),
('httplib2/cacerts.txt', 'grow/data/cacerts.txt', 'DATA'),
]
a.datas += glob_datas('grow/ui/assets')
a.datas += glob_datas('grow/ui/dist')
a.datas += glob_datas('grow/ui/templates')
a.datas += glob_datas('grow/pods/templates')
# Crypto doesn't seem to be needed when building on Mac. TODO(jeremydw):
# research this dependency and determine if it can be eliminated from
# non-Mac builds.
if not IS_DARWIN:
def get_crypto_path():
import Crypto
crypto_path = Crypto.__path__[0]
return crypto_path
dict_tree = Tree(get_crypto_path(), prefix='Crypto', excludes=["*.pyc"])
a.datas += dict_tree
# Include PyQt4 on Darwin. TODO(jeremydw): See if we can kill this.
if IS_DARWIN:
try:
def get_qt4_path():
import PyQt4
qt4_path = PyQt4.__path__[0]
return qt4_path
dict_tree = Tree(get_qt4_path(), prefix='PyQt4', excludes=["*.pyc"])
a.datas += dict_tree
except ImportError:
pass
pyz = PYZ(a.pure,
name='growsdk')
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='grow',
debug=False,
strip=None,
upx=True,
console=True)