From 73a50151bd46df739b79cdcb3c91f95d1d45ca85 Mon Sep 17 00:00:00 2001 From: fuwa Date: Wed, 8 Apr 2020 22:42:30 +0800 Subject: [PATCH 01/19] add changelog --- fastlane/metadata/android/en-US/changelogs/23.txt | 2 ++ fastlane/metadata/android/en-US/changelogs/24.txt | 2 ++ fastlane/metadata/android/en-US/changelogs/25.txt | 2 ++ 3 files changed, 6 insertions(+) create mode 100644 fastlane/metadata/android/en-US/changelogs/23.txt create mode 100644 fastlane/metadata/android/en-US/changelogs/24.txt create mode 100644 fastlane/metadata/android/en-US/changelogs/25.txt diff --git a/fastlane/metadata/android/en-US/changelogs/23.txt b/fastlane/metadata/android/en-US/changelogs/23.txt new file mode 100644 index 0000000..eb6ca5b --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/23.txt @@ -0,0 +1,2 @@ +* Support custom start up args +* Upgrade to AndroidX diff --git a/fastlane/metadata/android/en-US/changelogs/24.txt b/fastlane/metadata/android/en-US/changelogs/24.txt new file mode 100644 index 0000000..277e221 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/24.txt @@ -0,0 +1,2 @@ +* Use flutter beta +* Make connection checking more conservative by requiring at least one active peer diff --git a/fastlane/metadata/android/en-US/changelogs/25.txt b/fastlane/metadata/android/en-US/changelogs/25.txt new file mode 100644 index 0000000..d89008c --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/25.txt @@ -0,0 +1,2 @@ +* Fix openssl checksum +* Optimize UI for large tx pool From e2d90dbca96a016b69493f3cd29fb5cae1058459 Mon Sep 17 00:00:00 2001 From: fuwa Date: Sun, 12 Apr 2020 18:27:23 +0800 Subject: [PATCH 02/19] update wownero build script --- .../build-external-libs/wownero/build.sh | 25 ++++++++++++++++--- .../build-external-libs/wownero/fetch.sh | 5 +++- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/etc/scripts/build-external-libs/wownero/build.sh b/etc/scripts/build-external-libs/wownero/build.sh index 94c0dd5..fe78d7c 100755 --- a/etc/scripts/build-external-libs/wownero/build.sh +++ b/etc/scripts/build-external-libs/wownero/build.sh @@ -72,13 +72,30 @@ for arch in ${archs[@]}; do export TOOLCHAIN_DIR=`realpath $build_root_wow/tool/${arch}` export PATH=$PATH:$build_root/host/bin + mkdir -p build/release + pushd . + cd build/release ( CMAKE_INCLUDE_PATH="${PREFIX}/include" \ - CMAKE_LIBRARY_PATH="${PREFIX}/lib" \ - ANDROID_STANDALONE_TOOLCHAIN_PATH=${TOOLCHAIN_DIR} \ - USE_SINGLE_BUILDDIR=1 \ - make release-static-android-armv8 -j${NPROC} \ + 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 \ + -D BUILD_64=ON \ + -D CMAKE_BUILD_TYPE=release \ + -D ANDROID=true \ + -D INSTALL_VENDORED_LIBUNBOUND=ON \ + -D BUILD_TAG="android-armv8" \ + -D CMAKE_SYSTEM_NAME="Android" \ + -D CMAKE_ANDROID_STANDALONE_TOOLCHAIN="${TOOLCHAIN_DIR}" \ + -D CMAKE_ANDROID_ARCH_ABI="arm64-v8a" \ + -D MANUAL_SUBMODULES=ON \ + ../.. && make -j${NPROC} ) + popd done diff --git a/etc/scripts/build-external-libs/wownero/fetch.sh b/etc/scripts/build-external-libs/wownero/fetch.sh index dd0edbc..8eed544 100755 --- a/etc/scripts/build-external-libs/wownero/fetch.sh +++ b/etc/scripts/build-external-libs/wownero/fetch.sh @@ -46,4 +46,7 @@ git clone --depth 1 https://github.com/wownero/wownero.git -b $version cd $name test `git rev-parse HEAD` = $githash || exit 1 -git submodule init && git submodule update +git submodule update --init external/unbound +git submodule update --init external/miniupnp +git submodule update --init external/rapidjson +git submodule update --init external/RandomWOW From 4386f00f6acd35a17cddae53355b3bf715909e28 Mon Sep 17 00:00:00 2001 From: fuwa Date: Tue, 7 Apr 2020 05:22:11 +0800 Subject: [PATCH 03/19] use dev-v0.8 --- etc/scripts/build-external-libs/wownero/fetch.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/etc/scripts/build-external-libs/wownero/fetch.sh b/etc/scripts/build-external-libs/wownero/fetch.sh index 8eed544..b05d2b6 100755 --- a/etc/scripts/build-external-libs/wownero/fetch.sh +++ b/etc/scripts/build-external-libs/wownero/fetch.sh @@ -36,7 +36,8 @@ source etc/scripts/build-external-libs/env.sh cd $BUILD_ROOT_SRC name=wownero -version=v0.7.0 +# version=v0.7.0 +version=dev-v0.8 githash=4c6c7ab87b2a56165f400f6e49f17b9577a2bcad rm -rf $name @@ -44,7 +45,7 @@ rm -rf $name git clone --depth 1 https://github.com/wownero/wownero.git -b $version cd $name -test `git rev-parse HEAD` = $githash || exit 1 +# test `git rev-parse HEAD` = $githash || exit 1 git submodule update --init external/unbound git submodule update --init external/miniupnp From 022ed929dc898fa2db1f29a4c78b0f41d77c6c1c Mon Sep 17 00:00:00 2001 From: fuwa Date: Sun, 12 Apr 2020 23:47:15 +0800 Subject: [PATCH 04/19] remove unbound --- etc/scripts/build-external-libs/wownero/fetch.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/etc/scripts/build-external-libs/wownero/fetch.sh b/etc/scripts/build-external-libs/wownero/fetch.sh index b05d2b6..3c456f0 100755 --- a/etc/scripts/build-external-libs/wownero/fetch.sh +++ b/etc/scripts/build-external-libs/wownero/fetch.sh @@ -42,12 +42,11 @@ githash=4c6c7ab87b2a56165f400f6e49f17b9577a2bcad rm -rf $name -git clone --depth 1 https://github.com/wownero/wownero.git -b $version +git clone --depth 1 https://github.com/fuwa0529/wownero.git -b $version cd $name # test `git rev-parse HEAD` = $githash || exit 1 -git submodule update --init external/unbound git submodule update --init external/miniupnp git submodule update --init external/rapidjson git submodule update --init external/RandomWOW From 00b12b09a9f434ff8ed1dc5285d7988a98988100 Mon Sep 17 00:00:00 2001 From: fuwa Date: Mon, 20 Apr 2020 07:53:11 +0800 Subject: [PATCH 05/19] add build-bundle task --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9843398..933d1d3 100644 --- a/Makefile +++ b/Makefile @@ -73,9 +73,13 @@ build: cd cyberwow && \ flutter build apk --target-platform android-arm64 -v +build-bundle: + cd cyberwow && \ + flutter build appbundle --target-platform android-arm64 -v + build-debug: cd cyberwow && \ - flutter build apk --debug --target-platform android-arm64 + flutter build appbundle --debug --target-platform android-arm64 install: build cd cyberwow && \ From a4cf3bb9de1014847eee147df90f399b116b3d03 Mon Sep 17 00:00:00 2001 From: fuwa Date: Tue, 21 Apr 2020 22:02:33 +0800 Subject: [PATCH 06/19] set theme background color --- cyberwow/lib/config/cyberwow.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/cyberwow/lib/config/cyberwow.dart b/cyberwow/lib/config/cyberwow.dart index 00a92a7..718fc94 100644 --- a/cyberwow/lib/config/cyberwow.dart +++ b/cyberwow/lib/config/cyberwow.dart @@ -34,6 +34,7 @@ final _theme = ThemeData accentColor: crtGreen, cursorColor: crtGreen, + backgroundColor: Colors.black, scaffoldBackgroundColor: Colors.black, textTheme: TextTheme From 034baa21d27a4a195ac6e0c9690d75f0a2c55d50 Mon Sep 17 00:00:00 2001 From: fuwa Date: Mon, 27 Apr 2020 10:07:09 +0800 Subject: [PATCH 07/19] remove zlib --- Makefile | 6 +- .../build-external-libs/openssl/build.sh | 3 +- etc/scripts/build-external-libs/zlib/build.sh | 76 ------------------- etc/scripts/build-external-libs/zlib/fetch.sh | 49 ------------ 4 files changed, 2 insertions(+), 132 deletions(-) delete mode 100755 etc/scripts/build-external-libs/zlib/build.sh delete mode 100755 etc/scripts/build-external-libs/zlib/fetch.sh diff --git a/Makefile b/Makefile index 933d1d3..4d40612 100644 --- a/Makefile +++ b/Makefile @@ -107,11 +107,7 @@ boost: iconv $(script)/boost/fetch.sh $(script)/boost/build.sh -zlib: toolchain - $(script)/zlib/fetch.sh - $(script)/zlib/build.sh - -openssl: zlib +openssl: toolchain $(script)/openssl/fetch.sh $(script)/openssl/build.sh diff --git a/etc/scripts/build-external-libs/openssl/build.sh b/etc/scripts/build-external-libs/openssl/build.sh index 96945d9..cdb28a6 100755 --- a/etc/scripts/build-external-libs/openssl/build.sh +++ b/etc/scripts/build-external-libs/openssl/build.sh @@ -73,9 +73,8 @@ for arch in ${archs[@]}; do ./Configure android-${arch} \ --prefix=${PREFIX} \ + no-comp \ -D__ANDROID_API__=$ANDROID_API \ - --with-zlib-include=${ZLIB_PATH}/include \ - --with-zlib-lib=${ZLIB_PATH}/lib \ && make -j${NPROC} && make install && make clean \ ) diff --git a/etc/scripts/build-external-libs/zlib/build.sh b/etc/scripts/build-external-libs/zlib/build.sh deleted file mode 100755 index 41a5f6c..0000000 --- a/etc/scripts/build-external-libs/zlib/build.sh +++ /dev/null @@ -1,76 +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 - -build_root=$BUILD_ROOT -src_root=$BUILD_ROOT_SRC - -name=zlib -version=1.2.11 - -cd $src_root/${name}-${version} - -archs=(arm64) -for arch in ${archs[@]}; do - extra_cmake_flags="" - case ${arch} in - "arm64") - target_host=aarch64-linux-android - ;; - "x86_64") - target_host=x86_64-linux-android - ;; - *) - exit 16 - ;; - esac - - # PREFIX=$build_root/build/${name}/$arch - PREFIX=$build_root/build/$arch - echo "building for ${arch}" - - export CC=clang - export CXX=clang++ - - ( - PATH=$build_root/tool/$arch/$target_host/bin:$build_root/tool/$arch/bin:$PATH; \ - ./configure \ - --prefix=${PREFIX} \ - --static \ - && make -j${NPROC} && make install && make clean \ - ) - -done - -exit 0 diff --git a/etc/scripts/build-external-libs/zlib/fetch.sh b/etc/scripts/build-external-libs/zlib/fetch.sh deleted file mode 100755 index 2881dbb..0000000 --- a/etc/scripts/build-external-libs/zlib/fetch.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 - -source etc/scripts/build-external-libs/env.sh - -cd $BUILD_ROOT_SRC - -name=zlib -version=1.2.11 -hash=c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 - -rm -rf ${name}-${version} - -curl -# -L -O \ - https://zlib.net/${name}-${version}.tar.gz - -echo "${hash} ${name}-${version}.tar.gz" | sha256sum -c - -tar xzf ${name}-${version}.tar.gz From c60b82e6085c330ddbf080170a26eed276e5f6c6 Mon Sep 17 00:00:00 2001 From: fuwa Date: Tue, 28 Apr 2020 22:48:39 +0800 Subject: [PATCH 08/19] only build daemon --- etc/scripts/build-external-libs/wownero/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/scripts/build-external-libs/wownero/build.sh b/etc/scripts/build-external-libs/wownero/build.sh index fe78d7c..d057b43 100755 --- a/etc/scripts/build-external-libs/wownero/build.sh +++ b/etc/scripts/build-external-libs/wownero/build.sh @@ -93,7 +93,7 @@ for arch in ${archs[@]}; do -D CMAKE_ANDROID_STANDALONE_TOOLCHAIN="${TOOLCHAIN_DIR}" \ -D CMAKE_ANDROID_ARCH_ABI="arm64-v8a" \ -D MANUAL_SUBMODULES=ON \ - ../.. && make -j${NPROC} + ../.. && make -j${NPROC} daemon ) popd From b845c6eee2fd75305bc29c870c618747c4265970 Mon Sep 17 00:00:00 2001 From: fuwa Date: Tue, 28 Apr 2020 23:26:51 +0800 Subject: [PATCH 09/19] use ndk21b --- etc/nix/shell.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/nix/shell.nix b/etc/nix/shell.nix index cbd09b3..412b615 100644 --- a/etc/nix/shell.nix +++ b/etc/nix/shell.nix @@ -86,7 +86,7 @@ with nixpkgs; PATH=~/SDK/Android/android-studio/bin:$PATH PATH=~/SDK/Android/Sdk/tools/bin:$PATH - export ANDROID_NDK_VERSION=r20b + export ANDROID_NDK_VERSION=r21b export ANDROID_NDK_ROOT=~/SDK/Android/ndk-archive/android-ndk-$ANDROID_NDK_VERSION export NDK=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64 PATH=$NDK/bin:$PATH From a598d517cd11f0c0b8fc40e7041f2a467b0706c8 Mon Sep 17 00:00:00 2001 From: fuwa Date: Wed, 29 Apr 2020 00:11:19 +0800 Subject: [PATCH 10/19] update openssl --- etc/scripts/build-external-libs/openssl/build.sh | 2 +- etc/scripts/build-external-libs/openssl/fetch.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/scripts/build-external-libs/openssl/build.sh b/etc/scripts/build-external-libs/openssl/build.sh index cdb28a6..e27e0ae 100755 --- a/etc/scripts/build-external-libs/openssl/build.sh +++ b/etc/scripts/build-external-libs/openssl/build.sh @@ -37,7 +37,7 @@ build_root=$BUILD_ROOT src_root=$BUILD_ROOT_SRC name=openssl -version=1.1.1f +version=1.1.1g cd $src_root/${name}-${version} diff --git a/etc/scripts/build-external-libs/openssl/fetch.sh b/etc/scripts/build-external-libs/openssl/fetch.sh index 2fb1088..21d6e7e 100755 --- a/etc/scripts/build-external-libs/openssl/fetch.sh +++ b/etc/scripts/build-external-libs/openssl/fetch.sh @@ -36,8 +36,8 @@ source etc/scripts/build-external-libs/env.sh cd $BUILD_ROOT_SRC name=openssl -version=1.1.1f -hash=186c6bfe6ecfba7a5b48c47f8a1673d0f3b0e5ba2e25602dd23b629975da3f35 +version=1.1.1g +hash=ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46 rm -rf ${name}-${version} From a0557ba03697788204c0848872a0d259c7c24d52 Mon Sep 17 00:00:00 2001 From: fuwa Date: Wed, 29 Apr 2020 13:45:31 +0800 Subject: [PATCH 11/19] update flutter beta to 1.17 --- cyberwow/pubspec.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/cyberwow/pubspec.lock b/cyberwow/pubspec.lock index 1ec6745..dfcd52e 100644 --- a/cyberwow/pubspec.lock +++ b/cyberwow/pubspec.lock @@ -7,42 +7,42 @@ packages: name: archive url: "https://pub.dartlang.org" source: hosted - version: "2.0.11" + version: "2.0.13" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "1.5.2" + version: "1.6.0" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.0" + version: "2.4.1" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" + version: "2.0.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" + version: "1.1.3" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.11" + version: "1.14.12" convert: dependency: transitive description: @@ -56,7 +56,7 @@ packages: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.1.3" + version: "2.1.4" flutter: dependency: "direct main" description: flutter @@ -92,7 +92,7 @@ packages: name: image url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" + version: "2.1.12" intl: dependency: "direct main" description: @@ -183,7 +183,7 @@ packages: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.1.3" shared_preferences: dependency: "direct main" description: @@ -223,7 +223,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.5.5" + version: "1.7.0" stack_trace: dependency: transitive description: @@ -279,7 +279,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "3.5.0" + version: "3.6.1" sdks: - dart: ">=2.5.0 <3.0.0" + dart: ">=2.6.0 <3.0.0" flutter: ">=1.12.13+hotfix.4 <2.0.0" From 44dad34fa2f294bc82f7b53cb16acbafb1b1b944 Mon Sep 17 00:00:00 2001 From: fuwa Date: Thu, 30 Apr 2020 17:34:01 +0800 Subject: [PATCH 12/19] bundle deps --- etc/nix/fdroid.nix | 2 - etc/nix/shell.nix | 108 +++++++++++++++++- .../build-external-libs/boost/build.sh | 65 ++++++----- .../build-external-libs/boost/fetch.sh | 14 ++- etc/scripts/build-external-libs/clean.sh | 3 +- .../build-external-libs/collect-fake.sh | 45 -------- etc/scripts/build-external-libs/collect.sh | 5 +- etc/scripts/build-external-libs/env.sh | 2 + .../build-external-libs/iconv/build.sh | 29 +++-- .../build-external-libs/iconv/fetch.sh | 16 ++- .../build-external-libs/openssl/build.sh | 24 +++- .../build-external-libs/openssl/fetch.sh | 14 ++- .../build-external-libs/sodium/build.sh | 28 +++-- .../build-external-libs/sodium/fetch.sh | 14 ++- .../build-external-libs/toolchain/import.sh | 2 +- .../build-external-libs/wownero/build.sh | 10 +- .../build-external-libs/wownero/fetch.sh | 38 +++++- etc/scripts/docker-build-wownero.sh | 49 -------- 18 files changed, 281 insertions(+), 187 deletions(-) delete mode 100755 etc/scripts/build-external-libs/collect-fake.sh delete mode 100755 etc/scripts/docker-build-wownero.sh 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 . - From 95a6ad7ae5056f6ffa8be0da8f129ed19f5b9247 Mon Sep 17 00:00:00 2001 From: fuwa Date: Thu, 30 Apr 2020 18:09:54 +0800 Subject: [PATCH 13/19] point to the fdroid build script in readme --- README.md | 51 +++------------------------------------------------ 1 file changed, 3 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index c64e22d..362745e 100644 --- a/README.md +++ b/README.md @@ -7,57 +7,12 @@ A dumb android pruned full node for Wownero. height="80">](https://f-droid.org/en/packages/org.wownero.cyberwow/) Get it on Google Play -## How to build - -### Compile wownerod for android-arm64 - -#### Simple method with Docker - -``` -pushd . -git clone https://github.com/wownero/wownero -cd wownero -git submodule init && git submodule update - -docker build -f utils/build_scripts/android64.Dockerfile -t wownero-android . -# Create container -docker create -it --name wownero-android wownero-android bash -# Get binaries -docker cp wownero-android:/src/build/release/bin . -``` - -The binary needed is `./bin/wownerod`. - -#### Alternative methods - -1. One docker instance per hash - -See `etc/scripts/docker-build-wownero.sh`, modify the value of `version` per build. -2. Debian based system similar to F-droid - -See the `wow` task in `Makefile`. - -### Install flutter and make sure it's in path - -### Compile CyberWOW - -``` -popd -git clone https://github.com/wownero/cyberwow/ -cd cyberwow - -mkdir -p cyberwow/android/app/src/main/jniLibs/arm64-v8a - -# Copy wownerod that we just built -cp $PATH_TO_WOWNEROD \ -cyberwow/android/app/src/main/jniLibs/arm64-v8a/libwownerod.so - -make build -``` +## How to build -The resulting apk is `cyberwow/build/app/outputs/apk/release/app-release.apk`. +An example build script that works on an F-droid build server, which is based on debian stable, is here: + ## How to use custom start up arguments From e9bc70a26d1d7a76270618301714b0e47a9f4674 Mon Sep 17 00:00:00 2001 From: fuwa Date: Thu, 30 Apr 2020 22:45:26 +0800 Subject: [PATCH 14/19] clean up makefile --- Makefile | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index 4d40612..e4c08c0 100644 --- a/Makefile +++ b/Makefile @@ -50,32 +50,13 @@ run-release: cd cyberwow && \ flutter run --release --pid-file /tmp/flutter.pid -# clang -target aarch64-linux-android21 cyberwow/native/hello.c -o cyberwow/native/output/hello -c: - clang -target x86_64-linux-android21 cyberwow/native/hello.c -o cyberwow/native/output/x86_64/wownerod - -build-c: c - cd cyberwow && \ - flutter clean - -push: - adb push cyberwow/native/output/hello /data/local/tmp - -test-android: - adb shell /data/local/tmp/hello - -test-c: c push test-android - -collect: - cp ../vendor/wownero/bin/wownerod cyberwow/native/output/arm64/ - build: cd cyberwow && \ - flutter build apk --target-platform android-arm64 -v + flutter build apk --target-platform android-arm64 build-bundle: cd cyberwow && \ - flutter build appbundle --target-platform android-arm64 -v + flutter build appbundle --target-platform android-arm64 build-debug: cd cyberwow && \ @@ -91,8 +72,6 @@ script := etc/scripts/build-external-libs wow: clean-external-libs collect-wownero build -wow-no-native: build - clean-external-libs: $(script)/clean.sh From 87fd4e8bee4044b660b0f796f7791b93c530c57a Mon Sep 17 00:00:00 2001 From: fuwa Date: Fri, 1 May 2020 10:52:46 +0800 Subject: [PATCH 15/19] add bsd3 license to shell.nix --- etc/nix/shell.nix | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/etc/nix/shell.nix b/etc/nix/shell.nix index c8abbcd..23c506b 100644 --- a/etc/nix/shell.nix +++ b/etc/nix/shell.nix @@ -1,3 +1,31 @@ +# Copyright (c) 2019-2020, The Wownero 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. + let nixpkgs = import {} From ffc9aceeaed29b88ea506f90a9dbdc709a08ad7c Mon Sep 17 00:00:00 2001 From: fuwa Date: Sun, 17 May 2020 19:17:30 +0800 Subject: [PATCH 16/19] add unbound --- etc/nix/shell.nix | 16 +++++++++++++--- etc/scripts/build-external-libs/wownero/fetch.sh | 7 +++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/etc/nix/shell.nix b/etc/nix/shell.nix index 23c506b..3852571 100644 --- a/etc/nix/shell.nix +++ b/etc/nix/shell.nix @@ -136,10 +136,10 @@ let ; wownero-source = nixpkgs.fetchFromGitHub { - owner = "fuwa0529" + owner = "wownero" ; repo = "wownero" - ; rev = "8ca7e3" - ; sha256 = "07h8wiq8qm70m2s8bpalzx0fbrjl66khlha4qyfmpidpgv92daa6" + ; rev = "dev-v0.8" + ; sha256 = "13032pa9wx3h6x860f9iy28vdpkc94wzby153ig7hw4dixjqhs6w" ; } ; miniupnp-source = @@ -151,6 +151,15 @@ let ; sha256 = "1f7jgll8lxz2l5lifgqafgx8694x0svgwyz8w8w4cwavm9lmah63" ; } +; unbound-source = + nixpkgs.fetchFromGitHub + { + owner = "monero-project" + ; repo = "unbound" + ; rev = "9a77c29" + ; sha256 = "0dmm5pz2yf1lfand9k1c8x0mbrwynkpphh877b8jbavjrwiwsw35" + ; } + ; in with nixpkgs; @@ -216,6 +225,7 @@ with nixpkgs; export SRC_SODIUM=${sodium-source} export SRC_RANDOMWOW=${randomwow-source} export SRC_MINIUPNP_DIR=${miniupnp-source} + export SRC_UNBOUND_DIR=${unbound-source} export SRC_RAPIDJSON_DIR=${nixpkgs.rapidjson.src} export SRC_WOWNERO_DIR=${wownero-source} diff --git a/etc/scripts/build-external-libs/wownero/fetch.sh b/etc/scripts/build-external-libs/wownero/fetch.sh index cba3f01..f68b020 100755 --- a/etc/scripts/build-external-libs/wownero/fetch.sh +++ b/etc/scripts/build-external-libs/wownero/fetch.sh @@ -76,3 +76,10 @@ if [ -f $SRC_RANDOMWOW ]; then else git submodule update --init external/RandomWOW fi + +if [ -d $SRC_UNBOUND_DIR ]; then + echo "using pre-fetched unbound" + rsync -av --no-perms --no-owner --no-group --delete $SRC_UNBOUND_DIR/* external/unbound +else + git submodule update --init external/unbound +fi From 589e223c4abf09002e69644be7d8d8c1ed80dcc8 Mon Sep 17 00:00:00 2001 From: fuwa Date: Sun, 17 May 2020 19:29:53 +0800 Subject: [PATCH 17/19] use flutter stable --- cyberwow/pubspec.lock | 18 +++++++++--------- etc/nix/shell.nix | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cyberwow/pubspec.lock b/cyberwow/pubspec.lock index dfcd52e..d687130 100644 --- a/cyberwow/pubspec.lock +++ b/cyberwow/pubspec.lock @@ -78,7 +78,7 @@ packages: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.12.0+4" + version: "0.12.1" http_parser: dependency: transitive description: @@ -134,21 +134,21 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "1.6.5" + version: "1.6.8" path_provider_macos: dependency: transitive description: name: path_provider_macos url: "https://pub.dartlang.org" source: hosted - version: "0.0.4" + version: "0.0.4+2" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" pedantic: dependency: transitive description: @@ -190,28 +190,28 @@ packages: name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "0.5.6+3" + version: "0.5.7+2" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+6" + version: "0.0.1+8" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.0.4" shared_preferences_web: dependency: transitive description: name: shared_preferences_web url: "https://pub.dartlang.org" source: hosted - version: "0.1.2+4" + version: "0.1.2+5" sky_engine: dependency: transitive description: flutter @@ -282,4 +282,4 @@ packages: version: "3.6.1" sdks: dart: ">=2.6.0 <3.0.0" - flutter: ">=1.12.13+hotfix.4 <2.0.0" + flutter: ">=1.12.13+hotfix.5 <2.0.0" diff --git a/etc/nix/shell.nix b/etc/nix/shell.nix index 3852571..f05f15b 100644 --- a/etc/nix/shell.nix +++ b/etc/nix/shell.nix @@ -210,7 +210,7 @@ with nixpkgs; ; profile = '' export ANDROID_HOME=~/SDK/Android/Sdk - PATH=~/local/sdk/flutter/beta/bin:$PATH + PATH=~/local/sdk/flutter/stable/bin:$PATH PATH=~/SDK/Android/android-studio/bin:$PATH PATH=~/SDK/Android/Sdk/tools/bin:$PATH From 77d637aaf19776c504acf864d8bc0c9f0274411d Mon Sep 17 00:00:00 2001 From: fuwa Date: Wed, 20 May 2020 10:01:58 +0800 Subject: [PATCH 18/19] use wownero 0.8 --- cyberwow/android/app/build.gradle | 4 ++-- cyberwow/pubspec.yaml | 2 +- etc/scripts/build-external-libs/wownero/fetch.sh | 10 +++++----- fastlane/metadata/android/en-US/changelogs/26.txt | 1 + 4 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/26.txt diff --git a/cyberwow/android/app/build.gradle b/cyberwow/android/app/build.gradle index 01d428e..e581576 100644 --- a/cyberwow/android/app/build.gradle +++ b/cyberwow/android/app/build.gradle @@ -41,8 +41,8 @@ android { applicationId "org.wownero.cyberwow" minSdkVersion 26 targetSdkVersion 29 - versionCode 25 - versionName "0.7.0.0-l" + versionCode 26 + versionName "0.8.0.0" } if(project.hasProperty("RELEASE_STORE_FILE")) { diff --git a/cyberwow/pubspec.yaml b/cyberwow/pubspec.yaml index d2c5165..493b134 100644 --- a/cyberwow/pubspec.yaml +++ b/cyberwow/pubspec.yaml @@ -1,7 +1,7 @@ name: cyberwow description: A new Flutter project. -version: 0.7.0+25 +version: 0.8.0+0 environment: sdk: ">=2.1.0 <3.0.0" diff --git a/etc/scripts/build-external-libs/wownero/fetch.sh b/etc/scripts/build-external-libs/wownero/fetch.sh index f68b020..24b78b0 100755 --- a/etc/scripts/build-external-libs/wownero/fetch.sh +++ b/etc/scripts/build-external-libs/wownero/fetch.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright (c) 2019, The Wownero Project +# Copyright (c) 2019-2020, The Wownero Project # Copyright (c) 2014-2019, The Monero Project # # All rights reserved. @@ -36,9 +36,9 @@ source etc/scripts/build-external-libs/env.sh cd $BUILD_ROOT_SRC name=wownero -# version=v0.7.0 -version=dev-v0.8 -githash=4c6c7ab87b2a56165f400f6e49f17b9577a2bcad +version=v0.8.0.0 +# version=dev-v0.8 +githash=1271a7e3a97c0d81816b401627aefb6c6697d0b3 out=wownero chmod u+w -f -R $out || true @@ -51,7 +51,7 @@ if [ -d $SRC_WOWNERO_DIR ]; then 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 + test `git rev-parse HEAD` = $githash || exit 1 fi cd $name diff --git a/fastlane/metadata/android/en-US/changelogs/26.txt b/fastlane/metadata/android/en-US/changelogs/26.txt new file mode 100644 index 0000000..c52473b --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/26.txt @@ -0,0 +1 @@ +* Base on Wownero v0.8 Hallucenogenic Hypnotoad From 75987752437b63488cfe5c07c044ac19d16187e5 Mon Sep 17 00:00:00 2001 From: fuwa Date: Wed, 20 May 2020 19:44:45 +0800 Subject: [PATCH 19/19] fix build for non nix-shell --- etc/scripts/build-external-libs/boost/fetch.sh | 2 +- etc/scripts/build-external-libs/iconv/fetch.sh | 2 +- etc/scripts/build-external-libs/openssl/fetch.sh | 2 +- etc/scripts/build-external-libs/sodium/fetch.sh | 2 +- etc/scripts/build-external-libs/wownero/fetch.sh | 13 +++++++------ 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/etc/scripts/build-external-libs/boost/fetch.sh b/etc/scripts/build-external-libs/boost/fetch.sh index 24c9ea6..8a68690 100755 --- a/etc/scripts/build-external-libs/boost/fetch.sh +++ b/etc/scripts/build-external-libs/boost/fetch.sh @@ -44,7 +44,7 @@ out=${name}_${version}.tar.bz2 rm -rf ${name}_${version} -if [ -f $SRC_BOOST ]; then +if [ ! -z $SRC_BOOST ]; then echo "using pre-fetched $name" cp $SRC_BOOST $out else diff --git a/etc/scripts/build-external-libs/iconv/fetch.sh b/etc/scripts/build-external-libs/iconv/fetch.sh index 1ed1bc8..fe65176 100755 --- a/etc/scripts/build-external-libs/iconv/fetch.sh +++ b/etc/scripts/build-external-libs/iconv/fetch.sh @@ -43,7 +43,7 @@ out=${name}-${version}.tar.gz rm -rf ${name}-${version} -if [ -f $SRC_ICONV ]; then +if [ ! -z $SRC_ICONV ]; then echo "using pre-fetched $name" cp $SRC_ICONV $out else diff --git a/etc/scripts/build-external-libs/openssl/fetch.sh b/etc/scripts/build-external-libs/openssl/fetch.sh index bae8fb1..2584b9b 100755 --- a/etc/scripts/build-external-libs/openssl/fetch.sh +++ b/etc/scripts/build-external-libs/openssl/fetch.sh @@ -43,7 +43,7 @@ out=openssl-${version}.tar.gz rm -rf ${name}-${version} -if [ -f $SRC_OPENSSL ]; then +if [ ! -z $SRC_OPENSSL ]; then echo "using pre-fetched $name" cp $SRC_OPENSSL $out else diff --git a/etc/scripts/build-external-libs/sodium/fetch.sh b/etc/scripts/build-external-libs/sodium/fetch.sh index 10bcfff..b8402a9 100755 --- a/etc/scripts/build-external-libs/sodium/fetch.sh +++ b/etc/scripts/build-external-libs/sodium/fetch.sh @@ -43,7 +43,7 @@ out=${name}-${version}.tar.gz rm -rf ${name}-${version} -if [ -f $SRC_SODIUM ]; then +if [ ! -z $SRC_SODIUM ]; then echo "using pre-fetched $name" cp $SRC_SODIUM $out else diff --git a/etc/scripts/build-external-libs/wownero/fetch.sh b/etc/scripts/build-external-libs/wownero/fetch.sh index 24b78b0..bf0ad08 100755 --- a/etc/scripts/build-external-libs/wownero/fetch.sh +++ b/etc/scripts/build-external-libs/wownero/fetch.sh @@ -45,39 +45,40 @@ chmod u+w -f -R $out || true rm -rf $out -if [ -d $SRC_WOWNERO_DIR ]; then +if [ ! -z $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 + cd $name else git clone --depth 1 https://github.com/wownero/wownero.git -b $version + cd $name test `git rev-parse HEAD` = $githash || exit 1 fi -cd $name -if [ -d $SRC_MINIUPNP_DIR ]; then +if [ ! -z $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 +if [ ! -z $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 +if [ ! -z $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 -if [ -d $SRC_UNBOUND_DIR ]; then +if [ ! -z $SRC_UNBOUND_DIR ]; then echo "using pre-fetched unbound" rsync -av --no-perms --no-owner --no-group --delete $SRC_UNBOUND_DIR/* external/unbound else