diff --git a/contrib/build-wine/README.md b/contrib/build-wine/README.md index 6c2892828..334cbc57d 100644 --- a/contrib/build-wine/README.md +++ b/contrib/build-wine/README.md @@ -14,13 +14,14 @@ Usage: - gpg - 7Zip - Wine (>= v2) + - mingw-w64 For example: ``` -$ sudo apt-get install wine-development dirmngr gnupg2 p7zip-full +$ sudo apt-get install wine-development dirmngr gnupg2 p7zip-full mingw-w64 $ wine --version wine-2.0 (Debian 2.0-3+b2) ``` diff --git a/contrib/build-wine/build-secp256k1.sh b/contrib/build-wine/build-secp256k1.sh new file mode 100755 index 000000000..1fbab5312 --- /dev/null +++ b/contrib/build-wine/build-secp256k1.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# heavily based on https://github.com/ofek/coincurve/blob/417e726f553460f88d7edfa5dc67bfda397c4e4a/.travis/build_windows_wheels.sh + +set -e + +build_dll() { + #sudo apt-get install -y mingw-w64 + ./autogen.sh + echo "LDFLAGS = -no-undefined" >> Makefile.am + ./configure --host=$1 --enable-module-recovery --enable-experimental --enable-module-ecdh --disable-jni + make +} + + +cd /tmp/electrum-build + +if [ ! -d secp256k1 ]; then + git clone https://github.com/bitcoin-core/secp256k1.git + cd secp256k1; +else + cd secp256k1 + git pull +fi + +git reset --hard 452d8e4d2a2f9f1b5be6b02e18f1ba102e5ca0b4 +git clean -f -x -q + +build_dll i686-w64-mingw32 # 64-bit would be: x86_64-w64-mingw32 +mv .libs/libsecp256k1-0.dll libsecp256k1.dll + +find -exec touch -d '2000-11-11T11:11:11+00:00' {} + + +echo "building libsecp256k1 finished" diff --git a/contrib/build-wine/build.sh b/contrib/build-wine/build.sh index 9870ec7e3..ef4012b45 100755 --- a/contrib/build-wine/build.sh +++ b/contrib/build-wine/build.sh @@ -17,6 +17,8 @@ mkdir -p /tmp/electrum-build mkdir -p /tmp/electrum-build/pip-cache export PIP_CACHE_DIR="/tmp/electrum-build/pip-cache" +$here/build-secp256k1.sh || exit 1 + $here/prepare-wine.sh || exit 1 echo "Resetting modification time in C:\Python..." diff --git a/contrib/build-wine/deterministic.spec b/contrib/build-wine/deterministic.spec index d58ee5e1e..9d7df8287 100644 --- a/contrib/build-wine/deterministic.spec +++ b/contrib/build-wine/deterministic.spec @@ -28,6 +28,8 @@ binaries = [(PYHOME+"/libusb-1.0.dll", ".")] # Workaround for "Retro Look": binaries += [b for b in collect_dynamic_libs('PyQt5') if 'qwindowsvista' in b[0]] +binaries += [('C:/tmp/libsecp256k1.dll', '.')] + datas = [ (home+'lib/currencies.json', 'electrum'), (home+'lib/servers.json', 'electrum'), diff --git a/contrib/build-wine/prepare-wine.sh b/contrib/build-wine/prepare-wine.sh index dd832acdd..b6d610c37 100755 --- a/contrib/build-wine/prepare-wine.sh +++ b/contrib/build-wine/prepare-wine.sh @@ -139,4 +139,7 @@ cp libusb/MS32/dll/libusb-1.0.dll $WINEPREFIX/drive_c/python$PYTHON_VERSION/ # add dlls needed for pyinstaller: cp $WINEPREFIX/drive_c/python$PYTHON_VERSION/Lib/site-packages/PyQt5/Qt/bin/* $WINEPREFIX/drive_c/python$PYTHON_VERSION/ +mkdir -p $WINEPREFIX/drive_c/tmp +cp secp256k1/libsecp256k1.dll $WINEPREFIX/drive_c/tmp/ + echo "Wine is configured."