Merge pull request #3397 from bauerj/build-sh

Add script for deterministic builds
This commit is contained in:
ThomasV 2017-11-28 06:23:21 +01:00 committed by GitHub
commit 3e72e7a3f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 55 additions and 49 deletions

View File

@ -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.

View File

@ -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`.

View File

@ -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

23
contrib/build-wine/build.sh Executable file
View File

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

View File

@ -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