inital ios integration(zano libs built)

This commit is contained in:
cr.zoidberg 2024-08-14 21:20:26 +04:00
parent 7474291d53
commit b210dfeda4
16 changed files with 373 additions and 15 deletions

View file

@ -14,4 +14,15 @@
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>1723563577231</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>

View file

@ -1,2 +1,13 @@
arguments=--init-script /var/folders/4v/g721xt952ys396fxzwv8s5_c0000gn/T/db3b08fc4a9ef609cb16b96b200fa13e563f396e9bb1ed0905fdab7bc3bc513b.gradle --init-script /var/folders/4v/g721xt952ys396fxzwv8s5_c0000gn/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
eclipse.preferences.version=1
gradle.user.home=
java.home=/Library/Java/JavaVirtualMachines/adoptopenjdk-13.0.1.jdk/Contents/Home
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true

View file

@ -277,6 +277,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.3"
decimal:
dependency: transitive
description:
name: decimal
sha256: "24a261d5d5c87e86c7651c417a5dbdf8bcd7080dd592533910e8d0505a279f21"
url: "https://pub.dev"
source: hosted
version: "2.3.3"
encrypt:
dependency: transitive
description:
@ -712,6 +720,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.2.1"
rational:
dependency: transitive
description:
name: rational
sha256: cb808fb6f1a839e6fc5f7d8cb3b0a10e1db48b3be102de73938c627f0b636336
url: "https://pub.dev"
source: hosted
version: "2.2.3"
reactive_ble_mobile:
dependency: transitive
description:

View file

@ -184,6 +184,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.2.4"
decimal:
dependency: transitive
description:
name: decimal
sha256: "24a261d5d5c87e86c7651c417a5dbdf8bcd7080dd592533910e8d0505a279f21"
url: "https://pub.dev"
source: hosted
version: "2.3.3"
encrypt:
dependency: "direct main"
description:
@ -579,6 +587,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.2.1"
rational:
dependency: transitive
description:
name: rational
sha256: cb808fb6f1a839e6fc5f7d8cb3b0a10e1db48b3be102de73938c627f0b636336
url: "https://pub.dev"
source: hosted
version: "2.2.3"
shelf:
dependency: transitive
description:

View file

@ -6,14 +6,16 @@
#include <unistd.h>
#include <mutex>
#include "thread"
#if __APPLE__
// Fix for randomx on ios
void __clear_cache(void* start, void* end) { }
#include "../External/ios/include/wallet2_api.h"
#else
#include "../External/android/include/wallet2_api.h"
//#include "../External/ios/include/wallet2_api.h"
#endif
#include "../External/include/wallet2_api.h"
#include "plain_wallet_api.h"
//#include "plain_wallet_api_ex.h"

168
cw_zano/ios/External/CMakeLists.txt vendored Normal file
View file

