forked from pyfa-org/Pyfa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyfa.spec
123 lines (106 loc) · 3.17 KB
/
pyfa.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
# -*- mode: python -*-
import os
from itertools import chain
import subprocess
import requests.certs
import platform
os_name = platform.system()
block_cipher = None
added_files = [
('imgs/gui/*.png', 'imgs/gui'),
('imgs/gui/*.gif', 'imgs/gui'),
('imgs/icons/*.png', 'imgs/icons'),
('imgs/renders/*.png', 'imgs/renders'),
('service/jargon/*.yaml', 'service/jargon'),
('locale', 'locale'),
(requests.certs.where(), '.'), # is this needed anymore?
('eve.db', '.'),
('README.md', '.'),
('LICENSE', '.'),
('version.yml', '.'),
]
icon = None
pathex = []
upx = True
debug = False
if os_name == 'Windows':
added_files.extend([
('dist_assets/win/pyfa.ico', '.'),
('dist_assets/win/pyfa.exe.manifest', '.'),
])
icon = 'dist_assets/win/pyfa.ico'
pathex.extend([
# Need this, see https://github.com/pyinstaller/pyinstaller/issues/1566
# To get this, download and install windows 10 SDK
# If not building on Windows 10, this might be optional
r'C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\x86'
])
if os_name == 'Darwin':
added_files.extend([
('dist_assets/win/pyfa.ico', '.'), # osx only
])
icon = 'dist_assets/mac/pyfa.icns'
import_these = [
'numpy.core._dtype_ctypes', # https://github.com/pyinstaller/pyinstaller/issues/3982
'sqlalchemy.ext.baked', # windows build doesn't launch without if when using sqlalchemy 1.3.x
'pkg_resources.py2_warn' # issue 2156
]
# Walk directories that do dynamic importing
paths = ('eos/db/migrations', 'service/conversions')
for root, folders, files in chain.from_iterable(os.walk(path) for path in paths):
for file_ in files:
if file_.endswith(".py") and not file_.startswith("_"):
mod_name = "{}.{}".format(
root.replace("/", "."),
file_.split(".py")[0],
)
import_these.append(mod_name)
a = Analysis(['pyfa.py'],
pathex= pathex,
binaries=[],
datas=added_files,
hiddenimports=import_these,
hookspath=['dist_assets/pyinstaller_hooks'],
runtime_hooks=[],
excludes=['Tkinter'],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
exclude_binaries=True,
name='pyfa',
debug=debug,
strip=False,
upx=upx,
icon= icon,
# version='win-version-info.txt',
console=False
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=upx,
name='pyfa',
)
if platform.system() == 'Darwin':
info_plist = {
'NSHighResolutionCapable': 'True',
'NSPrincipalClass': 'NSApplication',
'CFBundleName': 'pyfa',
'CFBundleDisplayName': 'pyfa',
'CFBundleIdentifier': 'org.pyfaorg.pyfa',
'CFBundleVersion': '1.2.3',
'CFBundleShortVersionString': '1.2.3',
}
app = BUNDLE(exe,
name='pyfa.app',
icon=icon,
bundle_identifier=None,
info_plist=info_plist
)