forked from synesthesiam/rhasspy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rhasspy.spec
84 lines (77 loc) · 2.32 KB
/
rhasspy.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
# -*- mode: python ; coding: utf-8 -*-
import os
import platform
from pathlib import Path
from PyInstaller.utils.hooks import copy_metadata
block_cipher = None
# Use either virtual environment or lib/bin dirs from environment variables
venv = Path.cwd() / ".venv"
bin_dir = Path(os.environ.get("spec_bin_dir", venv / "bin"))
lib_dir = Path(os.environ.get("spec_lib_dir", venv / "lib"))
site_dir = os.environ.get("spec_site_dir", None)
if site_dir is None:
venv_lib = venv / "lib"
for dir_path in venv_lib.glob("python*"):
if dir_path.is_dir() and (dir_path / "site-packages").exists():
site_dir = dir_path / "site-packages"
break
assert site_dir is not None, "Missing site-packages directory"
site_dir = Path(site_dir)
# Need to specially handle these snowflakes
pywrapfst_path = list(site_dir.glob("pywrapfst.*.so"))[0]
webrtcvad_path = list(site_dir.glob("_webrtcvad.*.so"))[0]
a = Analysis(
["app.py"],
pathex=["."],
binaries=[
(pywrapfst_path, "."),
(webrtcvad_path, "."),
(lib_dir / "libfstfarscript.so.13", "."),
(lib_dir / "libfstscript.so.13", "."),
(lib_dir / "libfstfar.so.13", "."),
(lib_dir / "libfst.so.13", "."),
(lib_dir / "libngram.so.134", "."),
(bin_dir / "ngramread", "."),
(bin_dir / "ngramcount", "."),
(bin_dir / "ngrammake", "."),
(bin_dir / "ngrammerge", "."),
(bin_dir / "ngramprint", "."),
(bin_dir / "ngramsymbols", "."),
(bin_dir / "ngramperplexity", "."),
(bin_dir / "farcompilestrings", "."),
(bin_dir / "phonetisaurus-apply", "."),
(bin_dir / "phonetisaurus-g2pfst", "."),
],
datas=copy_metadata("webrtcvad"),
hiddenimports=["doit", "dbm.gnu", "networkx", "numbers"],
hookspath=[],
runtime_hooks=[],
excludes=[],
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,
[],
exclude_binaries=True,
name="rhasspy",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name="rhasspy",
)