Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed windows pyinstaller dll inclusion paths #33

Merged
merged 1 commit into from
Nov 12, 2024
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
5 changes: 2 additions & 3 deletions bitcoin_safe/dynamic_lib_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def ensure_pyzbar_works() -> None:

pyzbar.__name__
logger.info(f"pyzbar successfully loaded ")
except FileNotFoundError:
except: # Do not restrict it to FileNotFoundError, because it can cause other exceptions
logger.info(f"pyzbar not loaded ")
show_message_before_quit(
translate("lib_load", """You are missing the {link}\nPlease install it.""").format(
Expand All @@ -137,8 +137,7 @@ def ensure_pyzbar_works() -> None:
)
sys.exit()
else:
# On Linux this shoudn't be a problem, because I specidfied
# system_runtime_requires = [ "libzbar0", ....#
# On Linux this shoudn't be a problem, because I include libzar in the package
pass


Expand Down
12 changes: 6 additions & 6 deletions tools/build-wine/deterministic.spec
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,16 @@ if not cmdline_name:
hiddenimports = []
hiddenimports += collect_submodules('pkg_resources') # workaround for https://github.com/pypa/setuptools/issues/1963

packages_with_dlls = [ 'bdkpython', 'nostr_sdk', 'pyzbar', 'pygame', "numpy.libs", "cv2"]

binaries = []
# Workaround for "Retro Look":
binaries += [b for b in collect_dynamic_libs('PyQt6') if 'qwindowsvista' in b[0]]
binaries += collect_dynamic_libs('bdkpython')
binaries += collect_dynamic_libs('nostr_sdk')
binaries += collect_dynamic_libs('pyzbar')
binaries += collect_dynamic_libs('electrumsv_secp256k1')
for package_with_dlls in packages_with_dlls:
binaries += collect_dynamic_libs(package_with_dlls)
# add libsecp256k1, libusb, etc:
binaries += [(f"{PROJECT_ROOT}/{PYPKG}/*.dll", '.')]

print(f"Included binaries: {binaries}")

datas = [
(f"{PROJECT_ROOT}/{PYPKG}/gui/icons/*", f"{PYPKG}/gui/icons"),
Expand All @@ -44,7 +43,7 @@ datas = [

# We don't put these files in to actually include them in the script but to make the Analysis method scan them for imports
a = Analysis([f"../../{PYPKG}/__main__.py" ],
pathex=[f"{PROJECT_ROOT}/{PYPKG}"],
pathex=[f"{PROJECT_ROOT}/{PYPKG}"] + [f"{PROJECT_ROOT}/{package_with_dlls}" for package_with_dlls in packages_with_dlls],
binaries=binaries,
datas=datas,
hiddenimports=hiddenimports,
Expand All @@ -56,6 +55,7 @@ for d in a.datas:
if 'pyconfig' in d[0]:
a.datas.remove(d)
break
print(f"Included datas: {datas}")

# Strip out parts of Qt that we never use. Reduces binary size by tens of MBs. see #4815
qt_bins2remove=(
Expand Down
Loading