forked from LBRYCommunity/lbry-sdk
add libtorrent pyinstaller hook
This commit is contained in:
parent
5be990fc55
commit
c07c369a28
1 changed files with 24 additions and 0 deletions
24
scripts/hook-libtorrent.py
Normal file
24
scripts/hook-libtorrent.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
"""
|
||||
Hook for libtorrent.
|
||||
"""
|
||||
|
||||
import os
|
||||
import glob
|
||||
import os.path
|
||||
from PyInstaller.utils.hooks import get_module_file_attribute
|
||||
from PyInstaller import compat
|
||||
|
||||
|
||||
def get_binaries():
|
||||
if compat.is_win:
|
||||
files = ('c:/Windows/System32/libssl-1_1-x64.dll', 'c:/Windows/System32/libcrypto-1_1-x64.dll')
|
||||
for file in files:
|
||||
if not os.path.isfile(file):
|
||||
print(f"MISSING {file}")
|
||||
return [(file, '.') for file in files]
|
||||
return []
|
||||
|
||||
|
||||
binaries = get_binaries()
|
||||
for file in glob.glob(os.path.join(get_module_file_attribute('libtorrent'), 'libtorrent*pyd*')):
|
||||
binaries.append((file, 'libtorrent'))
|
Loading…
Reference in a new issue