Update scripts for build monero lib for ios.
M committed
Aug 4, 2022 at 14:24 UTC
c3808c416d333da131c909e5bf0313d513a04780
7 files changed
+52
-15
cw_monero/ios/cw_monero.podspec
+7
@@ -34,6 +34,13 @@ Pod::Spec.new do |s|
34
sodium.xcconfig = { 'HEADER_SEARCH_PATHS' => "${PODS_ROOT}/#{s.name}/External/ios/include/**" }
35
end
36
37
+ s.subspec 'Unbound' do |unbound|
38
+ unbound.preserve_paths = '../../../../../cw_shared_external/ios/External/ios/include/**/*.h'
39
+ unbound.vendored_libraries = '../../../../../cw_shared_external/ios/External/ios/lib/libunbound.a'
40
+ unbound.libraries = 'unbound'
41
+ unbound.xcconfig = { 'HEADER_SEARCH_PATHS' => "${PODS_ROOT}/#{s.name}/External/ios/include/**" }
42
+ end
43
+
44
s.subspec 'Boost' do |boost|
45
boost.preserve_paths = '../../../../../cw_shared_external/ios/External/ios/include/**/*.h',
46
boost.vendored_libraries = '../../../../../cw_shared_external/ios/External/ios/lib/libboost.a',
ios/Podfile.lock
+5
-1
@@ -32,6 +32,7 @@ PODS:
32
- cw_monero/Monero (= 0.0.2)
33
- cw_monero/OpenSSL (= 0.0.2)
34
- cw_monero/Sodium (= 0.0.2)
35
+ - cw_monero/Unbound (= 0.0.2)
36
- cw_shared_external
37
- Flutter
38
- cw_monero/Boost (0.0.2):
@@ -46,6 +47,9 @@ PODS:
47
- cw_monero/Sodium (0.0.2):
48
- cw_shared_external
49
- Flutter
50
+ - cw_monero/Unbound (0.0.2):
51
+ - cw_shared_external
52
+ - Flutter
53
- cw_shared_external (0.0.1):
54
- cw_shared_external/Boost (= 0.0.1)
55
- cw_shared_external/OpenSSL (= 0.0.1)
@@ -214,7 +218,7 @@ SPEC CHECKSUMS:
218
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
219
CryptoSwift: 093499be1a94b0cae36e6c26b70870668cb56060
220
cw_haven: b3e54e1fbe7b8e6fda57a93206bc38f8e89b898a
217
- cw_monero: 88c5e7aa596c6848330750f5f8bcf05fb9c66375
221
+ cw_monero: 4cf3b96f2da8e95e2ef7d6703dd4d2c509127b7d
222
cw_shared_external: 2972d872b8917603478117c9957dfca611845a92
223
device_display_brightness: 1510e72c567a1f6ce6ffe393dcd9afd1426034f7
224
devicelocale: b22617f40038496deffba44747101255cee005b0
scripts/ios/build_monero.sh
+10
-13
@@ -4,7 +4,7 @@
4
5
MONERO_URL="https://github.com/cake-tech/monero.git"
6
MONERO_DIR_PATH="${EXTERNAL_IOS_SOURCE_DIR}/monero"
7
-MONERO_VERSION=release-v0.17.3.2
7
+MONERO_VERSION=release-v0.18.0.0
8
BUILD_TYPE=release
9
PREFIX=${EXTERNAL_IOS_DIR}
10
DEST_LIB_DIR=${EXTERNAL_IOS_LIB_DIR}/monero
@@ -18,6 +18,9 @@ git submodule update --init --force
18
mkdir -p build
19
cd ..
20
21
+mkdir -p $DEST_LIB_DIR
22
+mkdir -p $DEST_INCLUDE_DIR
23
+
24
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
25
if [ -z $INSTALL_PREFIX ]; then
26
INSTALL_PREFIX=${ROOT_DIR}/monero
@@ -46,20 +49,14 @@ cmake -D IOS=ON \
49
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
50
-DSTATIC=ON \
51
-DBUILD_GUI_DEPS=ON \
49
- -DINSTALL_VENDORED_LIBUNBOUND=ON \
52
+ -DUNBOUND_INCLUDE_DIR=${EXTERNAL_IOS_INCLUDE_DIR} \
53
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
54
-DUSE_DEVICE_TREZOR=OFF \
55
../..
53
-make -j4 && make install
54
-cp external/randomx/librandomx.a ${DEST_LIB}/
55
-cp src/cryptonote_basic/libcryptonote_basic.a ${DEST_LIB}/
56
-cp src/cryptonote_basic/libcryptonote_format_utils_basic.a ${DEST_LIB}/
56
+make wallet_api -j4
57
+find . -path ./lib -prune -o -name '*.a' -exec cp '{}' lib \;
58
+cp -r ./lib/* $DEST_LIB_DIR
59
+cp ../../src/wallet/api/wallet2_api.h $DEST_INCLUDE_DIR
60
popd
61
59
-done
60
-
61
-#only for arm64
62
-mkdir -p $DEST_LIB_DIR
63
-mkdir -p $DEST_INCLUDE_DIR
64
-cp ${MONERO_DIR_PATH}/lib-armv8-a/* $DEST_LIB_DIR
65
-cp ${MONERO_DIR_PATH}/include/wallet/api/* $DEST_INCLUDE_DIR
62
+done
\ No newline at end of file
scripts/ios/build_monero_all.sh
+1
@@ -6,4 +6,5 @@
6
./build_boost.sh
7
./build_sodium.sh
8
./build_zmq.sh
9
+./build_unbound.sh
10
./build_monero.sh
\ No newline at end of file
scripts/ios/build_openssl.sh
+1
-1
@@ -10,7 +10,7 @@ echo "============================ OpenSSL ============================"
10
echo "Cloning Open SSL from - $OPEN_SSL_URL"
11
git clone $OPEN_SSL_URL $OPEN_SSL_DIR_PATH
12
cd $OPEN_SSL_DIR_PATH
13
-./build-libssl.sh --version=1.1.1k --archs="x86_64 arm64 armv7s armv7" --targets="ios64-cross-arm64" --deprecated
13
+./build-libssl.sh --version=1.1.1q --archs="x86_64 arm64 armv7s armv7" --targets="ios64-cross-arm64" --deprecated
14
15
mv ${OPEN_SSL_DIR_PATH}/include/* $EXTERNAL_IOS_INCLUDE_DIR
16
mv ${OPEN_SSL_DIR_PATH}/lib/* $EXTERNAL_IOS_LIB_DIR
\ No newline at end of file
scripts/ios/build_unbound.sh
new
+27
@@ -0,0 +1,27 @@
1
+#!/bin/sh
2
+
3
+. ./config.sh
4
+
5
+UNBOUND_VERSION=1.13.2
6
+UNBOUND_HASH=0a13b547f3b92a026b5ebd0423f54c991e5718037fd9f72445817f6a040e1a83
7
+UNBOUND_URL="https://www.nlnetlabs.nl/downloads/unbound/unbound-${UNBOUND_VERSION}.tar.gz"
8
+UNBOUND_DIR_PATH="${EXTERNAL_IOS_SOURCE_DIR}/unbound-${UNBOUND_VERSION}"
9
+UNBOUND_ARCH_PATH=${EXTERNAL_IOS_SOURCE_DIR}/unbound-${UNBOUND_VERSION}.tar.gz
10
+
11
+echo $UNBOUND_DIR_PATH
12
+echo "============================ Unbound ============================"
13
+curl $UNBOUND_URL -L -o $UNBOUND_ARCH_PATH
14
+tar -xzf $UNBOUND_ARCH_PATH -C $EXTERNAL_IOS_SOURCE_DIR
15
+cd $UNBOUND_DIR_PATH
16
+
17
+export IOS_SDK=iPhone
18
+export IOS_CPU=arm64
19
+export IOS_PREFIX=$EXTERNAL_IOS_DIR
20
+export AUTOTOOLS_HOST=aarch64-apple-ios
21
+export AUTOTOOLS_BUILD="$(./config.guess)"
22
+source ./contrib/ios/setenv_ios.sh
23
+./contrib/ios/install_tools.sh
24
+./contrib/ios/install_expat.sh
25
+./configure --build="$AUTOTOOLS_BUILD" --host="$AUTOTOOLS_HOST" --prefix="$IOS_PREFIX" --with-ssl="$IOS_PREFIX" --disable-gost --with-libexpat="$IOS_PREFIX"
26
+make
27
+make install
\ No newline at end of file
scripts/ios/setup.sh
+1
@@ -35,5 +35,6 @@ ln ./libboost.a ${CW_MONERO_EXTERNAL_LIB}/libboost.a
35
ln ./libcrypto.a ${CW_MONERO_EXTERNAL_LIB}/libcrypto.a
36
ln ./libssl.a ${CW_MONERO_EXTERNAL_LIB}/libssl.a
37
ln ./libsodium.a ${CW_MONERO_EXTERNAL_LIB}/libsodium.a
38
+ln ./libunbound.a ${CW_MONERO_EXTERNAL_LIB}/libunbound.a
39
cp ./libmonero.a $CW_MONERO_EXTERNAL_LIB
40
cp ../include/monero/* $CW_MONERO_EXTERNAL_INCLUDE
\ No newline at end of file