diff --git a/.cargo/config b/.cargo/config index 8ef4375..13383c4 100644 --- a/.cargo/config +++ b/.cargo/config @@ -6,3 +6,9 @@ ar = "x86_64-apple-darwin15-ar" # use --no-insert-timestamp to drop PE timestamps in Windows builds for reproducibility # https://wiki.debian.org/ReproducibleBuilds/TimestampsInPEBinaries#building_with_mingw-w64 rustflags = [ "-C", "link-arg=-Wl,--no-insert-timestamp" ] + +[target.armv7-unknown-linux-gnueabihf] +linker = "arm-linux-gnueabihf-gcc" + +[target.aarch64-unknown-linux-gnu] +linker = "aarch64-linux-gnu-gcc" diff --git a/CHANGELOG.md b/CHANGELOG.md index 032f14e..da8aecf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ - Reproducible builds using Docker (#51) -- Pre-built binary releases for macOS (#24) +- Pre-built binary releases for macOS (#24) and ARMv7/v8 (#19) - Scriptable transaction broadcast command via `--tx-broadcast-cmd ` (#7) diff --git a/README.md b/README.md index 6d9f556..dae9bcc 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ Get yourself a synced Bitcoin Core node (v0.19 is recommended, v0.17 is sufficie #### Signed pre-built binaries -Available for download on [the releases page](https://github.com/shesek/bwt/releases) (Linux and Windows). +Available for download on [the releases page](https://github.com/shesek/bwt/releases) (Linux, Mac, Windows and ARM). The releases are signed by Nadav Ivgi (@shesek). The public key can be verified on [keybase](https://keybase.io/nadav), @@ -264,7 +264,7 @@ Download the `electrum_plugin` package from the [releases page](https://github.c After restarting Electrum, you should see bwt in the list of installed plugins under `Tools -> Plugins`. The supported Electrum version is 3.3.8. -The plugin is currently available for Linux and Windows. +The plugin is available for Linux, Mac, Windows and ARM. Note that it is not possible to install external plugins with the Electrum AppImage or standalone Windows executable. You will need to [run from tar.gz](https://github.com/spesmilo/electrum/#running-from-targz) on Linux, use the Windows installer, or [run from source](https://github.com/spesmilo/electrum/#development-version-git-clone). @@ -1214,7 +1214,7 @@ The builds can be reproduced in a Docker container environment as follows: ``` $ git clone https://github.com/shesek/bwt && cd bwt -# Linux & Windows +# Linux, Windows & ARM $ docker build -t bwt-builder -f scripts/builder.Dockerfile . $ docker run -it --rm -v `pwd`:/usr/src/bwt bwt-builder diff --git a/scripts/build.sh b/scripts/build.sh index d5c95a6..dedaec0 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,8 +1,8 @@ #!/bin/bash set -xeo pipefail -# `osx` is also available, but requires osxcross installed (see builder-os.Dockerfile) -TARGETS=${TARGETS:-linux,win} +# `x86_64-osx` is also available, but requires osxcross installed (see builder-os.Dockerfile) +TARGETS=${TARGETS:-x86_64-linux,x86_64-win,arm32v7,arm64v8} build() { name=$1; target=$2; features=$3 @@ -16,7 +16,9 @@ build() { mv target/$target/release/bwt$ext $dest - [[ $target == *"-apple-"* ]] || strip $dest/bwt$ext + if [[ $target != *"-apple-"* && $target != "armv7-"* && $target != "aarch64-"* ]]; then + strip $dest/bwt$ext + fi cp README.md LICENSE $dest/ @@ -38,25 +40,27 @@ pack() { version=`cat Cargo.toml | egrep '^version =' | cut -d'"' -f2` -for cfg in linux,x86_64-unknown-linux-gnu \ - win,x86_64-pc-windows-gnu \ - osx,x86_64-apple-darwin; do +for cfg in x86_64-linux,x86_64-unknown-linux-gnu \ + x86_64-osx,x86_64-apple-darwin \ + x86_64-win,x86_64-pc-windows-gnu \ + arm32v7,armv7-unknown-linux-gnueabihf \ + arm64v8,aarch64-unknown-linux-gnu; do IFS=',' read platform target <<< $cfg if [[ $TARGETS != *"$platform"* ]]; then continue; fi - build bwt-$version-x86_64-$platform $target http,electrum,webhooks,track-spends - build bwt-$version-electrum_only-x86_64-$platform $target electrum + build bwt-$version-$platform $target http,electrum,webhooks,track-spends + build bwt-$version-electrum_only-$platform $target electrum done echo Building electrum plugin for platform in linux win osx; do if [[ $TARGETS != *"$platform"* ]]; then continue; fi - name=bwt-$version-electrum_plugin-x86_64-$platform + name=bwt-$version-electrum_plugin-$platform dest=dist/$name mkdir $dest cp contrib/electrum-plugin/*.py $dest - cp dist/bwt-$version-electrum_only-x86_64-$platform/* $dest + cp dist/bwt-$version-electrum_only-$platform/* $dest # needs to be inside a directory with a name that matches the plugin module name for electrum to load it, # create a temporary link to get tar/zip to pack it properly. (can also be done for tar.gz with --transform) ln -s $name dist/bwt diff --git a/scripts/builder-osx.Dockerfile b/scripts/builder-osx.Dockerfile index 4896d5a..f856da3 100644 --- a/scripts/builder-osx.Dockerfile +++ b/scripts/builder-osx.Dockerfile @@ -14,7 +14,7 @@ RUN git clone https://github.com/tpoechtrager/osxcross /usr/src/osxcross && \ echo "$OSX_SDK_SHASUM tarballs/MacOSX$OSX_SDK_VERSION.sdk.tar.xz" | sha256sum -c - && \ UNATTENDED=yes OSX_VERSION_MIN=10.7 ./build.sh -ENV TARGETS=osx +ENV TARGETS=x86_64-osx ENV CC=x86_64-apple-darwin15-cc ENV AR=x86_64-apple-darwin15-ar ENV PATH=$PATH:/usr/src/osxcross/target/bin diff --git a/scripts/builder.Dockerfile b/scripts/builder.Dockerfile index 82432c8..6a80356 100644 --- a/scripts/builder.Dockerfile +++ b/scripts/builder.Dockerfile @@ -1,8 +1,11 @@ FROM rust:1.46-slim as builder -RUN apt-get update && apt-get install -y pkg-config libssl-dev gcc-mingw-w64-x86-64 zip && \ - rustup target add x86_64-pc-windows-gnu +RUN apt-get update && apt-get install -y pkg-config libssl-dev gcc-mingw-w64-x86-64 gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu zip && \ + rustup target add x86_64-pc-windows-gnu && \ + rustup target add armv7-unknown-linux-gnueabihf && \ + rustup target add aarch64-unknown-linux-gnu + # macOS is built using a separate image, see builder-osx.Dockerfile WORKDIR /usr/src/bwt VOLUME /usr/src/bwt -ENV TARGETS=linux,win +ENV TARGETS=x86_64-linux,x86_64-win,arm32v7,arm64v8 ENTRYPOINT [ "/usr/src/bwt/scripts/build.sh" ] diff --git a/scripts/release-footer.md b/scripts/release-footer.md index 4c66892..959ed3d 100644 --- a/scripts/release-footer.md +++ b/scripts/release-footer.md @@ -30,6 +30,6 @@ See [more details here](https://github.com/shesek/bwt#reproducible-builds). #### Electrum plugin -The [Electrum plugin](https://github.com/shesek/bwt#electrum-plugin) is available for download for Linux and Windows, as the `electrum_plugin` package. +The [Electrum plugin](https://github.com/shesek/bwt#electrum-plugin) is available for download for Linux, Mac, Windows and ARM as the `electrum_plugin` package. > ⚠️ **NOTE:** The plugin supports watch-only wallets only and **cannot be used with hot wallets**. This is done as a security measure, which is expected to eventually be lifted. You can use the plugin with hardware wallets or with an offline Electrum setup. For hot wallets, you will need to setup a standalone server instead of using the plugin, ideally far away from your keys.