Skip to content

Commit

Permalink
Build ARMv7 releases (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
shesek committed Sep 26, 2020
1 parent 163833f commit 7ee9e34
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ 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"
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 (#19)

- Scriptable transaction broadcast command via `--tx-broadcast-cmd <cmd>` (#7)

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ARMv7).

The releases are signed by Nadav Ivgi (@shesek).
The public key can be verified on [keybase](https://keybase.io/nadav),
Expand Down Expand Up @@ -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 ARMv7.

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).
Expand Down Expand Up @@ -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 & ARMv7
$ docker build -t bwt-builder -f scripts/builder.Dockerfile .
$ docker run -it --rm -v `pwd`:/usr/src/bwt bwt-builder
Expand Down
9 changes: 6 additions & 3 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -xeo pipefail

# `osx` is also available, but requires osxcross installed (see builder-os.Dockerfile)
TARGETS=${TARGETS:-linux,win}
TARGETS=${TARGETS:-linux,win,armv7}

build() {
name=$1; target=$2; features=$3
Expand All @@ -16,7 +16,9 @@ build() {

mv target/$target/release/bwt$ext $dest

[[ $target == *"-apple-"* ]] || strip $dest/bwt$ext
if [[ $target != *"-apple-"* && $target != "armv7-"* ]]; then
strip $dest/bwt$ext
fi

cp README.md LICENSE $dest/

Expand All @@ -40,7 +42,8 @@ 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
osx,x86_64-apple-darwin \
armv7,armv7-unknown-linux-gnueabihf; do
IFS=',' read platform target <<< $cfg
if [[ $TARGETS != *"$platform"* ]]; then continue; fi

Expand Down
8 changes: 5 additions & 3 deletions scripts/builder.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
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 zip && \
rustup target add x86_64-pc-windows-gnu && \
rustup target add armv7-unknown-linux-gnueabihf
# 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=linux,win,armv7
ENTRYPOINT [ "/usr/src/bwt/scripts/build.sh" ]
2 changes: 1 addition & 1 deletion scripts/release-footer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ARMv7 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.

0 comments on commit 7ee9e34

Please sign in to comment.