Browse Source

build and include libsecp256k1 in windows binaries

3.2.x
SomberNight 7 years ago
parent
commit
65601e9ec6
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 3
      contrib/build-wine/README.md
  2. 33
      contrib/build-wine/build-secp256k1.sh
  3. 2
      contrib/build-wine/build.sh
  4. 2
      contrib/build-wine/deterministic.spec
  5. 3
      contrib/build-wine/prepare-wine.sh

3
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)
```

33
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"

2
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..."

2
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'),

3
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."

Loading…
Cancel
Save