Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ dependencies = [
"crccheck >= 1.3.0",
"pylibfdt >= 1.7.2.post1",
"packaging >= 24.2",
"backports.zstd; python_version < '3.14'"
"backports.zstd; python_version < '3.14'",
"libusb; platform_system=='Windows'"
]

[project.urls]
Expand Down
24 changes: 22 additions & 2 deletions snagboot.spec
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
# Snagboot spec file, for PyInstaller
#

from PyInstaller.utils.hooks import copy_metadata
from PyInstaller.utils.hooks import copy_metadata, collect_dynamic_libs
from PyInstaller.compat import is_win
import packaging.requirements
import libusb
Comment thread
rgantois marked this conversation as resolved.
Resolved
import os

with open("MANIFEST.in", "r") as manifest_file:
Expand Down Expand Up @@ -65,6 +67,25 @@ snagfactory = Analysis(
optimize=0,
)

# Include libusb-1.0.dll from libusb as it is needed by pyusb on windows

if is_win:
libusbDLL = collect_dynamic_libs(
"libusb",
destdir=".",
search_patterns=['*.dll'],
)
test = Analysis(
['src/snagrecover/cli.py'],
binaries = libusbDLL,
)
for src, dst in libusbDLL:
snagrecover.binaries.extend([(
Comment thread
rgantois marked this conversation as resolved.
Resolved
"libusb-1.0.dll",
src,
"BINARY"
)])

# Refer to snagrecover analysis for common data files

MERGE(
Expand Down Expand Up @@ -115,4 +136,3 @@ coll = COLLECT(
upx=True,
name='snagboot',
)

Loading