From 8cd8d44497f5c8bc92fc67aa4b2e981b802f82b4 Mon Sep 17 00:00:00 2001 From: fuwa Date: Wed, 28 Aug 2019 12:28:55 +0000 Subject: [PATCH] add build scripts for fdroid --- Makefile | 92 ++++++++++++++++ cyberwow/android/app/build.gradle | 6 ++ etc/nix/fdroid.nix | 37 +++++++ etc/nix/shell.nix | 27 +++-- .../build-external-libs/boost/build.sh | 102 ++++++++++++++++++ .../build-external-libs/boost/fetch.sh | 50 +++++++++ etc/scripts/build-external-libs/clean.sh | 41 +++++++ .../build-external-libs/collect-fake.sh | 45 ++++++++ etc/scripts/build-external-libs/collect.sh | 70 ++++++++++++ .../build-external-libs/cppzmq/build.sh | 69 ++++++++++++ .../build-external-libs/cppzmq/fetch.sh | 46 ++++++++ etc/scripts/build-external-libs/env.sh | 65 +++++++++++ .../build-external-libs/iconv/build.sh | 80 ++++++++++++++ .../build-external-libs/iconv/fetch.sh | 49 +++++++++ .../build-external-libs/openssl/build.sh | 88 +++++++++++++++ .../build-external-libs/openssl/fetch.sh | 50 +++++++++ .../build-external-libs/sodium/build.sh | 82 ++++++++++++++ .../build-external-libs/sodium/fetch.sh | 47 ++++++++ .../toolchain-wow/import.sh | 49 +++++++++ .../toolchain-wow/patch.sh | 45 ++++++++ .../build-external-libs/toolchain/import.sh | 51 +++++++++ .../build-external-libs/use-archive.sh | 42 ++++++++ .../build-external-libs/wownero/build.sh | 85 +++++++++++++++ .../build-external-libs/wownero/fetch.sh | 50 +++++++++ .../build-external-libs/zeromq/build.sh | 81 ++++++++++++++ .../build-external-libs/zeromq/fetch.sh | 46 ++++++++ etc/scripts/build-external-libs/zlib/build.sh | 79 ++++++++++++++ etc/scripts/build-external-libs/zlib/fetch.sh | 49 +++++++++ etc/scripts/build-wownero.sh | 29 +++++ 29 files changed, 1646 insertions(+), 6 deletions(-) create mode 100644 etc/nix/fdroid.nix create mode 100755 etc/scripts/build-external-libs/boost/build.sh create mode 100755 etc/scripts/build-external-libs/boost/fetch.sh create mode 100755 etc/scripts/build-external-libs/clean.sh create mode 100755 etc/scripts/build-external-libs/collect-fake.sh create mode 100755 etc/scripts/build-external-libs/collect.sh create mode 100755 etc/scripts/build-external-libs/cppzmq/build.sh create mode 100755 etc/scripts/build-external-libs/cppzmq/fetch.sh create mode 100644 etc/scripts/build-external-libs/env.sh create mode 100755 etc/scripts/build-external-libs/iconv/build.sh create mode 100755 etc/scripts/build-external-libs/iconv/fetch.sh create mode 100755 etc/scripts/build-external-libs/openssl/build.sh create mode 100755 etc/scripts/build-external-libs/openssl/fetch.sh create mode 100755 etc/scripts/build-external-libs/sodium/build.sh create mode 100755 etc/scripts/build-external-libs/sodium/fetch.sh create mode 100755 etc/scripts/build-external-libs/toolchain-wow/import.sh create mode 100755 etc/scripts/build-external-libs/toolchain-wow/patch.sh create mode 100755 etc/scripts/build-external-libs/toolchain/import.sh create mode 100755 etc/scripts/build-external-libs/use-archive.sh create mode 100755 etc/scripts/build-external-libs/wownero/build.sh create mode 100755 etc/scripts/build-external-libs/wownero/fetch.sh create mode 100755 etc/scripts/build-external-libs/zeromq/build.sh create mode 100755 etc/scripts/build-external-libs/zeromq/fetch.sh create mode 100755 etc/scripts/build-external-libs/zlib/build.sh create mode 100755 etc/scripts/build-external-libs/zlib/fetch.sh diff --git a/Makefile b/Makefile index c48be1a..6268fd8 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,33 @@ +# Copyright (c) 2019, 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. + + +.PHONY: toolchain watch: find cyberwow/lib/ -name '*.dart' | \ @@ -29,3 +59,65 @@ collect: build: cd cyberwow && \ flutter build apk --target-platform android-arm64 + + +# build wownero android binary + +script := etc/scripts/build-external-libs + +wow: clean-external-libs collect-wownero build + +wow-fake: clean-external-libs collect-wownero-fake build + +clean-external-libs: + $(script)/clean.sh + +toolchain: + $(script)/toolchain/import.sh + +iconv: toolchain + $(script)/iconv/fetch.sh + $(script)/iconv/build.sh + +boost: iconv + $(script)/boost/fetch.sh + $(script)/boost/build.sh + +zlib: toolchain + $(script)/zlib/fetch.sh + $(script)/zlib/build.sh + +openssl: zlib + $(script)/openssl/fetch.sh + $(script)/openssl/build.sh + +zeromq: toolchain + $(script)/zeromq/fetch.sh + $(script)/zeromq/build.sh + +cppzmq: + $(script)/cppzmq/fetch.sh + $(script)/cppzmq/build.sh + +sodium: toolchain + $(script)/sodium/fetch.sh + $(script)/sodium/build.sh + +toolchain-wow: + $(script)/toolchain-wow/import.sh + $(script)/toolchain-wow/patch.sh + +cmake: + $(script)/cmake/fetch.sh + $(script)/cmake/install.sh + +wownero: openssl boost zeromq cppzmq sodium toolchain-wow + $(script)/wownero/fetch.sh + $(script)/wownero/build.sh + +collect-wownero: wownero + $(script)/collect.sh + +collect-wownero-fake: + $(script)/collect-fake.sh + diff --git a/cyberwow/android/app/build.gradle b/cyberwow/android/app/build.gradle index c11e5e9..d5f8198 100644 --- a/cyberwow/android/app/build.gradle +++ b/cyberwow/android/app/build.gradle @@ -64,6 +64,12 @@ android { } } } + + applicationVariants.all { + variant -> variant.outputs.all { + output -> outputFileName = "app-${output.baseName}.apk" + } + } } flutter { diff --git a/etc/nix/fdroid.nix b/etc/nix/fdroid.nix new file mode 100644 index 0000000..291c92c --- /dev/null +++ b/etc/nix/fdroid.nix @@ -0,0 +1,37 @@ +{ pkgs ? import {} }: + +with pkgs; + +# fdroid vm might require a manual enabling of "I/O APIC" + +let + + fdroid-python-packages = python-packages: with python-packages; [ + androguard + clint + defusedxml + GitPython + libcloud + mwclient + paramiko + pillow + pyasn1 + pyasn1-modules + python-vagrant + pyyaml + qrcode + requests + ruamel_yaml + ] + +; python-with-fdroid-packages = pkgs.python3.withPackages fdroid-python-packages + +; in + +mkShell +{ + buildInputs = + [ + python-with-fdroid-packages + ] +; } diff --git a/etc/nix/shell.nix b/etc/nix/shell.nix index ef8c156..f6032bb 100644 --- a/etc/nix/shell.nix +++ b/etc/nix/shell.nix @@ -1,7 +1,4 @@ let -# moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz) -# # ; nixpkgs = import { overlays = [ moz_overlay ]; } - nixpkgs = import {} ; android-studio-deps = with nixpkgs; @@ -34,7 +31,6 @@ let unzip which xkeyboard_config - zlib ] ; in @@ -60,31 +56,50 @@ with nixpkgs; jdk # dart_dev gnumake + # gcc entr androidenv.androidPkgs_9_0.platform-tools + + + zlib + ncurses + # gcc + libtool + autoconf + automake + gnum4 + pkgconfig + cmake ] - # ++ android-studio-deps + ++ android-studio-deps ) ; multiPkgs = pkgs: (with pkgs; [ ]) + ; profile = '' export ANDROID_HOME=~/SDK/Android/Sdk PATH=~/scm/flutter/vendor/flutter/bin:$PATH PATH=~/SDK/Android/android-studio/bin:$PATH - export ANDROID_NDK_ROOT=~/SDK/Android/ndk-archive/android-ndk-r20 + export ANDROID_NDK_VERSION=r20 + 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 + export PATH_NCURSES=${nixpkgs.ncurses5} export PATH 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=~/SDK/Android/ndk-archive/android-ndk-$ANDROID_NDK_VERSION_WOW + exec zsh '' diff --git a/etc/scripts/build-external-libs/boost/build.sh b/etc/scripts/build-external-libs/boost/build.sh new file mode 100755 index 0000000..60304f9 --- /dev/null +++ b/etc/scripts/build-external-libs/boost/build.sh @@ -0,0 +1,102 @@ +#!/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=boost +version=1_68_0 + +cd $src_root/${name}_${version} + +./bootstrap.sh + +archs=(arm64) +for arch in ${archs[@]}; do + extra_cmake_flags="" + case ${arch} in + "arm") + target_host=arm-linux-androideabi + ;; + "arm64") + target_host=aarch64-linux-android + ;; + "x86_64") + target_host=x86_64-linux-android + ;; + *) + exit 16 + ;; + esac + + # ICONV_PATH=$build_root/build/libiconv/$arch + ICONV_PATH=$build_root/build/$arch + + # PREFIX=$build_root/build/${name}/$arch + PREFIX=$build_root/build/$arch + echo "building for ${arch}" + + ( + PATH=$build_root/tool/$arch/$target_host/bin:$build_root/tool/$arch/bin:$PATH \ + CC=clang \ + CXX=clang++; \ + ./b2 \ + --prefix=${PREFIX} \ + --build-type=minimal \ + link=static \ + runtime-link=static \ + --with-chrono \ + --with-date_time \ + --with-filesystem \ + --with-program_options \ + --with-regex \ + --with-serialization \ + --with-system \ + --with-thread \ + --with-locale \ + --build-dir=android \ + --stagedir=android \ + toolset=clang \ + threading=multi \ + threadapi=pthread \ + target-os=android \ + -sICONV_PATH=${ICONV_PATH} \ + install \ + -j${NPROC} \ + ) + +done + +exit 0 diff --git a/etc/scripts/build-external-libs/boost/fetch.sh b/etc/scripts/build-external-libs/boost/fetch.sh new file mode 100755 index 0000000..f2cccec --- /dev/null +++ b/etc/scripts/build-external-libs/boost/fetch.sh @@ -0,0 +1,50 @@ +#!/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=boost +version=1_68_0 +dot_version=1.68.0 +hash=7f6130bc3cf65f56a618888ce9d5ea704fa10b462be126ad053e80e553d6d8b7 + +rm -rf ${name}_${version} + +curl -# -L -O \ + https://dl.bintray.com/boostorg/release/${dot_version}/source/${name}_${version}.tar.bz2 + +echo "${hash} ${name}_${version}.tar.bz2" | sha256sum -c + +tar xfv ${name}_${version}.tar.bz2 diff --git a/etc/scripts/build-external-libs/clean.sh b/etc/scripts/build-external-libs/clean.sh new file mode 100755 index 0000000..ce8e991 --- /dev/null +++ b/etc/scripts/build-external-libs/clean.sh @@ -0,0 +1,41 @@ +#!/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 + +build_root=$BUILD_PATH + +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 new file mode 100755 index 0000000..54f4e24 --- /dev/null +++ b/etc/scripts/build-external-libs/collect-fake.sh @@ -0,0 +1,45 @@ +#!/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 new file mode 100755 index 0000000..1bec331 --- /dev/null +++ b/etc/scripts/build-external-libs/collect.sh @@ -0,0 +1,70 @@ +#!/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` + +name=wownero + +cd $src_root/${name} + +archs=(arm64) +for arch in ${archs[@]}; do + extra_cmake_flags="" + case ${arch} in + "arm") + target_host=arm-linux-androideabi + ;; + "arm64") + target_host=aarch64-linux-android + ;; + "x86_64") + target_host=x86_64-linux-android + ;; + *) + exit 16 + ;; + esac + + echo "collecting for ${arch}" + mkdir -p $target_root/cyberwow/native/output/$arch + cp build/release/bin/wownerod $target_root/cyberwow/native/output/$arch/ + +done + +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/cppzmq/build.sh b/etc/scripts/build-external-libs/cppzmq/build.sh new file mode 100755 index 0000000..6140f11 --- /dev/null +++ b/etc/scripts/build-external-libs/cppzmq/build.sh @@ -0,0 +1,69 @@ +#!/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=cppzmq + +cd $src_root/${name} + +archs=(arm64) +for arch in ${archs[@]}; do + extra_cmake_flags="" + case ${arch} in + "arm") + target_host=arm-linux-androideabi + ;; + "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}" + + mkdir -p $PREFIX/include + cp *.hpp $PREFIX/include/ +done + +exit 0 diff --git a/etc/scripts/build-external-libs/cppzmq/fetch.sh b/etc/scripts/build-external-libs/cppzmq/fetch.sh new file mode 100755 index 0000000..3c54d9e --- /dev/null +++ b/etc/scripts/build-external-libs/cppzmq/fetch.sh @@ -0,0 +1,46 @@ +#!/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 + +version=v4.2.3 +name=cppzmq +githash=6aa3ab686e916cb0e62df7fa7d12e0b13ae9fae6 + +rm -rf $name +git clone https://github.com/zeromq/cppzmq.git -b $version +cd $name +test `git rev-parse HEAD` = $githash || exit 1 + diff --git a/etc/scripts/build-external-libs/env.sh b/etc/scripts/build-external-libs/env.sh new file mode 100644 index 0000000..4181414 --- /dev/null +++ b/etc/scripts/build-external-libs/env.sh @@ -0,0 +1,65 @@ +# 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. + +DEFAULT_ANDROID_NDK_ROOT=~/SDK/Android/ndk-archive/android-ndk-r20 +ANDROID_NDK_ROOT="${ANDROID_NDK_ROOT:-${DEFAULT_ANDROID_NDK_ROOT}}" +export ANDROID_NDK_ROOT=`realpath $ANDROID_NDK_ROOT` + +DEFAULT_ANDROID_NDK_VERSION=r20 +ANDROID_NDK_VERSION="${ANDROID_NDK_VERSION:-${DEFAULT_ANDROID_NDK_VERSION}}" + +BUILD_PATH=../cyberwow-build + +DEFAULT_BUILD_ROOT=${BUILD_PATH}/$ANDROID_NDK_VERSION +BUILD_ROOT="${BUILD_ROOT:-${DEFAULT_BUILD_ROOT}}" +export BUILD_ROOT=`realpath $BUILD_ROOT` + +BUILD_ROOT_SRC=${BUILD_ROOT}/src + +DEFAULT_NPROC=$(nproc) +NPROC="${NPROC:-${DEFAULT_NPROC}}" + +export NPROC + + +# wownero 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_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_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` + + + diff --git a/etc/scripts/build-external-libs/iconv/build.sh b/etc/scripts/build-external-libs/iconv/build.sh new file mode 100755 index 0000000..eadd376 --- /dev/null +++ b/etc/scripts/build-external-libs/iconv/build.sh @@ -0,0 +1,80 @@ +#!/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 + +version=1.15 +name=libiconv + +cd $src_root/${name}-${version} + +archs=(arm64) +for arch in ${archs[@]}; do + extra_cmake_flags="" + case ${arch} in + "arm") + target_host=arm-linux-androideabi + ;; + "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}" + + ( + 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 \ + ) + +done + +exit 0 diff --git a/etc/scripts/build-external-libs/iconv/fetch.sh b/etc/scripts/build-external-libs/iconv/fetch.sh new file mode 100755 index 0000000..8ce9ede --- /dev/null +++ b/etc/scripts/build-external-libs/iconv/fetch.sh @@ -0,0 +1,49 @@ +#!/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 + +version=1.15 +hash=ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178 +name=libiconv + +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 + +tar -xzf ${name}-${version}.tar.gz + diff --git a/etc/scripts/build-external-libs/openssl/build.sh b/etc/scripts/build-external-libs/openssl/build.sh new file mode 100755 index 0000000..cc4a238 --- /dev/null +++ b/etc/scripts/build-external-libs/openssl/build.sh @@ -0,0 +1,88 @@ +#!/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=openssl +# version=1.0.2p +version=1.1.1c + +cd $src_root/${name}-${version} + +archs=(arm64) +for arch in ${archs[@]}; do + extra_cmake_flags="" + case ${arch} in + "arm") + target_host=arm-linux-androideabi + ;; + "arm64") + target_host=aarch64-linux-android + ;; + "x86_64") + target_host=x86_64-linux-android + ;; + *) + exit 16 + ;; + esac + + # ZLIB_PATH=$build_root/build/zlib/$arch + ZLIB_PATH=$build_root/build/$arch + + # PREFIX=$build_root/build/${name}/$arch + PREFIX=$build_root/build/$arch + + 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 + export ANDROID_NDK_HOME=$ANDROID_NDK_ROOT + + ./Configure android-${arch} \ + --prefix=${PREFIX} \ + -D__ANDROID_API__=$ANDROID_API \ + --with-zlib-include=${ZLIB_PATH}/include \ + --with-zlib-lib=${ZLIB_PATH}/lib \ + && make -j${NPROC} && make install && make clean \ + ) + +done + +exit 0 diff --git a/etc/scripts/build-external-libs/openssl/fetch.sh b/etc/scripts/build-external-libs/openssl/fetch.sh new file mode 100755 index 0000000..410f3bc --- /dev/null +++ b/etc/scripts/build-external-libs/openssl/fetch.sh @@ -0,0 +1,50 @@ +#!/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=openssl +# version=1.0.2p +version=1.1.1c +hash=50a98e07b1a89eb8f6a99477f262df71c6fa7bef77df4dc83025a2845c827d00 + +rm -rf ${name}-${version} + +curl -# -L -O \ + https://www.openssl.org/source/openssl-${version}.tar.gz + +# echo "${hash} ${name}-${version}.tar.gz" | sha256sum -c + +tar xzf ${name}-${version}.tar.gz diff --git a/etc/scripts/build-external-libs/sodium/build.sh b/etc/scripts/build-external-libs/sodium/build.sh new file mode 100755 index 0000000..5dd1e4f --- /dev/null +++ b/etc/scripts/build-external-libs/sodium/build.sh @@ -0,0 +1,82 @@ +#!/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=libsodium + +cd $src_root/${name} + +./autogen.sh + +archs=(arm64) +for arch in ${archs[@]}; do + extra_cmake_flags="" + case ${arch} in + "arm") + target_host=arm-linux-androideabi + ;; + "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}" + + ( + PATH=$build_root/tool/$arch/$target_host/bin:$build_root/tool/$arch/bin:$PATH \ + CC=clang \ + CXX=clang++; \ + + ./configure \ + --prefix=${PREFIX} \ + --host=${target_host} \ + --enable-static \ + --disable-shared \ + && make -j${NPROC} && make install && make clean \ + ) + +done + +exit 0 diff --git a/etc/scripts/build-external-libs/sodium/fetch.sh b/etc/scripts/build-external-libs/sodium/fetch.sh new file mode 100755 index 0000000..42c2e64 --- /dev/null +++ b/etc/scripts/build-external-libs/sodium/fetch.sh @@ -0,0 +1,47 @@ +#!/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=libsodium +version=1.0.16 +githash=675149b9b8b66ff44152553fb3ebf9858128363d + +rm -rf $name + +git clone https://github.com/jedisct1/libsodium.git -b $version + +cd $name +test `git rev-parse HEAD` = $githash || exit 1 diff --git a/etc/scripts/build-external-libs/toolchain-wow/import.sh b/etc/scripts/build-external-libs/toolchain-wow/import.sh new file mode 100755 index 0000000..6e11ea2 --- /dev/null +++ b/etc/scripts/build-external-libs/toolchain-wow/import.sh @@ -0,0 +1,49 @@ +#!/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 + +build_root=$BUILD_ROOT_WOW +PATH=$ANDROID_NDK_ROOT_WOW/build/tools/:$PATH + +args="--api 23 --stl=libc++" +archs=(arm64) + +for arch in ${archs[@]}; do + + if [ ! -d "$build_root/tool/$arch" ]; then + echo "installing $arch" + make_standalone_toolchain.py $args --arch $arch --install-dir $build_root/tool/$arch + fi + +done diff --git a/etc/scripts/build-external-libs/toolchain-wow/patch.sh b/etc/scripts/build-external-libs/toolchain-wow/patch.sh new file mode 100755 index 0000000..37ae12d --- /dev/null +++ b/etc/scripts/build-external-libs/toolchain-wow/patch.sh @@ -0,0 +1,45 @@ +#!/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 + +build_root=$BUILD_ROOT_WOW +PATH=$ANDROID_NDK_ROOT_WOW/build/tools/:$PATH + +archs=(arm64) + +for arch in ${archs[@]}; do + cd $build_root/tool/$arch/sysroot && \ + mkdir -p var/empty/include/android && \ + cp usr/include/android/api-level.h var/empty/include/android/ +done diff --git a/etc/scripts/build-external-libs/toolchain/import.sh b/etc/scripts/build-external-libs/toolchain/import.sh new file mode 100755 index 0000000..597a299 --- /dev/null +++ b/etc/scripts/build-external-libs/toolchain/import.sh @@ -0,0 +1,51 @@ +#!/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 + +build_root=$BUILD_ROOT +PATH=$ANDROID_NDK_ROOT/build/tools/:$PATH + +args="--api 23 --stl=libc++" +archs=(arm64) + +for arch in ${archs[@]}; do + + if [ ! -d "$build_root/tool/$arch" ]; then + echo "installing $arch" + make_standalone_toolchain.py $args --arch $arch --install-dir $build_root/tool/$arch + fi + +done + +mkdir -p $BUILD_ROOT_SRC diff --git a/etc/scripts/build-external-libs/use-archive.sh b/etc/scripts/build-external-libs/use-archive.sh new file mode 100755 index 0000000..d695010 --- /dev/null +++ b/etc/scripts/build-external-libs/use-archive.sh @@ -0,0 +1,42 @@ +#!/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=v2.3.0.0 + +curl -O -L https://github.com/fuwa0529/wownerujo/releases/download/${version}/external-libs.tgz + +rm -rf external-libs + +echo "unpacking external-libs" +tar zxfv external-libs.tgz +rm external-libs.tgz diff --git a/etc/scripts/build-external-libs/wownero/build.sh b/etc/scripts/build-external-libs/wownero/build.sh new file mode 100755 index 0000000..94c0dd5 --- /dev/null +++ b/etc/scripts/build-external-libs/wownero/build.sh @@ -0,0 +1,85 @@ +#!/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 + +build_root_wow=$BUILD_ROOT_WOW + +name=wownero + +cd $src_root/${name} + +archs=(arm64) +for arch in ${archs[@]}; do + extra_cmake_flags="" + case ${arch} in + "arm") + target_host=arm-linux-androideabi + ;; + "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}" + + mkdir -p $PREFIX/dlib/ + rm -f $PREFIX/dlib/libtinfo.so.5 + 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 PATH=$PATH:$build_root/host/bin + + ( + 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} \ + ) + +done + +exit 0 diff --git a/etc/scripts/build-external-libs/wownero/fetch.sh b/etc/scripts/build-external-libs/wownero/fetch.sh new file mode 100755 index 0000000..ca3433a --- /dev/null +++ b/etc/scripts/build-external-libs/wownero/fetch.sh @@ -0,0 +1,50 @@ +#!/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=wownero +version=v0.6.1.2 +githash=aba46a7c5f0a892533abd3cc1a8b97cdf6b23fcc + +rm -rf $name + +git clone https://github.com/wownero/wownero.git -b $version +# git clone ../../../wownero -b $version + +cd $name +test `git rev-parse HEAD` = $githash || exit 1 + +git submodule init && git submodule update diff --git a/etc/scripts/build-external-libs/zeromq/build.sh b/etc/scripts/build-external-libs/zeromq/build.sh new file mode 100755 index 0000000..e069e4b --- /dev/null +++ b/etc/scripts/build-external-libs/zeromq/build.sh @@ -0,0 +1,81 @@ +#!/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=libzmq + +cd $src_root/${name} + +./autogen.sh + +archs=(arm64) +for arch in ${archs[@]}; do + extra_cmake_flags="" + case ${arch} in + "arm") + target_host=arm-linux-androideabi + ;; + "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}" + + ( + PATH=$build_root/tool/$arch/$target_host/bin:$build_root/tool/$arch/bin:$PATH \ + CC=clang \ + CXX=clang++; \ + ./configure \ + --prefix=${PREFIX} \ + --host=${target_host} \ + --enable-static \ + --disable-shared \ + && make -j${NPROC} && make install && make clean \ + ) + +done + +exit 0 diff --git a/etc/scripts/build-external-libs/zeromq/fetch.sh b/etc/scripts/build-external-libs/zeromq/fetch.sh new file mode 100755 index 0000000..3167816 --- /dev/null +++ b/etc/scripts/build-external-libs/zeromq/fetch.sh @@ -0,0 +1,46 @@ +#!/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 + +version=master +name=libzmq +githash=501d0815bf2b0abb93be8214fc66519918ef6c40 + +rm -rf $name +git clone https://github.com/zeromq/libzmq.git -b $version +cd libzmq +git checkout $githash + diff --git a/etc/scripts/build-external-libs/zlib/build.sh b/etc/scripts/build-external-libs/zlib/build.sh new file mode 100755 index 0000000..d320f52 --- /dev/null +++ b/etc/scripts/build-external-libs/zlib/build.sh @@ -0,0 +1,79 @@ +#!/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 + "arm") + target_host=arm-linux-androideabi + ;; + "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 new file mode 100755 index 0000000..2881dbb --- /dev/null +++ b/etc/scripts/build-external-libs/zlib/fetch.sh @@ -0,0 +1,49 @@ +#!/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 diff --git a/etc/scripts/build-wownero.sh b/etc/scripts/build-wownero.sh index 7b68c8e..aa15f6e 100755 --- a/etc/scripts/build-wownero.sh +++ b/etc/scripts/build-wownero.sh @@ -1,5 +1,34 @@ #!/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"