tMerge pull request #3397 from bauerj/build-sh - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 3e72e7a3f07fd0436b74299fb70c9669fa04c70d DIR parent 78400478fa19f1b58aa6e3587c8db7a5a5057c9d HTML Author: ThomasV <thomasv@electrum.org> Date: Tue, 28 Nov 2017 06:23:21 +0100 Merge pull request #3397 from bauerj/build-sh Add script for deterministic builds Diffstat: D contrib/build-wine/README | 18 ------------------ A contrib/build-wine/README.md | 28 ++++++++++++++++++++++++++++ M contrib/build-wine/build-electrum-… | 1 - A contrib/build-wine/build.sh | 23 +++++++++++++++++++++++ M contrib/build-wine/prepare-hw.sh | 34 ++++--------------------------- 5 files changed, 55 insertions(+), 49 deletions(-) --- DIR diff --git a/contrib/build-wine/README b/contrib/build-wine/README t@@ -1,18 +0,0 @@ -These scripts can be used for cross-compilation of Windows Electrum executables from Linux/Wine. - -Usage: -1. Install wine (development version) - - $ sudo apt-get install wine-development - $ sudo ln -sf /usr/bin/wine-development /usr/local/bin/wine - $ wine --version - wine-2.0 (Debian 2.0-3+b2) - -2. Run "./prepare-wine.sh", it will download all dependencies. When you'll be asked, always leave default settings and press "Next >". -3. Run "./prepare-hw.sh" to build support for hardware wallets (TREZOR) -4. Run "./build-electrum-git.sh". Sources will be packed into three separate versions to dist/ directory: - * Standalone compressed executable is "dist/electrum.exe" - * Uncompressed binaries are in "dist/electrum". They're useful for comparsion with other builds. - * NSIS-based installer of Electrum is "electrum-setup.exe" -7. Everytime you want to rebuild new version of Electrum just change the path to ZIP file in "build-electrum.sh" and re-run the script. - DIR diff --git a/contrib/build-wine/README.md b/contrib/build-wine/README.md t@@ -0,0 +1,28 @@ +Windows Binary Builds +===================== + + +These scripts can be used for cross-compilation of Windows Electrum executables from Linux/Wine. +Produced binaries are deterministic so you should be able to generate binaries that match the official releases. + +Usage: +1. Install Wine 2, e.g. + +``` +$ sudo apt-get install wine-development +$ sudo ln -sf /usr/bin/wine-development /usr/local/bin/wine +$ wine --version + wine-2.0 (Debian 2.0-3+b2) +``` + +or + +``` +$ pacman -S wine +$ wine --version + wine-2.21 +``` + +2. Make sure `/opt` is writable by the current user. +3. Run `build.sh`. +4. The generated binaries are in `dist`. DIR diff --git a/contrib/build-wine/build-electrum-git.sh b/contrib/build-wine/build-electrum-git.sh t@@ -9,7 +9,6 @@ fi # These settings probably don't need any change export WINEPREFIX=/opt/wine64 -export PYTHONHASHSEED=22 export PYTHONDONTWRITEBYTECODE=1 PYHOME=c:/python$PYTHON_VERSION DIR diff --git a/contrib/build-wine/build.sh b/contrib/build-wine/build.sh t@@ -0,0 +1,23 @@ +#!/bin/sh +# Lucky number +export PYTHONHASHSEED=22 + +here=$(dirname "$0") + +echo "Clearing $here/build and $here/dist..." +rm $here/build/* -rf +rm $here/dist/* -rf + +$here/prepare-wine.sh && \ +$here/prepare-pyinstaller.sh && \ +$here/prepare-hw.sh || exit 1 + +echo "Resetting modification time in C:\Python..." +# (Because of some bugs in pyinstaller) +pushd /opt/wine64/drive_c/python* +find -type f -exec touch -d '2000-11-11 11:11:11' {} + +popd +ls -l /opt/wine64/drive_c/python* + +$here/build-electrum-git.sh && \ +echo "Done." DIR diff --git a/contrib/build-wine/prepare-hw.sh b/contrib/build-wine/prepare-hw.sh t@@ -20,35 +20,9 @@ set -e cd tmp -# download mingw-get-setup.exe -#wget https://downloads.sourceforge.net/project/mingw/Installer/mingw-get-setup.exe -#wine mingw-get-setup.exe - -#echo "add c:\MinGW\bin to PATH using regedit" in HKEY_CURRENT_USER/Environment -#regedit -#exit - -#wine mingw-get install gcc -#wine mingw-get install mingw-utils -#wine mingw-get install mingw32-libz - - -#create cfg file -#printf "[build]\ncompiler=mingw32\n" > /opt/wine64/drive_c/Python27/Lib/distutils/distutils.cfg - -# Install Cython $PYTHON -m pip install setuptools --upgrade -$PYTHON -m pip install cython -$PYTHON -m pip install trezor --upgrade -$PYTHON -m pip install keepkey --upgrade -$PYTHON -m pip install btchip-python --upgrade - -#git clone https://github.com/trezor/cython-hidapi.git -#replace: from distutils.core import setup, Extenstion -#cd cython-hidapi -#git submodule init -#git submodule update -#$PYTHON setup.py install -#cd .. - +$PYTHON -m pip install cython --upgrade +$PYTHON -m pip install trezor==0.7.16 --upgrade +$PYTHON -m pip install keepkey==4.0.0 --upgrade +$PYTHON -m pip install btchip-python==0.1.23 --upgrade