forked from circleguard/circleguard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui_mac.spec
72 lines (65 loc) · 2.36 KB
/
gui_mac.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
# -*- mode: python -*-
block_cipher = None
from os.path import expanduser
import os
import zipfile
os.path.expanduser
from circleguard import __version__ # circlecore version, not gui
# https://github.com/pyinstaller/pyinstaller/wiki/Recipe-remove-tkinter-tcl
import sys
sys.modules['FixTk'] = None
def zipdir(path, ziph, sub_folder=""):
length = len(path)
for root, dirs, files in os.walk(path):
folder = root[length:] # path without "parent"
if sub_folder != "":
folder = sub_folder + folder
for file in files:
ziph.write(os.path.join(root, file), os.path.join(folder, file))
# Analysis options documentation here
# https://github.com/pyinstaller/pyinstaller/blob/develop/PyInstaller/building/build_main.py#L133
# build with pyinstaller
a = Analysis(['circleguard/main.py'],
pathex=['.'],
datas=[('resources/','resources/')],
hiddenimports=[],
hookspath=["."],
runtime_hooks=[],
# https://github.com/pyinstaller/pyinstaller/wiki/Recipe-remove-tkinter-tcl for
# tkinter excludes, the others are added by us
excludes=['FixTk', 'tcl', 'tk', '_tkinter', 'tkinter', 'Tkinter', 'PIL', 'IPython'],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='Circleguard',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
runtime_tmpdir=None,
console=False , icon='./resources/logo/logo_mac.icns')
app = BUNDLE(exe,
name='Circleguard.app',
icon='./resources/logo/logo_mac.icns',
bundle_identifier=None,
info_plist={
'NSHighResolutionCapable': 'True',
'CFBundleShortVersionString': __version__
}
)
print("Creating zip")
zipf = zipfile.ZipFile('./Circleguard_osx.app.zip', 'w', zipfile.ZIP_DEFLATED)
zipdir('./dist/Circleguard.app', zipf, "./Circleguard.app")
zipf.close()
print("Moving zip")
os.rename("./Circleguard_osx.app.zip", "./dist/Circleguard_osx.app.zip")
print("Finished zip")