-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMultiChannelWavMixer.spec
More file actions
147 lines (132 loc) · 4.47 KB
/
MultiChannelWavMixer.spec
File metadata and controls
147 lines (132 loc) · 4.47 KB
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
# -*- mode: python ; coding: utf-8 -*-
"""
PyInstaller spec for MultiChannelWavMixer
Build with: uv run pyinstaller MultiChannelWavMixer.spec
Cross-platform: produces .app on macOS, folder + .exe on Windows.
"""
import os
import sys
from PyInstaller.utils.hooks import collect_data_files, collect_submodules
block_cipher = None
# ── Data files to bundle ────────────────────────────────────────────────────────
datas = []
# Application images (logo, header background)
import glob as _glob
datas += [(_f, "Pics") for _f in _glob.glob("Pics/*.png")]
# customtkinter — themes, images, assets
datas += collect_data_files("customtkinter")
# librosa — some datasets/filters shipped as package data
datas += collect_data_files("librosa")
# pyloudnorm — no package data, but include for safety
datas += collect_data_files("pyloudnorm")
# matplotlib — fonts, style sheets, etc.
datas += collect_data_files("matplotlib")
# soundfile native library (libsndfile) — resolved portably so local
# and CI runner builds both work without a hardcoded .venv path.
datas += collect_data_files("soundfile")
# ── Hidden imports ──────────────────────────────────────────────────────────────
hiddenimports = [
# customtkinter
"customtkinter",
# sounddevice / soundfile backends
"sounddevice",
"soundfile",
"cffi",
"_cffi_backend",
# audio / signal processing
"librosa",
"librosa.core",
"librosa.feature",
"librosa.util",
"pyloudnorm",
"pydub",
"pydub.audio_segment",
"pydub.effects",
"pydub.silence",
"audioop",
# numpy / scipy internals
"numpy",
"numpy.core",
"scipy",
"scipy.signal",
"scipy.fft",
# matplotlib backends
"matplotlib",
"matplotlib.backends.backend_tkagg",
"matplotlib.backends.backend_agg",
# tkinter
"tkinter",
"tkinter.filedialog",
"tkinter.messagebox",
# misc
"xml.etree.ElementTree",
]
# collect all submodules of scipy and librosa to avoid missing-module errors
hiddenimports += collect_submodules("scipy")
hiddenimports += collect_submodules("librosa")
# ── Analysis ────────────────────────────────────────────────────────────────────
a = Analysis(
["MultiChannelWavMixer.py"],
pathex=["."],
binaries=[],
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=["pyi_rth_env.py"],
excludes=[
"PyQt5", "PyQt6", "PySide2", "PySide6",
"wx", "gi",
"numba", "llvmlite",
],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
# ── macOS .app bundle ───────────────────────────────────────────────────────────
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name="MultiChannelWavMixer",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False, # no terminal window
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None, # native arch; use 'universal2' for fat binary
codesign_identity=None,
entitlements_file=None,
icon="Pics/AppIcon.ico" if sys.platform == "win32" else None,
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name="MultiChannelWavMixer",
)
# macOS-only: wrap COLLECT result into a .app bundle
if sys.platform == "darwin":
app = BUNDLE(
coll,
name="MultiChannelWavMixer.app",
icon="Pics/AppIcon.icns",
bundle_identifier="com.macbuchi.multichannelwavmixer",
info_plist={
"CFBundleShortVersionString": "1.0.0",
"CFBundleVersion": "1.0.0",
"NSHighResolutionCapable": True,
"NSMicrophoneUsageDescription": "Required for audio playback via sounddevice.",
"LSUIElement": False,
},
)
# On Windows the COLLECT folder (dist/MultiChannelWavMixer/) is the deliverable.