Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

Commit 11e0ea2

Browse files
author
adityapk00
committed
Build script improvements
1 parent dd8f7f3 commit 11e0ea2

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

docker/Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM ubuntu:16.04
1+
FROM ubuntu:18.04
22
LABEL Description="Rust compile env for Linux + Windows (cross)"
33

44
RUN apt update
5-
RUN apt install -y build-essential mingw-w64 gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf curl vim wget
5+
RUN apt install -y build-essential mingw-w64 gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf curl vim wget git
66

77
# Get Rust
88
RUN curl https://sh.rustup.rs -sSf | bash -s -- --default-toolchain none -y
@@ -33,13 +33,12 @@ ENV CC_armv7_unknown_linux_gnueabhihf="arm-linux-gnueabihf-gcc"
3333
RUN cd /opt && wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.17-mingw.tar.gz && \
3434
tar xvf libsodium-1.0.17-mingw.tar.gz
3535

36-
RUN apt install -y git
37-
3836
# Cargo fetch the dependencies so we don't download them over and over again
3937
RUN cd /tmp && git clone --depth=1 https://github.com/adityapk00/zecwallet-light-cli.git && \
4038
cd zecwallet-light-cli && \
4139
cargo fetch && \
4240
cd /tmp && rm -rf zecwallet-light-cli
4341

4442
# This is a bug fix for the windows cross compiler for Rust.
45-
RUN cp /usr/x86_64-w64-mingw32/lib/crt2.o /root/.rustup/toolchains/1.46.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/crt2.o
43+
# RUN cp /usr/x86_64-w64-mingw32/lib/crt2.o /root/.rustup/toolchains/1.49.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/crt2.o
44+

mkrelease.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ rm -rf target/macOS-zecwallet-cli-v$APP_VERSION
4545
mkdir -p target/macOS-zecwallet-cli-v$APP_VERSION
4646
cp target/release/zecwallet-cli target/macOS-zecwallet-cli-v$APP_VERSION/
4747

48-
# For Windows and Linux, build via docker
49-
docker run --rm -v $(pwd)/:/opt/zecwallet-light-cli rustbuild:latest bash -c "cd /opt/zecwallet-light-cli && cargo build --release && cargo build --release --target armv7-unknown-linux-gnueabihf && cargo build --release --target aarch64-unknown-linux-gnu && SODIUM_LIB_DIR='/opt/libsodium-win64/lib/' cargo build --release --target x86_64-pc-windows-gnu"
50-
5148
# Now sign and zip the binaries
5249
# macOS
5350
gpg --batch --output target/macOS-zecwallet-cli-v$APP_VERSION/zecwallet-cli.sig --detach-sig target/macOS-zecwallet-cli-v$APP_VERSION/zecwallet-cli
@@ -58,6 +55,8 @@ cd ..
5855
zip -r macOS-zecwallet-cli-v$APP_VERSION.zip macOS-zecwallet-cli-v$APP_VERSION
5956
cd ..
6057

58+
# For Windows and Linux, build via docker
59+
docker run --rm -v $(pwd)/:/opt/zecwallet-light-cli rustbuild:latest bash -c "cd /opt/zecwallet-light-cli && cargo build --release && cargo build --release --target armv7-unknown-linux-gnueabihf && cargo build --release --target aarch64-unknown-linux-gnu && SODIUM_LIB_DIR='/opt/libsodium-win64/lib/' cargo build --release --target x86_64-pc-windows-gnu"
6160

6261
#Linux
6362
rm -rf target/linux-zecwallet-cli-v$APP_VERSION

0 commit comments

Comments
 (0)