diff --git a/.gitmodules b/.gitmodules index 784e3e58..cbb27ebe 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,4 +13,21 @@ url = https://github.com/leetal/ios-cmake [submodule "external/wownero-seed"] path = external/wownero-seed - url = https://github.com/wownero-mirror/wownero-seed \ No newline at end of file + url = https://github.com/wownero-mirror/wownero-seed +[submodule "external/Apple-Boost-BuildScript"] + path = external/Apple-Boost-BuildScript + url = https://github.com/cake-tech/Apple-Boost-BuildScript.git + branch = build +[submodule "external/OpenSSL-for-iPhone"] + path = external/OpenSSL-for-iPhone + url = https://github.com/x2on/OpenSSL-for-iPhone.git +[submodule "external/libsodium"] + path = external/libsodium + url = https://github.com/jedisct1/libsodium.git +[submodule "external/unbound"] + path = external/unbound + url = https://github.com/NLnetLabs/unbound.git + branch = release-1.16.2 +[submodule "external/libzmq"] + path = external/libzmq + url = https://github.com/zeromq/libzmq diff --git a/external/Apple-Boost-BuildScript b/external/Apple-Boost-BuildScript new file mode 160000 index 00000000..513dd145 --- /dev/null +++ b/external/Apple-Boost-BuildScript @@ -0,0 +1 @@ +Subproject commit 513dd145f6e67a694160b858957978e375c8d694 diff --git a/external/OpenSSL-for-iPhone b/external/OpenSSL-for-iPhone new file mode 160000 index 00000000..394bac11 --- /dev/null +++ b/external/OpenSSL-for-iPhone @@ -0,0 +1 @@ +Subproject commit 394bac11f4347cc21b4ba976c1c0629afaf67c54 diff --git a/external/ios/build_boost.sh b/external/ios/build_boost.sh index 11dcead3..4bfbfeb8 100755 --- a/external/ios/build_boost.sh +++ b/external/ios/build_boost.sh @@ -5,32 +5,22 @@ set -e . ./config.sh MIN_IOS_VERSION=10.0 -BOOST_URL="https://github.com/cake-tech/Apple-Boost-BuildScript.git" BOOST_DIR_PATH="${EXTERNAL_IOS_SOURCE_DIR}/Apple-Boost-BuildScript" BOOST_VERSION=1.84.0 BOOST_LIBS="random regex graph random chrono thread filesystem system date_time locale serialization program_options" echo "============================ Boost ============================" -echo "Cloning Apple-Boost-BuildScript from - $BOOST_URL" - # Check if the directory already exists. if [ -d "$BOOST_DIR_PATH" ]; then echo "Boost directory already exists." else echo "Cloning Boost from $BOOST_URL" - git clone -b build $BOOST_URL $BOOST_DIR_PATH -fi - -# Verify if the repository was cloned successfully. -if [ -d "$BOOST_DIR_PATH/.git" ]; then - echo "Boost repository cloned successfully." - cd $BOOST_DIR_PATH - git checkout build -else - echo "Failed to clone Boost repository. Exiting." - exit 1 + mkdir -p $BOOST_DIR_PATH || true + rm -rf $BOOST_DIR_PATH || true + cp -r "${MONEROC_DIR}/external/Apple-Boost-BuildScript" $BOOST_DIR_PATH fi +cd $BOOST_DIR_PATH ./boost.sh -ios \ --min-ios-version ${MIN_IOS_VERSION} \ diff --git a/external/ios/build_libiconv.sh b/external/ios/build_libiconv.sh deleted file mode 100755 index ad59e8a4..00000000 --- a/external/ios/build_libiconv.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set -e - -. config.sh - -ICONV_DIR_PATH="${EXTERNAL_IOS_SOURCE_DIR}/libiconv" - -rm -rf $ICONV_DIR_PATH -mkdir -p $ICONV_DIR_PATH -pushd $ICONV_DIR_PATH - wget https://ftp.gnu.org/gnu/libiconv/libiconv-1.15.tar.gz -O -| tar xzv - pushd libiconv-1.15 - - popd -popd \ No newline at end of file diff --git a/external/ios/build_monero_all.sh b/external/ios/build_monero_all.sh index 3f73933e..4957e692 100755 --- a/external/ios/build_monero_all.sh +++ b/external/ios/build_monero_all.sh @@ -5,6 +5,10 @@ set -e rm -rf build . ./config.sh + +rm -rf "$EXTERNAL_IOS_LIB_DIR" +rm -rf "$EXTERNAL_IOS_INCLUDE_DIR" + ./install_missing_headers.sh ./build_openssl.sh ./build_boost.sh diff --git a/external/ios/build_openssl.sh b/external/ios/build_openssl.sh index 919523d2..507ca9d3 100755 --- a/external/ios/build_openssl.sh +++ b/external/ios/build_openssl.sh @@ -4,7 +4,6 @@ set -e . ./config.sh -OPEN_SSL_URL="https://github.com/x2on/OpenSSL-for-iPhone.git" OPEN_SSL_DIR_PATH="${EXTERNAL_IOS_SOURCE_DIR}/OpenSSL" echo "============================ OpenSSL ============================" @@ -15,21 +14,15 @@ echo "Cloning Open SSL from - $OPEN_SSL_URL" if [ -d "$OPEN_SSL_DIR_PATH" ]; then echo "OpenSSL directory already exists." else - echo "Cloning OpenSSL from $OPEN_SSL_URL" - git clone $OPEN_SSL_URL $OPEN_SSL_DIR_PATH -fi - -# Verify if the repository was cloned successfully. -if [ -d "$OPEN_SSL_DIR_PATH/.git" ]; then - echo "OpenSSL repository cloned successfully." - cd $OPEN_SSL_DIR_PATH -else - echo "Failed to clone OpenSSL repository. Exiting." - exit 1 + mkdir -p "$OPEN_SSL_DIR_PATH" || true + rm -rf "$OPEN_SSL_DIR_PATH" + cp -r "${MONEROC_DIR}/external/OpenSSL-for-iPhone" $OPEN_SSL_DIR_PATH fi +cd $OPEN_SSL_DIR_PATH ./build-libssl.sh --version=1.1.1q --targets="ios-cross-arm64" --deprecated + mv -f ${OPEN_SSL_DIR_PATH}/include/* $EXTERNAL_IOS_INCLUDE_DIR -mv ${OPEN_SSL_DIR_PATH}/lib/libcrypto-iOS.a ${EXTERNAL_IOS_LIB_DIR}/libcrypto.a -mv ${OPEN_SSL_DIR_PATH}/lib/libssl-iOS.a ${EXTERNAL_IOS_LIB_DIR}/libssl.a \ No newline at end of file +mv -f ${OPEN_SSL_DIR_PATH}/lib/libcrypto-iOS.a ${EXTERNAL_IOS_LIB_DIR}/libcrypto.a +mv -f ${OPEN_SSL_DIR_PATH}/lib/libssl-iOS.a ${EXTERNAL_IOS_LIB_DIR}/libssl.a \ No newline at end of file diff --git a/external/ios/build_sodium.sh b/external/ios/build_sodium.sh index fb45e172..ecb4a5e0 100755 --- a/external/ios/build_sodium.sh +++ b/external/ios/build_sodium.sh @@ -16,19 +16,12 @@ if [ -d "$SODIUM_PATH" ]; then echo "Sodium directory already exists." else echo "Cloning Sodium from $SODIUM_URL" - git clone $SODIUM_URL $SODIUM_PATH -fi - -# Verify if the repository was cloned successfully. -if [ -d "$SODIUM_PATH/.git" ]; then - echo "Sodium repository cloned successfully." - cd $SODIUM_PATH - git checkout 443617d7507498f7477703f0b51cb596d4539262 -else - echo "Failed to clone Sodium repository. Exiting." - exit 1 + mkdir -p $SODIUM_PATH || true + rm -rf $SODIUM_PATH + cp -r "${MONEROC_DIR}/external/libsodium" $SODIUM_PATH fi +cd $SODIUM_PATH ../../../../libsodium_apple-ios.sh mv -f ${SODIUM_PATH}/libsodium-apple/ios/include/* $EXTERNAL_IOS_INCLUDE_DIR diff --git a/external/ios/build_unbound.sh b/external/ios/build_unbound.sh index 889f79a5..14efef80 100755 --- a/external/ios/build_unbound.sh +++ b/external/ios/build_unbound.sh @@ -18,19 +18,12 @@ if [ -d "$UNBOUND_DIR_PATH" ]; then echo "Unbound directory already exists." else echo "Cloning Unbound from $Unbound_URL" - git clone $UNBOUND_GIT_URL -b ${UNBOUND_VERSION} ${UNBOUND_DIR_PATH} + mkdir -p ${UNBOUND_DIR_PATH} || true + rm -rf ${UNBOUND_DIR_PATH} + cp -r "${MONEROC_DIR}/external/unbound" ${UNBOUND_DIR_PATH} fi -# Verify if the repository was cloned successfully. -if [ -d "$UNBOUND_DIR_PATH/.git" ]; then - echo "Unbound repository cloned successfully." - cd $UNBOUND_DIR_PATH - git checkout $UNBOUND_VERSION # Or UNBOUND_HASH. - test `git rev-parse HEAD` = ${UNBOUND_HASH} || exit 1 -else - echo "Failed to clone Unbound repository. Exiting." - exit 1 -fi +cd $UNBOUND_DIR_PATH export IOS_SDK=iPhone export IOS_CPU=arm64 diff --git a/external/ios/build_wownero_seed.sh b/external/ios/build_wownero_seed.sh index fc683272..7672db53 100755 --- a/external/ios/build_wownero_seed.sh +++ b/external/ios/build_wownero_seed.sh @@ -6,15 +6,14 @@ set -x -e SEED_VERSION=0.3.0 SEED_SRC_DIR="${EXTERNAL_IOS_SOURCE_DIR}/seed" -SEED_URL="https://git.wownero.com/wowlet/wownero-seed.git" -SEED_SHA_HEAD="d3f68be347facfeebbd8f68fd74982c705cb917b" rm -rf "$SEED_SRC_DIR" > /dev/null echo "[*] cloning $SEED_URL" -git clone --branch ${SEED_VERSION} ${SEED_URL} ${SEED_SRC_DIR} +mkdir -p ${SEED_SRC_DIR} || true +rm -rf ${SEED_SRC_DIR} +cp -r "${MONEROC_DIR}/external/wownero-seed" ${SEED_SRC_DIR} cd $SEED_SRC_DIR -git reset --hard $SEED_SHA_HEAD patch -p1 < ../../../../../wownero-seed-0001-fix-duplicate-symbol-error.patch diff --git a/external/ios/build_zmq.sh b/external/ios/build_zmq.sh index d34cc6ea..63306b20 100755 --- a/external/ios/build_zmq.sh +++ b/external/ios/build_zmq.sh @@ -5,7 +5,6 @@ set -e . ./config.sh ZMQ_PATH="${EXTERNAL_IOS_SOURCE_DIR}/libzmq" -ZMQ_URL="https://github.com/zeromq/libzmq.git" echo "============================ ZMQ ============================" @@ -16,17 +15,12 @@ if [ -d "$ZMQ_PATH" ]; then echo "ZeroMQ directory already exists." else echo "Cloning ZeroMQ from $ZeroMQ_URL" - git clone $ZMQ_URL $ZMQ_PATH + mkdir -p $ZMQ_PATH || true + rm -rf $ZMQ_PATH + cp -r "${MONEROC_DIR}/external/libzmq" $ZMQ_PATH fi -# Verify if the repository was cloned successfully. -if [ -d "$ZMQ_PATH/.git" ]; then - echo "ZeroMQ repository cloned successfully." - cd $ZMQ_PATH -else - echo "Failed to clone ZeroMQ repository. Exiting." - exit 1 -fi +cd $ZMQ_PATH mkdir -p cmake-build cd cmake-build diff --git a/external/ios/config.sh b/external/ios/config.sh index f21f7f00..e65c5a31 100755 --- a/external/ios/config.sh +++ b/external/ios/config.sh @@ -1,6 +1,7 @@ #!/bin/sh export IOS_SCRIPTS_DIR="$(pwd)" +export MONEROC_DIR="$(pwd)/../.." export CW_ROOT="${IOS_SCRIPTS_DIR}" export EXTERNAL_DIR="${CW_ROOT}/build" export EXTERNAL_IOS_DIR="${EXTERNAL_DIR}/ios" diff --git a/external/libsodium b/external/libsodium new file mode 160000 index 00000000..443617d7 --- /dev/null +++ b/external/libsodium @@ -0,0 +1 @@ +Subproject commit 443617d7507498f7477703f0b51cb596d4539262 diff --git a/external/libzmq b/external/libzmq new file mode 160000 index 00000000..59c91227 --- /dev/null +++ b/external/libzmq @@ -0,0 +1 @@ +Subproject commit 59c91227b46b60b7f965816544b25fe0a3cc8bbe diff --git a/external/unbound b/external/unbound new file mode 160000 index 00000000..cbed768b --- /dev/null +++ b/external/unbound @@ -0,0 +1 @@ +Subproject commit cbed768b8ff9bfcf11089a5f1699b7e5707f1ea5