diff --git a/Makefile b/Makefile index e4c08c0..9eb1cbe 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2019, The Wownero Project +# Copyright (c) 2019, The Lolnero Project # # All rights reserved. # @@ -30,47 +30,47 @@ .PHONY: toolchain clean clean: - -rm -f ./cyberwow/android/app/src/main/jniLibs/arm64-v8a/*.so - cd cyberwow && \ + -rm -f ./lolnode/android/app/src/main/jniLibs/arm64-v8a/*.so + cd lolnode && \ flutter clean watch: - find cyberwow/lib/ -name '*.dart' | \ + find lolnode/lib/ -name '*.dart' | \ entr kill -USR1 `cat /tmp/flutter.pid` watch-build: - find cyberwow/lib/ -name '*.dart' | \ + find lolnode/lib/ -name '*.dart' | \ entr $(MAKE) build-debug run: - cd cyberwow && \ + cd lolnode && \ flutter run --debug --pid-file /tmp/flutter.pid run-release: - cd cyberwow && \ + cd lolnode && \ flutter run --release --pid-file /tmp/flutter.pid build: - cd cyberwow && \ + cd lolnode && \ flutter build apk --target-platform android-arm64 build-bundle: - cd cyberwow && \ + cd lolnode && \ flutter build appbundle --target-platform android-arm64 build-debug: - cd cyberwow && \ + cd lolnode && \ flutter build appbundle --debug --target-platform android-arm64 install: build - cd cyberwow && \ + cd lolnode && \ flutter install -# build wownero android binary +# build lolnero android binary script := etc/scripts/build-external-libs -wow: clean-external-libs collect-wownero build +lol: clean-external-libs collect-lolnero build clean-external-libs: $(script)/clean.sh @@ -94,15 +94,19 @@ sodium: toolchain $(script)/sodium/fetch.sh $(script)/sodium/build.sh -toolchain-wow: - $(script)/toolchain-wow/import.sh - $(script)/toolchain-wow/patch.sh +toolchain-lol: + $(script)/toolchain-lol/import.sh + $(script)/toolchain-lol/patch.sh -wownero: openssl boost sodium toolchain-wow - $(script)/wownero/fetch.sh - $(script)/wownero/build.sh +lolnero: openssl boost sodium toolchain-lol + $(script)/lolnero/fetch.sh + $(script)/lolnero/build.sh -collect-wownero: wownero +lolnero-raw: + $(script)/lolnero/fetch.sh + $(script)/lolnero/build.sh + +collect-lolnero: lolnero $(script)/collect.sh # etc diff --git a/etc/nix/shell.nix b/etc/nix/shell.nix index 9d10304..d06f946 100644 --- a/etc/nix/shell.nix +++ b/etc/nix/shell.nix @@ -46,10 +46,20 @@ let xkeyboard_config ] -; ndk-r17c = (nixpkgs.androidenv.composeAndroidPackages - { - ndkVersion = "17.2.4988734" - ; }).ndk-bundle +# ; ndk-r17c = (nixpkgs.androidenv.composeAndroidPackages +# { +# ndkVersion = "17.2.4988734" +# ; }).ndk-bundle + +; ndk-r17c = + let + version = "r17c" + ; in + nixpkgs.fetchzip + { + url = "https://dl.google.com/android/repository/android-ndk-${version}-linux-x86_64.zip" + ; sha256 = "02q1hy423syl868jdyaxjm44hn59cmni5019r811vinagvq3m7qi" + ; } ; ndk-r21b = let @@ -121,7 +131,7 @@ let with nixpkgs; (buildFHSUserEnv { - name = "cyberwow-env" + name = "lolnode-env" ; targetPkgs = pkgs: (with pkgs; [ bash @@ -155,6 +165,8 @@ with nixpkgs; pkgconfig cmake ccache + + python2 ] ++ android-studio-deps ) @@ -181,7 +193,7 @@ with nixpkgs; export SRC_BOOST=${boost-source} export SRC_SODIUM=${sodium-source} export SRC_RAPIDJSON_DIR=${nixpkgs.rapidjson.src} - export SRC_WOWNERO_DIR=${lolnero-source} + export SRC_LOLNERO_DIR=${lolnero-source} export PATH_NCURSES=${nixpkgs.ncurses5} export PATH @@ -189,8 +201,8 @@ with nixpkgs; export _JAVA_AWT_WM_NONREPARENTING=1 export DART_VM_OPTIONS=--root-certs-file=/etc/ssl/certs/ca-certificates.crt - export ANDROID_NDK_VERSION_WOW=r17c - export ANDROID_NDK_ROOT_WOW=${ndk-r17c}/libexec/android-sdk/ndk-bundle + export ANDROID_NDK_VERSION_LOL=r17c + export ANDROID_NDK_ROOT_LOL=${ndk-r17c} 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/collect.sh b/etc/scripts/build-external-libs/collect.sh index 9502e9f..327790f 100755 --- a/etc/scripts/build-external-libs/collect.sh +++ b/etc/scripts/build-external-libs/collect.sh @@ -37,7 +37,7 @@ src_root=$BUILD_ROOT_SRC build_root=$BUILD_ROOT target_root=`pwd` -name=wownero +name=lolnero cd $src_root/${name} @@ -61,9 +61,9 @@ for arch in ${archs[@]}; do esac 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 + mkdir -p $target_root/lolnode/android/app/src/main/jniLibs/$target_abi + cp build/release/bin/lolnerod \ + $target_root/lolnode/android/app/src/main/jniLibs/$target_abi/liblolnerod.so done diff --git a/etc/scripts/build-external-libs/env.sh b/etc/scripts/build-external-libs/env.sh index 0fee5fa..252aa62 100644 --- a/etc/scripts/build-external-libs/env.sh +++ b/etc/scripts/build-external-libs/env.sh @@ -29,14 +29,14 @@ # 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. -DEFAULT_ANDROID_NDK_ROOT=~/SDK/Android/ndk-archive/android-ndk-r20 +DEFAULT_ANDROID_NDK_ROOT=~/SDK/Android/ndk-archive/android-ndk-r21b ANDROID_NDK_ROOT="${ANDROID_NDK_ROOT:-${DEFAULT_ANDROID_NDK_ROOT}}" export ANDROID_NDK_ROOT=`realpath $ANDROID_NDK_ROOT` -DEFAULT_ANDROID_NDK_VERSION=r20 +DEFAULT_ANDROID_NDK_VERSION=r21b ANDROID_NDK_VERSION="${ANDROID_NDK_VERSION:-${DEFAULT_ANDROID_NDK_VERSION}}" -BUILD_PATH=../cyberwow-build +BUILD_PATH=../lolnode-build DEFAULT_BUILD_ROOT=${BUILD_PATH}/$ANDROID_NDK_VERSION BUILD_ROOT="${BUILD_ROOT:-${DEFAULT_BUILD_ROOT}}" @@ -50,18 +50,18 @@ NPROC="${NPROC:-${DEFAULT_NPROC}}" export NPROC -# wownero can only be built with ndk-r17c +# can only be built with ndk-r17c -DEFAULT_ANDROID_NDK_VERSION_WOW=r17c -ANDROID_NDK_VERSION_WOW="${ANDROID_NDK_VERSION_WOW:-${DEFAULT_ANDROID_NDK_VERSION_WOW}}" +DEFAULT_ANDROID_NDK_VERSION_LOL=r17c +ANDROID_NDK_VERSION_LOL="${ANDROID_NDK_VERSION_LOL:-${DEFAULT_ANDROID_NDK_VERSION_LOL}}" -DEFAULT_ANDROID_NDK_ROOT_WOW=$ANDROID_NDK_ROOT/../$ANDROID_NDK_VERSION_WOW -ANDROID_NDK_ROOT_WOW="${ANDROID_NDK_ROOT_WOW:-${DEFAULT_ANDROID_NDK_ROOT_WOW}}" -export ANDROID_NDK_ROOT_WOW=`realpath $ANDROID_NDK_ROOT_WOW` +DEFAULT_ANDROID_NDK_ROOT_LOL=$ANDROID_NDK_ROOT/../$ANDROID_NDK_VERSION_LOL +ANDROID_NDK_ROOT_LOL="${ANDROID_NDK_ROOT_LOL:-${DEFAULT_ANDROID_NDK_ROOT_LOL}}" +export ANDROID_NDK_ROOT_LOL=`realpath $ANDROID_NDK_ROOT_LOL` -DEFAULT_BUILD_ROOT_WOW=${BUILD_PATH}/$ANDROID_NDK_VERSION_WOW -BUILD_ROOT_WOW="${BUILD_ROOT_WOW:-${DEFAULT_BUILD_ROOT_WOW}}" -export BUILD_ROOT_WOW=`realpath $BUILD_ROOT_WOW` +DEFAULT_BUILD_ROOT_LOL=${BUILD_PATH}/$ANDROID_NDK_VERSION_LOL +BUILD_ROOT_LOL="${BUILD_ROOT_LOL:-${DEFAULT_BUILD_ROOT_LOL}}" +export BUILD_ROOT_LOL=`realpath $BUILD_ROOT_LOL` diff --git a/etc/scripts/build-external-libs/wownero/build.sh b/etc/scripts/build-external-libs/lolnero/build.sh similarity index 96% rename from etc/scripts/build-external-libs/wownero/build.sh rename to etc/scripts/build-external-libs/lolnero/build.sh index 86226f3..87782ab 100755 --- a/etc/scripts/build-external-libs/wownero/build.sh +++ b/etc/scripts/build-external-libs/lolnero/build.sh @@ -36,9 +36,9 @@ source etc/scripts/build-external-libs/env.sh build_root=$BUILD_ROOT src_root=$BUILD_ROOT_SRC -build_root_wow=$BUILD_ROOT_WOW +build_root_lol=$BUILD_ROOT_LOL -name=wownero +name=lolnero cd $src_root/${name} @@ -69,7 +69,7 @@ for arch in ${archs[@]}; do ln -s $PATH_NCURSES/lib/libncursesw.so.5 $PREFIX/dlib/libtinfo.so.5 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PREFIX/dlib - export TOOLCHAIN_DIR=`realpath $build_root_wow/tool/${arch}` + export TOOLCHAIN_DIR=`realpath $build_root_lol/tool/${arch}` export PATH=$PATH:$build_root/host/bin mkdir -p build/release diff --git a/etc/scripts/build-external-libs/wownero/fetch.sh b/etc/scripts/build-external-libs/lolnero/fetch.sh similarity index 91% rename from etc/scripts/build-external-libs/wownero/fetch.sh rename to etc/scripts/build-external-libs/lolnero/fetch.sh index 2bf3a8b..443f9a7 100755 --- a/etc/scripts/build-external-libs/wownero/fetch.sh +++ b/etc/scripts/build-external-libs/lolnero/fetch.sh @@ -35,23 +35,23 @@ source etc/scripts/build-external-libs/env.sh cd $BUILD_ROOT_SRC -name=wownero -version=v0.8.0.0 +name=lolnero +version=v0.5.0.0 # version=dev-v0.8 githash=1271a7e3a97c0d81816b401627aefb6c6697d0b3 -out=wownero +out=lolnero chmod u+w -f -R $out || true rm -rf $out -if [ ! -z $SRC_WOWNERO_DIR ]; then +if [ ! -z $SRC_LOLNERO_DIR ]; then echo "using pre-fetched $name" - rsync -av --no-perms --no-owner --no-group --delete $SRC_WOWNERO_DIR/* $out + rsync -av --no-perms --no-owner --no-group --delete $SRC_LOLNERO_DIR/* $out chmod u+w -R $out/external cd $name else - git clone --depth 1 https://github.com/wownero/wownero.git -b $version + git clone --depth 1 https://gitlab.com/fuwa/lolnero.git -b $version cd $name test `git rev-parse HEAD` = $githash || exit 1 fi diff --git a/etc/scripts/build-external-libs/toolchain-wow/import.sh b/etc/scripts/build-external-libs/toolchain-lol/import.sh similarity index 78% rename from etc/scripts/build-external-libs/toolchain-wow/import.sh rename to etc/scripts/build-external-libs/toolchain-lol/import.sh index 6e11ea2..c33a7b8 100755 --- a/etc/scripts/build-external-libs/toolchain-wow/import.sh +++ b/etc/scripts/build-external-libs/toolchain-lol/import.sh @@ -30,20 +30,31 @@ # 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_WOW -PATH=$ANDROID_NDK_ROOT_WOW/build/tools/:$PATH + +build_root=$BUILD_ROOT_LOL +# PATH=$ANDROID_NDK_ROOT_LOL/build/tools/:$PATH + +mkdir -p $build_root +ndk_mirror=$build_root/mirror +cp -vr $ANDROID_NDK_ROOT_LOL/ $ndk_mirror +chmod u+w -R $ndk_mirror args="--api 23 --stl=libc++" + archs=(arm64) for arch in ${archs[@]}; do + bin=$ndk_mirror/build/tools/make_standalone_toolchain.py - if [ ! -d "$build_root/tool/$arch" ]; then + out=$build_root/tool/$arch + echo "installing toolchain for ${arch} into $out" + + if [ ! -d "$out" ]; then echo "installing $arch" - make_standalone_toolchain.py $args --arch $arch --install-dir $build_root/tool/$arch + echo $bin $args --arch $arch --install-dir $out + $bin $args --arch $arch --install-dir $out fi done diff --git a/etc/scripts/build-external-libs/toolchain-wow/patch.sh b/etc/scripts/build-external-libs/toolchain-lol/patch.sh similarity index 96% rename from etc/scripts/build-external-libs/toolchain-wow/patch.sh rename to etc/scripts/build-external-libs/toolchain-lol/patch.sh index 37ae12d..aa72e85 100755 --- a/etc/scripts/build-external-libs/toolchain-wow/patch.sh +++ b/etc/scripts/build-external-libs/toolchain-lol/patch.sh @@ -33,8 +33,8 @@ set -e source etc/scripts/build-external-libs/env.sh -build_root=$BUILD_ROOT_WOW -PATH=$ANDROID_NDK_ROOT_WOW/build/tools/:$PATH +build_root=$BUILD_ROOT_LOL +PATH=$ANDROID_NDK_ROOT_LOL/build/tools/:$PATH archs=(arm64) diff --git a/etc/scripts/build-external-libs/toolchain/import.sh b/etc/scripts/build-external-libs/toolchain/import.sh index 76634aa..061807a 100755 --- a/etc/scripts/build-external-libs/toolchain/import.sh +++ b/etc/scripts/build-external-libs/toolchain/import.sh @@ -40,10 +40,14 @@ args="--api 29 --stl=libc++" archs=(arm64) for arch in ${archs[@]}; do + bin=$ANDROID_NDK_ROOT/build/tools/make_standalone_toolchain.py - if [ ! -d "$build_root/tool/$arch" ]; then + out=$build_root/tool/$arch + echo "installing toolchain for ${arch} into $out" + + if [ ! -d "$out" ]; then echo "installing $arch" - make_standalone_toolchain.py $args --arch $arch --install-dir $build_root/tool/$arch + $bin $args --arch $arch --install-dir $out fi done