From 93481fc543feec07b57fa1345f3488cf806bd3e2 Mon Sep 17 00:00:00 2001 From: fuwa Date: Thu, 20 Sep 2018 08:03:12 +0800 Subject: [PATCH] add libsodium include path --- script/build-external-libs/fetch-wownero.sh | 5 ++++- script/build-external-libs/patch-wownero.sh | 8 ++++++++ script/build-external-libs/wownero/build-all-arch.sh | 6 ++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/script/build-external-libs/fetch-wownero.sh b/script/build-external-libs/fetch-wownero.sh index 5f85cda..7569d9b 100755 --- a/script/build-external-libs/fetch-wownero.sh +++ b/script/build-external-libs/fetch-wownero.sh @@ -4,6 +4,8 @@ set -e source script/build-external-libs/env.sh +base_dir=`pwd` + cd $EXTERNAL_LIBS_BUILD_ROOT # version="v0.2.2.0" @@ -12,8 +14,9 @@ cd $EXTERNAL_LIBS_BUILD_ROOT # branch-release-v0.3.0.0 (ring size 22) # version="48bcb9" +# url="$base_dir/vendor/wownero" url="https://github.com/wowario/wownero" -version="3a8a8f" +version="3a8a8fb" rm -rf wownero git clone $url wownero diff --git a/script/build-external-libs/patch-wownero.sh b/script/build-external-libs/patch-wownero.sh index 5c5dc23..ff4ca25 100755 --- a/script/build-external-libs/patch-wownero.sh +++ b/script/build-external-libs/patch-wownero.sh @@ -16,3 +16,11 @@ 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 + +sodium_pattern="find_library(SODIUM_LIBRARY sodium)" +include_sodium='find_library(SODIUM_LIBRARY sodium)\ +\ +message(STATUS "Using SODIUM include dir at ${LIBSODIUM_INCLUDE_DIR}")\ +include_directories(${LIBSODIUM_INCLUDE_DIR})' + +sed -i "s/${sodium_pattern}/${include_sodium}/g" CMakeLists.txt diff --git a/script/build-external-libs/wownero/build-all-arch.sh b/script/build-external-libs/wownero/build-all-arch.sh index 6701615..92f600e 100755 --- a/script/build-external-libs/wownero/build-all-arch.sh +++ b/script/build-external-libs/wownero/build-all-arch.sh @@ -46,10 +46,11 @@ for arch in ${archs[@]}; do mkdir -p $OUTPUT_DIR cd $OUTPUT_DIR + # CMAKE_INCLUDE_PATH=$build_root/build/libsodium/$arch/include \ + PATH=$build_root/tool/$arch/$target_host/bin:$build_root/tool/$arch/bin:$PATH \ CC=clang CXX=clang++ \ - # CMAKE_INCLUDE_PATH=$build_root/build/libsodium/$arch/include \ - # CMAKE_LIBRARY_PATH=$build_root/build/libsodium/$arch/lib \ + CMAKE_LIBRARY_PATH=$build_root/build/libsodium/$arch/lib \ cmake \ -D ANDROID=true \ -D ARCH="$xarch" \ @@ -66,6 +67,7 @@ for arch in ${archs[@]}; do -D OPENSSL_INCLUDE_DIR=$build_root/build/openssl/$arch/include \ -D OPENSSL_ROOT_DIR=$build_root/build/openssl/$arch \ -D OPENSSL_SSL_LIBRARY=$build_root/build/openssl/$arch/lib/libssl.so \ + -D LIBSODIUM_INCLUDE_DIR=$build_root/build/libsodium/$arch/include \ -D STATIC=ON \ $extra_cmake_flags \ ../..