From 274f3c9c09f246a82f6c0df553ecd1abf3c2d459 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Mon, 21 Oct 2019 10:50:11 -0700 Subject: [PATCH] Fix libsodium cross compile for win --- docker/Dockerfile | 7 +++---- mkrelease.sh | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index d2669cb..9c78c80 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -25,8 +25,7 @@ ENV CC_armv7_unknown_linux_gnueabhihf="arm-linux-gnueabihf-gcc" # This is a bug fix for the windows cross compiler for Rust. RUN cp /usr/x86_64-w64-mingw32/lib/crt2.o /usr/local/rustup/toolchains/1.38.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/crt2.o -# For windows cross compilation, use a pre-build binary +# For windows cross compilation, use a pre-build binary. Remember to set the +# SODIUM_LIB_DIR for windows cross compilation RUN cd /opt && wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.17-mingw.tar.gz && \ - tar xvf libsodium-1.0.17-mingw.tar.gz - -ENV SODIUM_LIB_DIR="/opt/libsodium-win64/lib/" \ No newline at end of file + tar xvf libsodium-1.0.17-mingw.tar.gz \ No newline at end of file diff --git a/mkrelease.sh b/mkrelease.sh index d201628..e3101a1 100755 --- a/mkrelease.sh +++ b/mkrelease.sh @@ -32,7 +32,7 @@ if [ -z $APP_VERSION ]; then echo "APP_VERSION is not set"; exit 1; fi #cargo build --release # For Windows and Linux, build via docker -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 x86_64-pc-windows-gnu" +docker run --rm -v $(pwd)/:/opt/zecwallet-light-cli rustbuild:latest bash -c "cd /opt/zecwallet-light-cli && cargo build --release && SODIUM_LIB_DIR='/opt/libsodium-win64/lib/' cargo build --release --target x86_64-pc-windows-gnu" # Now sign and zip the binaries #macOS