Skip to content

Commit

Permalink
Add libusb dll to Windows binary
Browse files Browse the repository at this point in the history
So that Trezor still works...

Closes: spesmilo#3931
  • Loading branch information
bauerj authored and lclc committed Mar 28, 2018
1 parent 891bf69 commit d3b523c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 4 additions & 1 deletion contrib/build-wine/deterministic.spec
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ datas += collect_data_files('trezorlib')
datas += collect_data_files('btchip')
datas += collect_data_files('keepkeylib')

# Add libusb binary
binaries = [("c:/python3.5.4/libusb-1.0.dll", ".")]

# Workaround for "Retro Look":
binaries = [b for b in collect_dynamic_libs('PyQt5') if 'qwindowsvista' in b[0]]
binaries += [b for b in collect_dynamic_libs('PyQt5') if 'qwindowsvista' in b[0]]

# 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([home+'electrum-ftc',
Expand Down
10 changes: 9 additions & 1 deletion contrib/build-wine/prepare-wine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
# Please update these carefully, some versions won't work under Wine
NSIS_URL=https://prdownloads.sourceforge.net/nsis/nsis-3.02.1-setup.exe?download
NSIS_SHA256=736c9062a02e297e335f82252e648a883171c98e0d5120439f538c81d429552e

LIBUSB_URL=https://prdownloads.sourceforge.net/project/libusb/libusb-1.0/libusb-1.0.21/libusb-1.0.21.7z?download
LIBUSB_SHA256=acdde63a40b1477898aee6153f9d91d1a2e8a5d93f832ca8ab876498f3a6d2b8

PYTHON_VERSION=3.5.4

## These settings probably don't need change
Expand Down Expand Up @@ -79,7 +83,6 @@ $PYTHON -m pip install PyQt5
## Install pyinstaller
#$PYTHON -m pip install pyinstaller==3.3


# Install ZBar
#wget -q -O zbar.exe "https://sourceforge.net/projects/zbar/files/zbar/0.10/zbar-0.10-setup.exe/download"
#wine zbar.exe
Expand All @@ -101,6 +104,11 @@ wget -q -O nsis.exe "$NSIS_URL"
verify_hash nsis.exe $NSIS_SHA256
wine nsis.exe /S

wget -q -O libusb.7z "$LIBUSB_URL"
verify_hash libusb.7z "$LIBUSB_SHA256"
7z x -olibusb libusb.7z
cp libusb/MS32/dll/libusb-1.0.dll $WINEPREFIX/drive_c/python$PYTHON_VERSION/

(cd $WINEPREFIX/drive_c && p7zip -d /tmp/mingw32.7z)
# add .bat file that exposes host's git describe in wine
printf '%s\r\n%s\r\n' '@echo off' 'cmd /c /bin/bash -c "git describe --dirty"' \
Expand Down

0 comments on commit d3b523c

Please sign in to comment.