diff --git a/script/build-external-libs/pre-build-wownero.sh b/script/build-external-libs/fetch-wownero.sh similarity index 67% rename from script/build-external-libs/pre-build-wownero.sh rename to script/build-external-libs/fetch-wownero.sh index 41903be..d32aa6a 100755 --- a/script/build-external-libs/pre-build-wownero.sh +++ b/script/build-external-libs/fetch-wownero.sh @@ -6,11 +6,10 @@ source script/build-external-libs/env.sh cd $EXTERNAL_LIBS_BUILD_ROOT -# version="618dea" -version="326cde" +version="d4ee3c3" rm -rf wownero -git clone -b mobile https://github.com/fuwa0529/wownero +git clone https://github.com/wownero/wownero cd wownero git checkout $version diff --git a/script/build-external-libs/patch-wownero.sh b/script/build-external-libs/patch-wownero.sh new file mode 100755 index 0000000..5c5dc23 --- /dev/null +++ b/script/build-external-libs/patch-wownero.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -e + +source script/build-external-libs/env.sh + +cp script/build-external-libs/wownero/build-all-arch.sh $EXTERNAL_LIBS_BUILD_ROOT/wownero + +cd $EXTERNAL_LIBS_BUILD_ROOT +cd wownero + +sed -i 's/-Werror/-Wall/g' CMakeLists.txt +sed -i 's/program_options locale/program_options/g' CMakeLists.txt +sed -i 's/find_path(ZMQ_INCLUDE_PATH zmq.hpp)//g' CMakeLists.txt +sed -i 's/find_library(ZMQ_LIB zmq)//g' CMakeLists.txt +sed -i 's/message(FATAL_ERROR "Could not find required header zmq.hpp")//g' CMakeLists.txt +sed -i 's/message(FATAL_ERROR "Could not find required libzmq")//g' CMakeLists.txt +sed -i 's/bool create_address_file = false/bool create_address_file = true/g' src/wallet/wallet2.h diff --git a/script/build-external-libs/wownero/build-all-arch.sh b/script/build-external-libs/wownero/build-all-arch.sh new file mode 100755 index 0000000..236c3fb --- /dev/null +++ b/script/build-external-libs/wownero/build-all-arch.sh @@ -0,0 +1,73 @@ +#!/bin/bash +# +# -D BOOST_ROOT=$build_root/boost_1_58_0 + +set -e + +orig_path=$PATH +base_dir=`pwd` +build_root=$EXTERNAL_LIBS_BUILD_ROOT + +build_type=release # or debug + +archs=(arm arm64 x86 x86_64) + +for arch in ${archs[@]}; do + ldflags="" + case ${arch} in + "arm") + target_host=arm-linux-androideabi + ldflags="-march=armv7-a -Wl,--fix-cortex-a8" + xarch=armv7-a + sixtyfour=OFF + ;; + "arm64") + target_host=aarch64-linux-android + xarch="armv8-a" + sixtyfour=ON + ;; + "x86") + target_host=i686-linux-android + xarch="i686" + ;; + "x86_64") + target_host=x86_64-linux-android + xarch="x86-64" + sixtyfour=ON + ;; + *) + exit 16 + ;; + esac + + OUTPUT_DIR=$base_dir/build/$build_type.$arch + + mkdir -p $OUTPUT_DIR + cd $OUTPUT_DIR + + PATH=$build_root/tool/$arch/$target_host/bin:$build_root/tool/$arch/bin:$PATH \ + CC=clang CXX=clang++ cmake -D \ + BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH="$xarch" -D STATIC=ON -D BUILD_64=$sixtyfour -D \ + CMAKE_BUILD_TYPE=$build_type -D ANDROID=true -D BUILD_TAG="android" -D \ + BOOST_ROOT=$build_root/build/boost/$arch -D BOOST_LIBRARYDIR=$build_root/build/boost/$arch/lib -D \ + OPENSSL_ROOT_DIR=$build_root/build/openssl/$arch -D \ + OPENSSL_INCLUDE_DIR=$build_root/build/openssl/$arch/include -D \ + OPENSSL_CRYPTO_LIBRARY=$build_root/build/openssl/$arch/lib/libcrypto.so -D \ + OPENSSL_SSL_LIBRARY=$build_root/build/openssl/$arch/lib/libssl.so -D \ + CMAKE_POSITION_INDEPENDENT_CODE:BOOL=true ../.. + make -j4 wallet_api + find . -path ./lib -prune -o -name '*.a' -exec cp '{}' lib \; + + TARGET_LIB_DIR=$build_root/build/monero/$arch/lib + rm -rf $TARGET_LIB_DIR + mkdir -p $TARGET_LIB_DIR + cp $OUTPUT_DIR/lib/*.a $TARGET_LIB_DIR + + TARGET_INC_DIR=$build_root/build/monero/include + rm -rf $TARGET_INC_DIR + mkdir -p $TARGET_INC_DIR + cp -a ../../src/wallet/api/wallet2_api.h $TARGET_INC_DIR + + cd $base_dir +done +exit 0