This repository has been archived by the owner on Sep 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build_opentxs
executable file
·80 lines (68 loc) · 2.93 KB
/
build_opentxs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
# Copyright (c) 2017 The Open-Transactions developers
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
source "${HOME}"/bin/functions
check_arch "${1}"
source "${HOME}"/bin/android-"${OT_ARCH}"
"${HOME}"/bin/update_git
export LOCAL_SOURCE_DIR="${SRC_DIR}/${FOLDER_OPENTXS_OT}"
export LOCAL_BUILD_DIR="${BUILD_DIR}/${FOLDER_OPENTXS_OT}"
export TOOLCHAIN_LIBRARY_MAIN="libopentxs.so"
export TOOLCHAIN_LIBRARY_SWIG="libJOpentxs.so"
export OUTPUT_LIBRARY_MAIN="libopentxs.so"
export OUTPUT_LIBRARY_SWIG="libJOpentxs.so"
clean_directories "${LOCAL_BUILD_DIR}" "${LOCAL_SOURCE_DIR}" ""
set -e
create_directories "${LOCAL_SOURCE_DIR}" "${LOCAL_BUILD_DIR}" "${FINAL_OUTPUT_DIR_LIB_OT}"
git_clone_source "${OPENTXS_VERSION_OT}" "${GIT_OPENTXS_URL}" "${LOCAL_SOURCE_DIR}"
sed -i "s/-Wno-useless-cast//" "${LOCAL_SOURCE_DIR}"/deps/opentxs-proto/CMakeLists.txt
sed -i "s/-Werror //" "${LOCAL_SOURCE_DIR}"/deps/opentxs-proto/CMakeLists.txt
cd "${LOCAL_BUILD_DIR}"
export CMAKE_C_FLAGS="${CMAKE_C_FLAGS} -O3"
export CMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -O3"
cmake \
-GNinja \
-DOT_SANITIZE=OFF \
-DCMAKE_C_FLAGS="${CMAKE_C_FLAGS}" \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}" \
-DUSE_CCACHE=no \
-DCMAKE_INSTALL_PREFIX="${TOOLCHAIN_USR_OT}" \
-DJAVA=ON \
-DOT_CASH_USING_LUCRE=ON \
-DNO_PASSWORD=ON \
-DANDROID=ON \
-DOT_STRICT=OFF \
-DOT_STORAGE_FS=OFF \
-DOT_STORAGE_SQLITE=ON \
-DOT_STORAGE_LMDB=OFF \
-DOT_DHT=OFF \
-DOT_CRYPTO_SUPPORTED_KEY_RSA=OFF \
-DOT_CRYPTO_USING_LIBBITCOIN=OFF \
-DOT_GENERATE_PROTO=OFF \
-DOT_BUNDLED_PROTOBUF=ON \
-DOT_BUNDLED_SODIUM=ON \
-DOT_BUNDLED_SECP256K1=ON \
-DOT_BUNDLED_SQLITE=ON \
-DOT_BUNDLED_LIBZMQ=ON \
-DOT_BUNDLED_OPENTXS_PROTO=ON \
-DOT_ZLIB_OVERRIDE=ON \
-DOT_HOST_OVERRIDE="${ANDROID_EABI_OT_OVERRIDE}" \
-DOT_SYSROOT_OVERRIDE="${SYSROOT}" \
-DOT_MAKEOPTS_OVERRIDE="${OT_MAKE_OPTS}" \
-DZLIB_INCLUDE_DIRS_OVERRIDE="${TOOLCHAIN_SYSROOT_INCLUDE_DIR_OT}" \
-DZLIB_LIBRARIES_OVERRIDE="${TOOLCHAIN_SYSROOT_LIB_DIR_OT}/libz.so" \
-DOPENSSL_INCLUDE_DIR="${TOOLCHAIN_SYSROOT_INCLUDE_DIR_OT}" \
-DOPENSSL_CRYPTO_LIBRARY="${TOOLCHAIN_SYSROOT_LIB_DIR_OT}/libcrypto.so" \
-DOPENSSL_SSL_LIBRARY="${TOOLCHAIN_SYSROOT_LIB_DIR_OT}/libssl.so" \
"${LOCAL_SOURCE_DIR}"
ninja
ninja install
mkdir -p "${FINAL_OUTPUT_DIR_JAVA_OPENTXS_OT}"
cp "${LOCAL_BUILD_DIR}/wrappers/java/otx_java"/*.java "${FINAL_OUTPUT_DIR_JAVA_OPENTXS_OT}/"
cp "${ANDROID_STL_TOOLCHAIN_LIB}" "${FINAL_OUTPUT_DIR_LIB_OT}"
cp "${TOOLCHAIN_SYSROOT_LIB_DIR_OT}/${TOOLCHAIN_LIBRARY_MAIN}" "${FINAL_OUTPUT_DIR_LIB_OT}/${OUTPUT_LIBRARY_MAIN}"
cp "${TOOLCHAIN_SYSROOT_LIB_DIR_OT}/${TOOLCHAIN_LIBRARY_SWIG}" "${FINAL_OUTPUT_DIR_LIB_OT}/${OUTPUT_LIBRARY_SWIG}"
rpl -R -e ".so.9" "_9.so" "${FINAL_OUTPUT_DIR_LIB_OT}/${OUTPUT_LIBRARY_MAIN}"
rpl -R -e ".so.1.0.0" "_1_0_0.so" "${FINAL_OUTPUT_DIR_LIB_OT}/${OUTPUT_LIBRARY_MAIN}"