-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a hwi.spec file for pyinstaller to build standalone binaries
- Loading branch information
Showing
4 changed files
with
55 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from hwilib.devices import __all__ | ||
hiddenimports = [] | ||
for d in __all__: | ||
hiddenimports.append('hwilib.devices.' + d) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# -*- mode: python -*- | ||
import platform | ||
import subprocess | ||
|
||
block_cipher = None | ||
|
||
binaries = [] | ||
if platform.system() == 'Windows': | ||
binaries = [("c:/python3/libusb-1.0.dll", ".")] | ||
elif platform.system() == 'Linux': | ||
binaries = [("/lib/x86_64-linux-gnu/libusb-1.0.so.0", ".")] | ||
elif platform.system() == 'Darwin': | ||
find_brew_libusb_proc = subprocess.Popen(['brew', '--prefix', 'libusb'], stdout=subprocess.PIPE) | ||
libusb_path = find_brew_libusb_proc.communicate()[0] | ||
binaries = [(libusb_path.rstrip().decode() + "/lib/libusb-1.0.dylib", ".")] | ||
|
||
a = Analysis(['hwi.py'], | ||
binaries=binaries, | ||
datas=[], | ||
hiddenimports=[], | ||
hookspath=['contrib/pyinstaller-hooks/'], | ||
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, | ||
a.binaries, | ||
a.zipfiles, | ||
a.datas, | ||
[], | ||
name='hwi', | ||
debug=False, | ||
bootloader_ignore_signals=False, | ||
strip=False, | ||
upx=True, | ||
runtime_tmpdir=None, | ||
console=True ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
__all__ = [ | ||
'trezor', | ||
'ledger', | ||
'keepkey', | ||
'digitalbitbox', | ||
'coldcard' | ||
] |