diff --git a/etc/nix/fdroid.nix b/etc/nix/fdroid.nix index 6af7a6a..291c92c 100644 --- a/etc/nix/fdroid.nix +++ b/etc/nix/fdroid.nix @@ -18,12 +18,10 @@ let pyasn1 pyasn1-modules python-vagrant - libvirt pyyaml qrcode requests ruamel_yaml - libvirt ] ; python-with-fdroid-packages = pkgs.python3.withPackages fdroid-python-packages diff --git a/etc/nix/shell.nix b/etc/nix/shell.nix index 412b615..c8abbcd 100644 --- a/etc/nix/shell.nix +++ b/etc/nix/shell.nix @@ -33,12 +33,102 @@ let xkeyboard_config ] +; ndk-r17c = (nixpkgs.androidenv.composeAndroidPackages + { + ndkVersion = "17.2.4988734" + ; }).ndk-bundle + +; ndk-r21b = + let + version = "r21b" + ; in + nixpkgs.fetchzip + { + url = "https://dl.google.com/android/repository/android-ndk-${version}-linux-x86_64.zip" + ; sha256 = "0shz45b6f2k4lnca8fgghh4cdh53vghfn26cj4mkirkk4cpv1qry" + ; } + +; openssl-source = + let + name = "openssl" + ; version = "1.1.1g" + ; in + nixpkgs.fetchurl + { + url = "https://www.openssl.org/source/${name}-${version}.tar.gz" + ; sha256 = "0ikdcc038i7jk8h7asq5xcn8b1xc2rrbc88yfm4hqbz3y5s4gc6x" + ; } + +; iconv-source = + let + name = "libiconv" + ; version = "1.16" + ; in + nixpkgs.fetchurl + { + url = "http://ftp.gnu.org/pub/gnu/${name}/${name}-${version}.tar.gz" + ; sha256 = "016c57srqr0bza5fxjxfrx6aqxkqy0s3gkhcg7p7fhk5i6sv38g6" + ; } + +; boost-source = + let + name = "boost" + ; version = "1_71_0" + ; dot_version = "1.71.0" + ; in + nixpkgs.fetchurl + { + url = + "https://dl.bintray.com/boostorg/release/{dot_version}/source/${name}_${version}.tar.bz2" + ; sha256 = "1vi40mcair6xgm9k8rsavyhcia3ia28q8k0blknwgy4b3sh8sfnp" + ; } + +; sodium-source = + let + name = "libsodium" + ; version = "1.0.18" + ; in + nixpkgs.fetchurl + { + url = "https://github.com/jedisct1/${name}/archive/${version}.tar.gz" + ; sha256 = "1x6lll81z4ah732zwpw481qfbzg7yml0nwdgbnd5388jnz3274ym" + ; } + +; randomwow-source = + let + name = "RandomWOW" + ; version = "1.1.6" + ; in + nixpkgs.fetchurl + { + url = "https://github.com/wownero/${name}/archive/${version}.tar.gz" + ; sha256 = "1c55y2dwrayh6k1avpchs89gq1mvy5c305h92jm2k48kzhw6a792" + ; } + +; wownero-source = + nixpkgs.fetchFromGitHub + { + owner = "fuwa0529" + ; repo = "wownero" + ; rev = "8ca7e3" + ; sha256 = "07h8wiq8qm70m2s8bpalzx0fbrjl66khlha4qyfmpidpgv92daa6" + ; } + +; miniupnp-source = + nixpkgs.fetchFromGitHub + { + owner = "miniupnp" + ; repo = "miniupnp" + ; rev = "7800de9" + ; sha256 = "1f7jgll8lxz2l5lifgqafgx8694x0svgwyz8w8w4cwavm9lmah63" + ; } + ; in with nixpkgs; (buildFHSUserEnv { - name = "cyberwow-build-env" + name = "cyberwow-env" ; targetPkgs = pkgs: (with pkgs; [ bash @@ -58,7 +148,7 @@ with nixpkgs; gnumake gcc entr - androidenv.androidPkgs_9_0.platform-tools + # androidenv.androidPkgs_9_0.platform-tools zlib @@ -70,6 +160,7 @@ with nixpkgs; gnum4 pkgconfig cmake + ccache ] ++ android-studio-deps ) @@ -87,10 +178,19 @@ with nixpkgs; PATH=~/SDK/Android/Sdk/tools/bin:$PATH export ANDROID_NDK_VERSION=r21b - export ANDROID_NDK_ROOT=~/SDK/Android/ndk-archive/android-ndk-$ANDROID_NDK_VERSION + export ANDROID_NDK_ROOT=${ndk-r21b} export NDK=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64 PATH=$NDK/bin:$PATH + export SRC_OPENSSL=${openssl-source} + export SRC_ICONV=${iconv-source} + export SRC_BOOST=${boost-source} + export SRC_SODIUM=${sodium-source} + export SRC_RANDOMWOW=${randomwow-source} + export SRC_MINIUPNP_DIR=${miniupnp-source} + export SRC_RAPIDJSON_DIR=${nixpkgs.rapidjson.src} + export SRC_WOWNERO_DIR=${wownero-source} + export PATH_NCURSES=${nixpkgs.ncurses5} export PATH @@ -98,7 +198,7 @@ with nixpkgs; export DART_VM_OPTIONS=--root-certs-file=/etc/ssl/certs/ca-certificates.crt export ANDROID_NDK_VERSION_WOW=r17c - export ANDROID_NDK_ROOT_WOW=~/SDK/Android/ndk-archive/android-ndk-$ANDROID_NDK_VERSION_WOW + export ANDROID_NDK_ROOT_WOW=${ndk-r17c}/libexec/android-sdk/ndk-bundle export ZSH_INIT=${nixpkgs.oh-my-zsh}/share/oh-my-zsh/oh-my-zsh.sh exec zsh diff --git a/etc/scripts/build-external-libs/boost/build.sh b/etc/scripts/build-external-libs/boost/build.sh index 8df015b..3a2dd40 100755 --- a/etc/scripts/build-external-libs/boost/build.sh +++ b/etc/scripts/build-external-libs/boost/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Copyright (c) 2019, The Wownero Project # Copyright (c) 2014-2019, The Monero Project @@ -66,33 +66,42 @@ for arch in ${archs[@]}; do echo "building for ${arch}" ( - PATH=$build_root/tool/$arch/$target_host/bin:$build_root/tool/$arch/bin:$PATH \ - CC=clang \ - CXX=clang++; \ - ./b2 \ - cxxstd=14 \ - toolset=clang \ - threading=multi \ - threadapi=pthread \ - link=static \ - runtime-link=static \ - target-os=android \ - --ignore-site-config \ - --prefix=${PREFIX} \ - --build-dir=android \ - -sICONV_PATH=${ICONV_PATH} \ - --build-type=minimal \ - --with-chrono \ - --with-date_time \ - --with-filesystem \ - --with-program_options \ - --with-regex \ - --with-serialization \ - --with-system \ - --with-thread \ - --with-locale \ - install \ - -j${NPROC} \ + PATH=$build_root/tool/$arch/$target_host/bin:$build_root/tool/$arch/bin:$PATH + if [ -x "$(command -v ccache)" ]; then + echo "////////////////////////////////////////////" + echo "// CCACHE 1 //" + echo "////////////////////////////////////////////" + CC="ccache clang" + CXX="ccache clang++" + else + CC=clang + CXX=clang++ + fi + + ./b2 \ + cxxstd=14 \ + toolset=clang \ + threading=multi \ + threadapi=pthread \ + link=static \ + runtime-link=static \ + target-os=android \ + --ignore-site-config \ + --prefix=${PREFIX} \ + --build-dir=android \ + -sICONV_PATH=${ICONV_PATH} \ + --build-type=minimal \ + --with-chrono \ + --with-date_time \ + --with-filesystem \ + --with-program_options \ + --with-regex \ + --with-serialization \ + --with-system \ + --with-thread \ + --with-locale \ + install \ + -j${NPROC} \ ) done diff --git a/etc/scripts/build-external-libs/boost/fetch.sh b/etc/scripts/build-external-libs/boost/fetch.sh index 7e2e3c2..24c9ea6 100755 --- a/etc/scripts/build-external-libs/boost/fetch.sh +++ b/etc/scripts/build-external-libs/boost/fetch.sh @@ -39,12 +39,18 @@ name=boost version=1_71_0 dot_version=1.71.0 hash=d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee +url=https://dl.bintray.com/boostorg/release/${dot_version}/source/${name}_${version}.tar.bz2 +out=${name}_${version}.tar.bz2 rm -rf ${name}_${version} -curl -# -L -O \ - https://dl.bintray.com/boostorg/release/${dot_version}/source/${name}_${version}.tar.bz2 +if [ -f $SRC_BOOST ]; then + echo "using pre-fetched $name" + cp $SRC_BOOST $out +else + curl -# -L -o $out -O $url +fi -echo "${hash} ${name}_${version}.tar.bz2" | sha256sum -c +echo "$hash $out" | sha256sum -c -tar xfv ${name}_${version}.tar.bz2 +tar xfv $out diff --git a/etc/scripts/build-external-libs/clean.sh b/etc/scripts/build-external-libs/clean.sh index ce8e991..cf34aab 100755 --- a/etc/scripts/build-external-libs/clean.sh +++ b/etc/scripts/build-external-libs/clean.sh @@ -35,7 +35,6 @@ source etc/scripts/build-external-libs/env.sh build_root=$BUILD_PATH +chmod u+w -R $build_root rm -rf $build_root mkdir -p $build_root - -rm -rf cyberwow/native/output diff --git a/etc/scripts/build-external-libs/collect-fake.sh b/etc/scripts/build-external-libs/collect-fake.sh deleted file mode 100755 index 54f4e24..0000000 --- a/etc/scripts/build-external-libs/collect-fake.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2019, The Wownero Project -# Copyright (c) 2014-2019, The Monero Project -# -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are -# permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, this list of -# conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, this list -# of conditions and the following disclaimer in the documentation and/or other -# materials provided with the distribution. -# -# 3. Neither the name of the copyright holder nor the names of its contributors may be -# used to endorse or promote products derived from this software without specific -# prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -set -e - -source etc/scripts/build-external-libs/env.sh - -src_root=$BUILD_ROOT_SRC -target_root=`pwd` - -mkdir -p $target_root/cyberwow/native/output/arm64 -touch $target_root/cyberwow/native/output/arm64/wownerod - -mkdir -p $target_root/cyberwow/native/output/x86_64 -touch $target_root/cyberwow/native/output/x86_64/wownerod - -exit 0 diff --git a/etc/scripts/build-external-libs/collect.sh b/etc/scripts/build-external-libs/collect.sh index b7febda..9502e9f 100755 --- a/etc/scripts/build-external-libs/collect.sh +++ b/etc/scripts/build-external-libs/collect.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Copyright (c) 2019, The Wownero Project # Copyright (c) 2014-2019, The Monero Project @@ -34,6 +34,7 @@ set -e source etc/scripts/build-external-libs/env.sh src_root=$BUILD_ROOT_SRC +build_root=$BUILD_ROOT target_root=`pwd` name=wownero @@ -62,7 +63,7 @@ for arch in ${archs[@]}; do echo "collecting for ${arch}" mkdir -p $target_root/cyberwow/android/app/src/main/jniLibs/$target_abi cp build/release/bin/wownerod \ - $target_root/cyberwow/android/app/src/main/jniLibs/$target_abi/libwownerod.so + $target_root/cyberwow/android/app/src/main/jniLibs/$target_abi/libwownerod.so done diff --git a/etc/scripts/build-external-libs/env.sh b/etc/scripts/build-external-libs/env.sh index 4181414..0fee5fa 100644 --- a/etc/scripts/build-external-libs/env.sh +++ b/etc/scripts/build-external-libs/env.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + # Copyright (c) 2019, The Wownero Project # Copyright (c) 2014-2019, The Monero Project # diff --git a/etc/scripts/build-external-libs/iconv/build.sh b/etc/scripts/build-external-libs/iconv/build.sh index e7af77e..b57539c 100755 --- a/etc/scripts/build-external-libs/iconv/build.sh +++ b/etc/scripts/build-external-libs/iconv/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Copyright (c) 2019, The Wownero Project # Copyright (c) 2014-2019, The Monero Project @@ -61,15 +61,24 @@ for arch in ${archs[@]}; do echo "building for ${arch}" ( - PATH=$build_root/tool/$arch/$target_host/bin:$build_root/tool/$arch/bin:$PATH \ - CC=clang \ - CXX=clang++; \ - ./configure \ - --prefix=${PREFIX} \ - --build=x86_64-linux-gnu \ - --host=${target_host} \ - --disable-rpath \ - && make -j${NPROC} && make install && make clean \ + PATH=$build_root/tool/$arch/$target_host/bin:$build_root/tool/$arch/bin:$PATH + if [ -x "$(command -v ccache)" ]; then + echo "////////////////////////////////////////////" + echo "// CCACHE 1 //" + echo "////////////////////////////////////////////" + CC="ccache clang" + CXX="ccache clang++" + else + CC=clang + CXX=clang++ + fi + + ./configure \ + --prefix=${PREFIX} \ + --build=x86_64-linux-gnu \ + --host=${target_host} \ + --disable-rpath \ + && make -j${NPROC} && make install && make clean \ ) done diff --git a/etc/scripts/build-external-libs/iconv/fetch.sh b/etc/scripts/build-external-libs/iconv/fetch.sh index df22c3c..1ed1bc8 100755 --- a/etc/scripts/build-external-libs/iconv/fetch.sh +++ b/etc/scripts/build-external-libs/iconv/fetch.sh @@ -35,15 +35,21 @@ source etc/scripts/build-external-libs/env.sh cd $BUILD_ROOT_SRC +name=libiconv version=1.16 hash=e6a1b1b589654277ee790cce3734f07876ac4ccfaecbee8afa0b649cf529cc04 -name=libiconv +url=http://ftp.gnu.org/pub/gnu/${name}/${name}-${version}.tar.gz +out=${name}-${version}.tar.gz rm -rf ${name}-${version} -curl -# -L -O \ - http://ftp.gnu.org/pub/gnu/${name}/${name}-${version}.tar.gz -echo "${hash} ${name}-${version}.tar.gz" | sha256sum -c +if [ -f $SRC_ICONV ]; then + echo "using pre-fetched $name" + cp $SRC_ICONV $out +else + curl -# -L -o $out -O $url +fi -tar -xzf ${name}-${version}.tar.gz +echo "$hash $out" | sha256sum -c +tar -xzf $out diff --git a/etc/scripts/build-external-libs/openssl/build.sh b/etc/scripts/build-external-libs/openssl/build.sh index e27e0ae..5907d48 100755 --- a/etc/scripts/build-external-libs/openssl/build.sh +++ b/etc/scripts/build-external-libs/openssl/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Copyright (c) 2019, The Wownero Project # Copyright (c) 2014-2019, The Monero Project @@ -64,18 +64,30 @@ for arch in ${archs[@]}; do echo "building for ${arch}" + ( - export CC=clang - export CXX=clang++ - export ANDROID_API=23 - export PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH + ANDROID_API=29 export ANDROID_NDK_HOME=$ANDROID_NDK_ROOT + PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH + if [ -x "$(command -v ccache)" ]; then + echo "////////////////////////////////////////////" + echo "// CCACHE 1 //" + echo "////////////////////////////////////////////" + CC="ccache clang" + CXX="ccache clang++" + else + CC=clang + CXX=clang++ + fi + ./Configure android-${arch} \ --prefix=${PREFIX} \ no-comp \ -D__ANDROID_API__=$ANDROID_API \ - && make -j${NPROC} && make install && make clean \ + && make -j${NPROC} SHLIB_VERSION_NUMBER= SHLIB_EXT=.so \ + && make install_sw SHLIB_VERSION_NUMBER= SHLIB_EXT=.so \ + && make clean \ ) done diff --git a/etc/scripts/build-external-libs/openssl/fetch.sh b/etc/scripts/build-external-libs/openssl/fetch.sh index 21d6e7e..bae8fb1 100755 --- a/etc/scripts/build-external-libs/openssl/fetch.sh +++ b/etc/scripts/build-external-libs/openssl/fetch.sh @@ -38,12 +38,18 @@ cd $BUILD_ROOT_SRC name=openssl version=1.1.1g hash=ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46 +url=https://www.openssl.org/source/openssl-${version}.tar.gz +out=openssl-${version}.tar.gz rm -rf ${name}-${version} -curl -# -L -O \ - https://www.openssl.org/source/openssl-${version}.tar.gz +if [ -f $SRC_OPENSSL ]; then + echo "using pre-fetched $name" + cp $SRC_OPENSSL $out +else + curl -# -L -o $out -O $url +fi -echo "${hash} ${name}-${version}.tar.gz" | sha256sum -c +echo "${hash} $out" | sha256sum -c -tar xzf ${name}-${version}.tar.gz +tar xzf $out diff --git a/etc/scripts/build-external-libs/sodium/build.sh b/etc/scripts/build-external-libs/sodium/build.sh index 44dbd29..e1c2a88 100755 --- a/etc/scripts/build-external-libs/sodium/build.sh +++ b/etc/scripts/build-external-libs/sodium/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Copyright (c) 2019, The Wownero Project # Copyright (c) 2014-2019, The Monero Project @@ -63,16 +63,24 @@ for arch in ${archs[@]}; do echo "building for ${arch}" ( - PATH=$build_root/tool/$arch/$target_host/bin:$build_root/tool/$arch/bin:$PATH \ - CC=clang \ - CXX=clang++; \ + PATH=$build_root/tool/$arch/$target_host/bin:$build_root/tool/$arch/bin:$PATH + if [ -x "$(command -v ccache)" ]; then + echo "////////////////////////////////////////////" + echo "// CCACHE 1 //" + echo "////////////////////////////////////////////" + CC="ccache clang" + CXX="ccache clang++" + else + CC=clang + CXX=clang++ + fi - ./configure \ - --prefix=${PREFIX} \ - --host=${target_host} \ - --enable-static \ - --disable-shared \ - && make -j${NPROC} && make install && make clean \ + ./configure \ + --prefix=${PREFIX} \ + --host=${target_host} \ + --enable-static \ + --disable-shared \ + && make -j${NPROC} && make install && make clean \ ) done diff --git a/etc/scripts/build-external-libs/sodium/fetch.sh b/etc/scripts/build-external-libs/sodium/fetch.sh index c9a7928..10bcfff 100755 --- a/etc/scripts/build-external-libs/sodium/fetch.sh +++ b/etc/scripts/build-external-libs/sodium/fetch.sh @@ -38,12 +38,18 @@ cd $BUILD_ROOT_SRC name=libsodium version=1.0.18 hash=d59323c6b712a1519a5daf710b68f5e7fde57040845ffec53850911f10a5d4f4 +url=https://github.com/jedisct1/libsodium/archive/${version}.tar.gz +out=${name}-${version}.tar.gz rm -rf ${name}-${version} -curl -# -L -o ${name}-${version}.tar.gz \ -https://github.com/jedisct1/libsodium/archive/${version}.tar.gz +if [ -f $SRC_SODIUM ]; then + echo "using pre-fetched $name" + cp $SRC_SODIUM $out +else + curl -# -L -o $out -O $url +fi -echo "${hash} ${name}-${version}.tar.gz" | sha256sum -c +echo "${hash} $out" | sha256sum -c -tar xzf ${name}-${version}.tar.gz +tar xzf $out diff --git a/etc/scripts/build-external-libs/toolchain/import.sh b/etc/scripts/build-external-libs/toolchain/import.sh index 597a299..76634aa 100755 --- a/etc/scripts/build-external-libs/toolchain/import.sh +++ b/etc/scripts/build-external-libs/toolchain/import.sh @@ -36,7 +36,7 @@ source etc/scripts/build-external-libs/env.sh build_root=$BUILD_ROOT PATH=$ANDROID_NDK_ROOT/build/tools/:$PATH -args="--api 23 --stl=libc++" +args="--api 29 --stl=libc++" archs=(arm64) for arch in ${archs[@]}; do diff --git a/etc/scripts/build-external-libs/wownero/build.sh b/etc/scripts/build-external-libs/wownero/build.sh index d057b43..86226f3 100755 --- a/etc/scripts/build-external-libs/wownero/build.sh +++ b/etc/scripts/build-external-libs/wownero/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Copyright (c) 2019, The Wownero Project # Copyright (c) 2014-2019, The Monero Project @@ -77,10 +77,10 @@ for arch in ${archs[@]}; do cd build/release ( CMAKE_INCLUDE_PATH="${PREFIX}/include" \ - CMAKE_LIBRARY_PATH="${PREFIX}/lib" \ - CC=aarch64-linux-android-clang \ - CXX=aarch64-linux-android-clang++ \ - cmake \ + CMAKE_LIBRARY_PATH="${PREFIX}/lib" \ + CC=aarch64-linux-android-clang \ + CXX=aarch64-linux-android-clang++ \ + cmake \ -D BUILD_TESTS=OFF \ -D ARCH="armv8-a" \ -D STATIC=ON \ diff --git a/etc/scripts/build-external-libs/wownero/fetch.sh b/etc/scripts/build-external-libs/wownero/fetch.sh index 3c456f0..cba3f01 100755 --- a/etc/scripts/build-external-libs/wownero/fetch.sh +++ b/etc/scripts/build-external-libs/wownero/fetch.sh @@ -39,14 +39,40 @@ name=wownero # version=v0.7.0 version=dev-v0.8 githash=4c6c7ab87b2a56165f400f6e49f17b9577a2bcad +out=wownero -rm -rf $name +chmod u+w -f -R $out || true -git clone --depth 1 https://github.com/fuwa0529/wownero.git -b $version +rm -rf $out + +if [ -d $SRC_WOWNERO_DIR ]; then + echo "using pre-fetched $name" + rsync -av --no-perms --no-owner --no-group --delete $SRC_WOWNERO_DIR/* $out + chmod u+w -R $out/external +else + git clone --depth 1 https://github.com/wownero/wownero.git -b $version + # test `git rev-parse HEAD` = $githash || exit 1 +fi cd $name -# test `git rev-parse HEAD` = $githash || exit 1 -git submodule update --init external/miniupnp -git submodule update --init external/rapidjson -git submodule update --init external/RandomWOW +if [ -d $SRC_MINIUPNP_DIR ]; then + echo "using pre-fetched miniupnpc" + rsync -av --no-perms --no-owner --no-group --delete $SRC_MINIUPNP_DIR/* external/miniupnp +else + git submodule update --init external/miniupnp +fi + +if [ -d $SRC_RAPIDJSON_DIR ]; then + echo "using pre-fetched rapidjson" + rsync -av --no-perms --no-owner --no-group --delete $SRC_RAPIDJSON_DIR/* external/rapidjson +else + git submodule update --init external/rapidjson +fi + +if [ -f $SRC_RANDOMWOW ]; then + echo "using pre-fetched RandomWOW" + tar xzf $SRC_RANDOMWOW -C external/RandomWOW --strip-components=1 +else + git submodule update --init external/RandomWOW +fi diff --git a/etc/scripts/docker-build-wownero.sh b/etc/scripts/docker-build-wownero.sh deleted file mode 100755 index aa15f6e..0000000 --- a/etc/scripts/docker-build-wownero.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (c) 2019, The Wownero Project -# Copyright (c) 2014-2019, The Monero Project -# -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are -# permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, this list of -# conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, this list -# of conditions and the following disclaimer in the documentation and/or other -# materials provided with the distribution. -# -# 3. Neither the name of the copyright holder nor the names of its contributors may be -# used to endorse or promote products derived from this software without specific -# prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -set -e - -version="aba46a" -container="wownero-android-${version}" - -echo "Building: ${container}" -echo - -cd ../vendor/wownero -git fetch --all - -git checkout $version -git submodule init && git submodule update - -docker build -f utils/build_scripts/android64.Dockerfile -t $container . -docker create -it --name $container $container bash -docker cp ${container}:/src/build/release/bin . -