From 8919fdc4d29be71d1ad17feebbc6297291aff60c Mon Sep 17 00:00:00 2001 From: M Date: Tue, 9 Aug 2022 17:31:33 +0100 Subject: [PATCH] Update OpenSSL, add unbound for android build scripts --- scripts/android/build_monero.sh | 2 +- scripts/android/build_monero_all.sh | 1 + scripts/android/build_openssl.sh | 9 ++-- scripts/android/build_unbound.sh | 65 +++++++++++++++++++++++++++++ 4 files changed, 71 insertions(+), 6 deletions(-) create mode 100755 scripts/android/build_unbound.sh diff --git a/scripts/android/build_monero.sh b/scripts/android/build_monero.sh index 5634aa20a..a88f589ec 100755 --- a/scripts/android/build_monero.sh +++ b/scripts/android/build_monero.sh @@ -1,7 +1,7 @@ #!/bin/sh . ./config.sh -MONERO_BRANCH=release-v0.17.3.2-android +MONERO_BRANCH=release-v0.18.0.0-android MONERO_SRC_DIR=${WORKDIR}/monero git clone https://github.com/cake-tech/monero.git ${MONERO_SRC_DIR} --branch ${MONERO_BRANCH} diff --git a/scripts/android/build_monero_all.sh b/scripts/android/build_monero_all.sh index 917c71e23..69ec37b5f 100755 --- a/scripts/android/build_monero_all.sh +++ b/scripts/android/build_monero_all.sh @@ -4,5 +4,6 @@ ./build_boost.sh ./build_openssl.sh ./build_sodium.sh +./build_unbound.sh ./build_zmq.sh ./build_monero.sh diff --git a/scripts/android/build_openssl.sh b/scripts/android/build_openssl.sh index c5dad3d41..aa668e6bf 100755 --- a/scripts/android/build_openssl.sh +++ b/scripts/android/build_openssl.sh @@ -3,10 +3,10 @@ set -e . ./config.sh -OPENSSL_FILENAME=openssl-1.1.1k.tar.gz +OPENSSL_FILENAME=openssl-1.1.1q.tar.gz OPENSSL_FILE_PATH=$WORKDIR/$OPENSSL_FILENAME -OPENSSL_SRC_DIR=$WORKDIR/openssl-1.1.1k -OPENSSL_SHA256="892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5" +OPENSSL_SRC_DIR=$WORKDIR/openssl-1.1.1q +OPENSSL_SHA256="d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca" ZLIB_DIR=$WORKDIR/zlib ZLIB_TAG=v1.2.11 ZLIB_COMMIT_HASH="cacf7f1d4e3d44d871b605da3b647f07d718623f" @@ -40,10 +40,9 @@ rm -rf $OPENSSL_SRC_DIR tar -xzf $OPENSSL_FILE_PATH -C $WORKDIR cd $OPENSSL_SRC_DIR -sed -i -e "s/mandroid/target\ ${TARGET}\-linux\-android/" Configure CC=clang ANDROID_NDK=$TOOLCHAIN \ ./Configure ${X_ARCH} \ - no-asm no-shared \ + no-shared no-tests \ --with-zlib-include=${PREFIX}/include \ --with-zlib-lib=${PREFIX}/lib \ --prefix=${PREFIX} \ diff --git a/scripts/android/build_unbound.sh b/scripts/android/build_unbound.sh new file mode 100755 index 000000000..8786b0f2b --- /dev/null +++ b/scripts/android/build_unbound.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +. ./config.sh + +EXPAT_VERSION=R_2_4_8 +EXPAT_HASH="3bab6c09bbe8bf42d84b81563ddbcf4cca4be838" +EXPAT_SRC_DIR=$WORKDIR/libexpat + +for arch in "aarch" "aarch64" "i686" "x86_64" +do +PREFIX=$WORKDIR/prefix_${arch} +TOOLCHAIN=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64 +PATH="${TOOLCHAIN_BASE_DIR}_${arch}/bin:${ORIGINAL_PATH}" + +cd $WORKDIR +rm -rf $EXPAT_SRC_DIR +git clone https://github.com/libexpat/libexpat.git -b ${EXPAT_VERSION} ${EXPAT_SRC_DIR} +cd $EXPAT_SRC_DIR +test `git rev-parse HEAD` = ${EXPAT_HASH} || exit 1 +cd $EXPAT_SRC_DIR/expat + +case $arch in + "aarch") HOST="arm-linux-androideabi";; + "i686") HOST="x86-linux-android";; + *) HOST="${arch}-linux-android";; +esac + +./buildconf.sh +CC=clang CXX=clang++ ./configure --enable-static --disable-shared --prefix=${PREFIX} --host=${HOST} +make -j$THREADS +make -j$THREADS install +done + +UNBOUND_VERSION=release-1.16.2 +UNBOUND_HASH="cbed768b8ff9bfcf11089a5f1699b7e5707f1ea5" +UNBOUND_SRC_DIR=$WORKDIR/unbound-1.16.2 + +for arch in "aarch" "aarch64" "i686" "x86_64" +do +PREFIX=$WORKDIR/prefix_${arch} +TOOLCHAIN=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64 + +case $arch in + "aarch") TOOLCHAIN_BIN_PATH=${TOOLCHAIN_BASE_DIR}_${arch}/arm-linux-androideabi/bin;; + *) TOOLCHAIN_BIN_PATH=${TOOLCHAIN_BASE_DIR}_${arch}/${arch}-linux-android/bin;; +esac + +PATH="${TOOLCHAIN_BIN_PATH}:${TOOLCHAIN_BASE_DIR}_${arch}/bin:${ORIGINAL_PATH}" +echo $PATH +cd $WORKDIR +rm -rf $UNBOUND_SRC_DIR +git clone https://github.com/NLnetLabs/unbound.git -b ${UNBOUND_VERSION} ${UNBOUND_SRC_DIR} +cd $UNBOUND_SRC_DIR +test `git rev-parse HEAD` = ${UNBOUND_HASH} || exit 1 + +case $arch in + "aarch") HOST="arm-linux-androideabi";; + "i686") HOST="x86-linux-android";; + *) HOST="${arch}-linux-android";; +esac + +CC=clang CXX=clang++ ./configure --prefix=${PREFIX} --host=${HOST} --enable-static --disable-shared --disable-flto --with-ssl=${PREFIX} --with-libexpat=${PREFIX} +make -j$THREADS +make -j$THREADS install +done