@ -0,0 +1,168 @@
# Portions Copyright (c) 2017-2022, The Monero Project
# This file is based off of the https://code.google.com/archive/p/ios-cmake/
# It has been altered for Monero iOS development
#
#
# Options:
#
# IOS_PLATFORM = OS (default) or SIMULATOR or SIMULATOR64
# This decides if SDKS will be selected from the iPhoneOS.platform or iPhoneSimulator.platform folders
# OS - the default, used to build for iPhone and iPad physical devices, which have an arm arch.
# SIMULATOR - used to build for the Simulator platforms, which have an x86 arch.
#
# CMAKE_IOS_DEVELOPER_ROOT = automatic(default) or /path/to/platform/Developer folder
# By default this location is automatcially chosen based on the IOS_PLATFORM value above.
# If set manually, it will override the default location and force the user of a particular Developer Platform
#
# CMAKE_IOS_SDK_ROOT = automatic(default) or /path/to/platform/Developer/SDKs/SDK folder
# By default this location is automatcially chosen based on the CMAKE_IOS_DEVELOPER_ROOT value.
# In this case it will always be the most up-to-date SDK found in the CMAKE_IOS_DEVELOPER_ROOT path.
# If set manually, this will force the use of a specific SDK version
message (STATUS "Running Zano IOS setup cmake file")
# Standard settings
set (CMAKE_SYSTEM_NAME iOS)
set (CMAKE_SYSTEM_VERSION 15)
#set (UNIX True)
set (APPLE True)
set (IOS True)
# Required as of cmake 2.8.10
set (CMAKE_OSX_DEPLOYMENT_TARGET "" CACHE STRING "Force unset of the deployment target for iOS" FORCE)
# Determine the cmake host system version so we know where to find the iOS SDKs
#find_program (CMAKE_UNAME uname /bin /usr/bin /usr/local/bin)
#if (CMAKE_UNAME)
# exec_program(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
# string (REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" DARWIN_MAJOR_VERSION "${CMAKE_HOST_SYSTEM_VERSION}")
#endif (CMAKE_UNAME)
# Force the compilers to gcc for iOS
# include (CMakeForceCompiler)
# set (MAKE_C_COMPILER "/usr/bin/gcc Apple")
# set (CMAKE_CXX_COMPILER "/usr/bin/g++ Apple")
#set(CMAKE_AR ar CACHE FILEPATH "" FORCE)
# Skip the platform compiler checks for cross compiling
# set (CMAKE_CXX_COMPILER_WORKS TRUE)
# set (CMAKE_C_COMPILER_WORKS TRUE)
# All iOS/Darwin specific settings - some may be redundant
set (CMAKE_SHARED_LIBRARY_PREFIX "lib")
set (CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
set (CMAKE_SHARED_MODULE_PREFIX "lib")
set (CMAKE_SHARED_MODULE_SUFFIX ".so")
# set (CMAKE_MODULE_EXISTS 1)
#set (CMAKE_DL_LIBS "")
#set (CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ")
#set (CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ")
#set (CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
#set (CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")
# Hidden visibilty is required for cxx on iOS
# set (CMAKE_C_FLAGS_INIT "")
# set (CMAKE_CXX_FLAGS_INIT "-fvisibility=hidden -fvisibility-inlines-hidden")
#set (CMAKE_C_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
#set (CMAKE_CXX_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}")
#set (CMAKE_PLATFORM_HAS_INSTALLNAME 1)
#set (CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -headerpad_max_install_names")
#set (CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -headerpad_max_install_names")
#set (CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,")
#set (CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,")
#set (CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a")
# Setup iOS platform unless specified manually with IOS_PLATFORM
if (NOT DEFINED IOS_PLATFORM)
set (IOS_PLATFORM "OS")
endif (NOT DEFINED IOS_PLATFORM)
set (IOS_PLATFORM ${IOS_PLATFORM} CACHE STRING "Type of iOS Platform")
# Setup building for arm64 or not
if (NOT DEFINED BUILD_ARM64)
set (BUILD_ARM64 true)
endif (NOT DEFINED BUILD_ARM64)
set (BUILD_ARM64 ${BUILD_ARM64} CACHE STRING "Build arm64 arch or not")
# Check the platform selection and setup for developer root
if (${IOS_PLATFORM} STREQUAL "OS")
set (IOS_PLATFORM_LOCATION "iPhoneOS.platform")
# This causes the installers to properly locate the output libraries
set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos")
elseif (${IOS_PLATFORM} STREQUAL "SIMULATOR")
set (SIMULATOR true)
set (IOS_PLATFORM_LOCATION "iPhoneSimulator.platform")
# This causes the installers to properly locate the output libraries
set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphonesimulator")
elseif (${IOS_PLATFORM} STREQUAL "SIMULATOR64")
set (SIMULATOR true)
set (IOS_PLATFORM_LOCATION "iPhoneSimulator.platform")
# This causes the installers to properly locate the output libraries
set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphonesimulator")
else (${IOS_PLATFORM} STREQUAL "OS")
message (FATAL_ERROR "Unsupported IOS_PLATFORM value selected. Please choose OS or SIMULATOR")
endif (${IOS_PLATFORM} STREQUAL "OS")
# Setup iOS developer location unless specified manually with CMAKE_IOS_DEVELOPER_ROOT
# Note Xcode 4.3 changed the installation location, choose the most recent one available
# exec_program(/usr/bin/xcode-select ARGS -print-path OUTPUT_VARIABLE CMAKE_XCODE_DEVELOPER_DIR)
# set (XCODE_POST_43_ROOT "${CMAKE_XCODE_DEVELOPER_DIR}/Platforms/${IOS_PLATFORM_LOCATION}/Developer")
# set (XCODE_PRE_43_ROOT "/Developer/Platforms/${IOS_PLATFORM_LOCATION}/Developer")
#if (NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT)
# if (EXISTS ${XCODE_POST_43_ROOT})
# set (CMAKE_IOS_DEVELOPER_ROOT ${XCODE_POST_43_ROOT})
# elseif(EXISTS ${XCODE_PRE_43_ROOT})
# set (CMAKE_IOS_DEVELOPER_ROOT ${XCODE_PRE_43_ROOT})
# endif (EXISTS ${XCODE_POST_43_ROOT})
#endif (NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT)
#set (CMAKE_IOS_DEVELOPER_ROOT ${CMAKE_IOS_DEVELOPER_ROOT} CACHE PATH "Location of iOS Platform")
# Find and use the most recent iOS sdk unless specified manually with CMAKE_IOS_SDK_ROOT
#if (NOT DEFINED CMAKE_IOS_SDK_ROOT)
# file (GLOB _CMAKE_IOS_SDKS "${CMAKE_IOS_DEVELOPER_ROOT}/SDKs/*")
# if (_CMAKE_IOS_SDKS)
# list (SORT _CMAKE_IOS_SDKS)
# list (REVERSE _CMAKE_IOS_SDKS)
# list (GET _CMAKE_IOS_SDKS 0 CMAKE_IOS_SDK_ROOT)
# else (_CMAKE_IOS_SDKS)
# message (FATAL_ERROR "No iOS SDK's found in default search path ${CMAKE_IOS_DEVELOPER_ROOT}. Manually set CMAKE_IOS_SDK_ROOT or install the iOS SDK.")
# endif (_CMAKE_IOS_SDKS)
# message (STATUS "Toolchain using default iOS SDK: ${CMAKE_IOS_SDK_ROOT}")
#endif (NOT DEFINED CMAKE_IOS_SDK_ROOT)
#set (CMAKE_IOS_SDK_ROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Location of the selected iOS SDK")
# Set the sysroot default to the most recent SDK
#set (CMAKE_OSX_SYSROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Sysroot used for iOS support")
# set (CMAKE_OSX_SYSROOT ${CMAKE_OSX_SYSROOT})
#set(CMAKE_OSX_SYSROOT "$(xcrun --sdk ${IOS_PLATFORM_LOCATION} --show-sdk-path)")
# set the architecture for iOS
#if (NOT DEFINED ARCH)
# set (ARCH armv7)
#endif()
set (IOS_ARCH ${ARCH})
#set (CMAKE_OSX_ARCHITECTURES ${IOS_ARCH} CACHE STRING "Build architecture for iOS")
set(CMAKE_OSX_ARCHITECTURES arm64)
message(STATUS "ios arch: ${IOS_ARCH}")
# Set the find root to the iOS developer roots and to user defined paths
#set (CMAKE_FIND_ROOT_PATH ${CMAKE_IOS_DEVELOPER_ROOT} ${CMAKE_IOS_SDK_ROOT} ${CMAKE_PREFIX_PATH} CACHE STRING "iOS find search path root")
# default to searching for frameworks first
# set (CMAKE_FIND_FRAMEWORK FIRST)
# set up the default search directories for frameworks
# set (CMAKE_SYSTEM_FRAMEWORK_PATH
# ${CMAKE_IOS_SDK_ROOT}/System/Library/Frameworks
# ${CMAKE_IOS_SDK_ROOT}/System/Library/PrivateFrameworks
# ${CMAKE_IOS_SDK_ROOT}/Developer/Library/Frameworks
#)
message(STATUS "IOS CMAKE conf finished")

View file

@ -14,7 +14,7 @@ Pod::Spec.new do |s|
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h, Classes/*.h, ../shared_external/ios/libs/monero/include/src/**/*.h, ../shared_external/ios/libs/monero/include/contrib/**/*.h, ../shared_external/ios/libs/monero/include/../shared_external/ios/**/*.h'
s.dependency 'Flutter'
s.dependency 'cw_shared_external'
# s.dependency 'cw_shared_external'
s.platform = :ios, '10.0'
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS' => 'arm64', 'ENABLE_BITCODE' => 'NO' }
s.swift_version = '5.0'

View file

@ -8,6 +8,20 @@ PODS:
- Flutter
- ReachabilitySwift
- CryptoSwift (1.8.2)
- cw_zano (0.0.1):
- cw_zano/Boost (= 0.0.1)
- cw_zano/OpenSSL (= 0.0.1)
- cw_zano/Sodium (= 0.0.1)
- cw_zano/Zano (= 0.0.1)
- Flutter
- cw_zano/Boost (0.0.1):
- Flutter
- cw_zano/OpenSSL (0.0.1):
- Flutter
- cw_zano/Sodium (0.0.1):
- Flutter
- cw_zano/Zano (0.0.1):
- Flutter
- device_display_brightness (0.0.1):
- Flutter
- device_info_plus (0.0.1):
@ -94,6 +108,8 @@ PODS:
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- sp_scanner (0.0.1):
- Flutter
- SwiftProtobuf (1.26.0)
- SwiftyGif (5.4.5)
- Toast (4.1.1)
@ -113,6 +129,7 @@ DEPENDENCIES:
- barcode_scan2 (from `.symlinks/plugins/barcode_scan2/ios`)
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
- CryptoSwift
- cw_zano (from `.symlinks/plugins/cw_zano/ios`)
- device_display_brightness (from `.symlinks/plugins/device_display_brightness/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- devicelocale (from `.symlinks/plugins/devicelocale/ios`)
@ -132,6 +149,7 @@ DEPENDENCIES:
- sensitive_clipboard (from `.symlinks/plugins/sensitive_clipboard/ios`)
- share_plus (from `.symlinks/plugins/share_plus/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sp_scanner (from `.symlinks/plugins/sp_scanner/ios`)
- uni_links (from `.symlinks/plugins/uni_links/ios`)
- UnstoppableDomainsResolution (~> 4.0.0)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
@ -159,6 +177,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/barcode_scan2/ios"
connectivity_plus:
:path: ".symlinks/plugins/connectivity_plus/ios"
cw_zano:
:path: ".symlinks/plugins/cw_zano/ios"
device_display_brightness:
:path: ".symlinks/plugins/device_display_brightness/ios"
device_info_plus:
@ -197,6 +217,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/share_plus/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
sp_scanner:
:path: ".symlinks/plugins/sp_scanner/ios"
uni_links:
:path: ".symlinks/plugins/uni_links/ios"
url_launcher_ios:
@ -211,6 +233,7 @@ SPEC CHECKSUMS:
BigInt: f668a80089607f521586bbe29513d708491ef2f7
connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d
CryptoSwift: c63a805d8bb5e5538e88af4e44bb537776af11ea
cw_zano: 6f8036f4f70a7ae2f04cb33d6f88ad3c68884365
device_display_brightness: 1510e72c567a1f6ce6ffe393dcd9afd1426034f7
device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6
devicelocale: b22617f40038496deffba44747101255cee005b0
@ -227,7 +250,7 @@ SPEC CHECKSUMS:
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
Protobuf: fb2c13674723f76ff6eede14f78847a776455fa2
@ -237,13 +260,14 @@ SPEC CHECKSUMS:
sensitive_clipboard: d4866e5d176581536c27bb1618642ee83adca986
share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
sp_scanner: eaa617fa827396b967116b7f1f43549ca62e9a12
SwiftProtobuf: 5e8349171e7c2f88f5b9e683cb3cb79d1dc780b3
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e
uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
UnstoppableDomainsResolution: c3c67f4d0a5e2437cb00d4bd50c2e00d6e743841
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
wakelock_plus: 8b09852c8876491e4b6d179e17dfe2a0b5f60d47
wakelock_plus: 78ec7c5b202cab7761af8e2b2b3d0671be6c4ae1
workmanager: 0afdcf5628bbde6924c21af7836fed07b42e30e6
PODFILE CHECKSUM: a2fe518be61cdbdc5b0e2da085ab543d556af2d3

View file

@ -464,7 +464,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = 32J6BB6VUS;
DEVELOPMENT_TEAM = 562DC258Q6;
DISABLED_ARCHS = x86_64;
ENABLE_BITCODE = NO;
EXCLUDED_SOURCE_FILE_NAMES = "";
@ -483,7 +483,7 @@
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 1.0.1;
PRODUCT_BUNDLE_IDENTIFIER = "com.fotolockr.cakewallet";
PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
@ -610,7 +610,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = 32J6BB6VUS;
DEVELOPMENT_TEAM = 562DC258Q6;
DISABLED_ARCHS = x86_64;
ENABLE_BITCODE = NO;
EXCLUDED_SOURCE_FILE_NAMES = "";
@ -629,7 +629,7 @@
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 1.0.1;
PRODUCT_BUNDLE_IDENTIFIER = "com.fotolockr.cakewallet";
PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@ -648,7 +648,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = 32J6BB6VUS;
DEVELOPMENT_TEAM = 562DC258Q6;
DISABLED_ARCHS = x86_64;
ENABLE_BITCODE = NO;
EXCLUDED_SOURCE_FILE_NAMES = "";
@ -667,7 +667,7 @@
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 1.0.1;
PRODUCT_BUNDLE_IDENTIFIER = "com.fotolockr.cakewallet";
PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;

View file

@ -5,8 +5,8 @@
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.72.0
BOOST_LIBS="random regex graph random chrono thread filesystem system date_time locale serialization program_options"
BOOST_VERSION=1.76.0
BOOST_LIBS="random regex graph random chrono thread filesystem system date_time locale serialization program_options thread timer atomic"
echo "============================ Boost ============================"

102
scripts/ios/build_zano.sh Executable file
View file

@ -0,0 +1,102 @@
#!/bin/sh
. ./config.sh
ZANO_URL="https://github.com/hyle-team/zano.git"
ZANO_DIR_PATH="${EXTERNAL_IOS_SOURCE_DIR}/zano"
ZANO_VERSION=9f0fa8a390e10fc0525a01a9409e52765fb93e07
IOS_TOOLCHAIN_DIR_PATH="${EXTERNAL_IOS_SOURCE_DIR}/ios_toolchain"
IOS_TOOLCHAIN_URL="https://github.com/leetal/ios-cmake.git"
IOS_TOOLCHAIN_VERSION=06465b27698424cf4a04a5ca4904d50a3c966c45
export NO_DEFAULT_PATH
BUILD_TYPE=release
PREFIX=${EXTERNAL_IOS_DIR}
DEST_LIB_DIR=${EXTERNAL_IOS_LIB_DIR}/zano
DEST_INCLUDE_DIR=${EXTERNAL_IOS_INCLUDE_DIR}/zano
ZANO_MOBILE_IOS_BUILD_FOLDER_ARM64="${ZANO_DIR_PATH}/build"
ZANO_MOBILE_IOS_INSTALL_FOLDER_ARM64="${ZANO_DIR_PATH}/install"
echo "ZANO_URL: $ZANO_URL"
echo "IOS_TOOLCHAIN_DIR_PATH: $IOS_TOOLCHAIN_DIR_PATH"
echo "ZANO_MOBILE_IOS_BUILD_FOLDER_ARM64: $ZANO_MOBILE_IOS_BUILD_FOLDER_ARM64"
echo "ZANO_MOBILE_IOS_INSTALL_FOLDER_ARM64: $ZANO_MOBILE_IOS_INSTALL_FOLDER_ARM64"
echo "PREFIX: $PREFIX"
echo "DEST_LIB_DIR: $DEST_LIB_DIR"
echo "DEST_INCLUDE_DIR: $DEST_INCLUDE_DIR"
echo "ZANO_DIR_PATH: $ZANO_DIR_PATH"
echo "Cloning ios_toolchain from - $IOS_TOOLCHAIN_URL to - $IOS_TOOLCHAIN_DIR_PATH"
git clone $IOS_TOOLCHAIN_URL $IOS_TOOLCHAIN_DIR_PATH
cd $IOS_TOOLCHAIN_DIR_PATH
git checkout $IOS_TOOLCHAIN_VERSION
git submodule update --init --force
cd ..
echo "Cloning zano from - $ZANO_URL to - $ZANO_DIR_PATH"
git clone $ZANO_URL $ZANO_DIR_PATH
cd $ZANO_DIR_PATH
git checkout $ZANO_VERSION
git submodule update --init --force
mkdir -p build
cd ..
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ -z $INSTALL_PREFIX ]; then
INSTALL_PREFIX=${ROOT_DIR}/haven
fi
export CMAKE_INCLUDE_PATH="${PREFIX}/include"
export CMAKE_LIBRARY_PATH="${PREFIX}/lib"
-Wno-enum-constexpr-conversion
rm -rf ${ZANO_MOBILE_IOS_BUILD_FOLDER_ARM64} > /dev/null
rm -rf ${ZANO_MOBILE_IOS_INSTALL_FOLDER_ARM64} > /dev/null
echo "CMAKE_INCLUDE_PATH: $CMAKE_INCLUDE_PATH"
echo "CMAKE_LIBRARY_PATH: $CMAKE_LIBRARY_PATH"
echo "ROOT_DIR: $ROOT_DIR"
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_TOOLCHAIN_FILE="${IOS_TOOLCHAIN_DIR_PATH}/ios.toolchain.cmake" \
-DPLATFORM=OS64 \
-S"${ZANO_DIR_PATH}" \
-B"${ZANO_MOBILE_IOS_BUILD_FOLDER_ARM64}" \
-GXcode \
-DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_INSTALL_PREFIX="${ZANO_MOBILE_IOS_INSTALL_FOLDER_ARM64}" \
-DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO \
-DCMAKE_CXX_FLAGS="-Wno-enum-constexpr-conversion" \
-DDISABLE_TOR=TRUE
# -DCMAKE_OSX_ARCHITECTURES="arm64"
# -DCMAKE_IOS_INSTALL_COMBINED=YES
if [ $? -ne 0 ]; then
echo "Failed to perform command"
exit 1
fi
cmake --build "${ZANO_MOBILE_IOS_BUILD_FOLDER_ARM64}" --config $BUILD_TYPE --target install -- -j 4
if [ $? -ne 0 ]; then
echo "Failed to perform command"
exit 1
fi
#only for arm64
#mkdir -p $DEST_LIB_DIR
#mkdir -p $DEST_INCLUDE_DIR
#echo "DEST_INCLUDE_DIR: ${DEST_INCLUDE_DIR}"
#echo "DEST_LIB_DIR: ${DEST_LIB_DIR}"
#cp ${ZANO_DIR_PATH}/lib-armv8-a/* $DEST_LIB_DIR
#cp ${ZANO_DIR_PATH}/src/wallet/plain_wallet_api.h $DEST_INCLUDE_DIR

8
scripts/ios/build_zano_all.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
. ./config.sh
./install_missing_headers.sh
./build_openssl.sh
./build_boost.sh
./build_sodium.sh
./build_zano.sh