forked from NaturalHistoryMuseum/inselect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
inselect.spec
83 lines (66 loc) · 1.62 KB
/
inselect.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
# -*- mode: python -*-
import os
import sys
from pathlib import Path
from pylibdmtx import pylibdmtx
from pyzbar import pyzbar
block_cipher = None
# See https://github.com/pyinstaller/pyinstaller/wiki/Recipe-remove-tkinter-tcl
# for details of excluding all of the tcl, tk, tkinter shat
sys.modules['FixTk'] = None
a = Analysis(
['inselect/scripts/inselect.py'],
pathex=[str(Path('.').absolute())],
binaries=[],
datas=[
('inselect/gui/inselect.qss', ''),
],
hiddenimports=['sklearn.neighbors.typedefs'],
hookspath=[],
runtime_hooks=[],
excludes=os.getenv('EXCLUDE_MODULES', '').split(' '),
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher
)
# dylibs not detected because they are loaded by ctypes
a.binaries += TOC([
(Path(dep._name).name, dep._name, 'BINARY')
for dep in pylibdmtx.EXTERNAL_DEPENDENCIES + pyzbar.EXTERNAL_DEPENDENCIES
])
# A dependency of libzbar.dylib that PyInstaller does not detect
MISSING_DYLIBS = (
Path('/usr/local/lib/libjpeg.8.dylib'),
)
a.binaries += TOC([
(lib.name, str(lib.resolve()), 'BINARY') for lib in MISSING_DYLIBS
])
ICON = 'icons/inselect.icns'
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
exclude_binaries=True,
name='inselect',
debug=False,
strip=False,
upx=False,
console=False,
icon=ICON
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=False,
name='inselect',
icon=ICON
)
app = BUNDLE(
coll,
name='inselect.app',
icon=ICON,
bundle_identifier=None
)