26 lines
758 B
Python
26 lines
758 B
Python
|
|
"""
|
||
|
|
PyInstaller hook for webrtcvad.
|
||
|
|
|
||
|
|
The webrtcvad-wheels package provides webrtcvad module but uses a different
|
||
|
|
package name, causing PyInstaller's default hook to fail. This custom hook
|
||
|
|
handles the metadata correctly.
|
||
|
|
"""
|
||
|
|
|
||
|
|
from PyInstaller.utils.hooks import copy_metadata
|
||
|
|
|
||
|
|
# Try to copy metadata from webrtcvad-wheels (the actual package name)
|
||
|
|
# Fall back gracefully if not found
|
||
|
|
try:
|
||
|
|
datas = copy_metadata('webrtcvad-wheels')
|
||
|
|
except Exception:
|
||
|
|
# If webrtcvad-wheels metadata not found, try webrtcvad
|
||
|
|
try:
|
||
|
|
datas = copy_metadata('webrtcvad')
|
||
|
|
except Exception:
|
||
|
|
# If neither found, that's okay - the module will still work
|
||
|
|
datas = []
|
||
|
|
|
||
|
|
# Ensure webrtcvad binary extensions are included
|
||
|
|
hiddenimports = []
|
||
|
|
binaries = []
|