add and update macos build scripts, update build readme, gitignore macos project.pbxproj

Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
This commit is contained in:
Philemon Ukane 2024-08-03 06:20:27 +01:00 committed by JoeGruff
parent 0693d25413
commit 44a2355d20
22 changed files with 72 additions and 27 deletions

2
.gitignore vendored
View file

@ -9,6 +9,7 @@
.history
.svn/
.fvm/
.fvmrc
# IntelliJ related
*.iml
@ -171,6 +172,7 @@ macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
macos/Runner/Configs/AppInfo.xcconfig
macos/Runner.xcodeproj/project.pbxproj
integration_test/playground.dart

View file

@ -112,7 +112,7 @@ Then run configuration script for setup app name, app icon and etc:
`$ ./app_config.sh`
Build the Monero libraries and their dependencies:
Build the required libraries and their dependencies:
`$ ./build_all.sh`
@ -134,7 +134,7 @@ Next, we must generate key properties based on the secure keystore you generated
**REMINDER:** The *above* command will **not** succeed unless you replaced the `storePassword` and `keyPassword` variables with the correct passwords for your keystore.
Then we need to generate localization files.
Then we need to generate localization files. If this command fails, add `--force` flag and run it again.
`$ dart run tool/generate_localization.dart`

View file

@ -66,11 +66,11 @@ Please pick what app you want to build: cakewallet or monero.com.
Then run configuration script for setup app name, app icon and etc:
`$ ./app_config.sh`
`$ ./app_config.sh`
Build the Monero libraries and their dependencies:
Build the required libraries and their dependencies:
`$ ./build_monero_all.sh`
`$ ./build_all.sh`
It is now time to change back to the base directory of the Cake Wallet source code:
@ -84,9 +84,15 @@ Your Cake Wallet binary will be built with cryptographic salts, which are used f
`$ dart run tool/generate_new_secrets.dart`
Then we need to generate localization files and mobx models.
If the command above fails, add `--force` flag and run it again.
`$ ./configure_cake_wallet.sh ios`
Then we need to generate localization files. If this command fails, add `--force` flag and run it again.
`$ flutter packages pub run tool/generate_localization.dart`
Finally build mobx models for the app:
`$ ./model_generator.sh`
### 8. Build!

View file

@ -70,9 +70,9 @@ Then run configuration script for setup app name, app icon and etc:
`$ ./app_config.sh`
Build the Monero libraries and their dependencies:
Build the required libraries and their dependencies:
`$ ./build_monero_all.sh`
`$ ./build_all.sh`
If you be needed to build universal monero lib, then it will require additional steps. Steps for build universal monero lib on mac with Apple Silicon (arm64):
@ -95,9 +95,15 @@ Your Cake Wallet binary will be built with cryptographic salts, which are used f
`$ dart run tool/generate_new_secrets.dart`
Then we need to generate localization files and mobx models.
If the command above fails, add `--force` flag and run it again.
`$ ./configure_cake_wallet.sh macos`
Then we need to generate localization files. If this command fails, add `--force` flag and run it again.
`$ flutter packages pub run tool/generate_localization.dart`
Finally build mobx models for the app:
`$ ./model_generator.sh`
### 8. Build!

View file

@ -11,6 +11,7 @@ case $APP_ANDROID_TYPE in
"monero.com") $DIR/build_monero_all.sh ;;
"cakewallet") $DIR/build_monero_all.sh
$DIR/build_haven_all.sh
$DIR/build_mwebd.sh ;;
$DIR/build_mwebd.sh
$DIR/build_decred.sh ;;
"haven") $DIR/build_haven_all.sh ;;
esac

View file

@ -6,4 +6,3 @@
./build_sodium.sh
./build_zmq.sh
./build_haven.sh
./build_decred.sh

View file

@ -9,6 +9,6 @@ DIR=$(dirname "$0")
case $APP_IOS_TYPE in
"monero.com") $DIR/build_monero_all.sh ;;
"cakewallet") $DIR/build_monero_all.sh && $DIR/build_haven.sh && $DIR/build_mwebd.sh ;;
"cakewallet") $DIR/build_monero_all.sh && $DIR/build_haven.sh && $DIR/build_mwebd.sh && $DIR/build_decred.sh ;;
"haven") $DIR/build_haven_all.sh ;;
esac

View file

@ -14,8 +14,8 @@ cd $LIBWALLET_PATH
git checkout $LIBWALLET_VERSION
SYSROOT=`xcrun --sdk iphoneos --show-sdk-path`
CLANG="clang -isysroot ${SYSROOT}"
CLANGXX="clang++ -isysroot ${SYSROOT}"
CLANG="clang -target arm64-apple-ios -isysroot ${SYSROOT}"
CLANGXX="clang++ -target arm64-apple-ios -isysroot ${SYSROOT}"
if [ -e ./build ]; then
rm -fr ./build

View file

@ -1,4 +1,4 @@
g#!/bin/sh
#!/bin/sh
. ./config.sh

View file

@ -1,3 +1,3 @@
#!/bin/sh
./build_monero_all.sh universal
./build_monero_all.sh universal && $DIR/build_decred.sh

View file

@ -1,4 +1,5 @@
#!/bin/sh
. ./config.sh
. ./build_boost_common.sh
build_boost_arm64

View file

@ -35,6 +35,10 @@ BOOST_B2_LINKFLAGS_X86_64="-arch x86_64"
BOOST_B2_BUILD_DIR_X86_64=macos-x86_64
build_boost_init_common() {
echo "
============================ BOOST ============================
"
CXXFLAGS=$1
CFLAGS=$2
LINKFLAGS=$3
@ -157,8 +161,8 @@ build_boost_compile_universal() {
build_boost_install_common() {
ARCH=$1
LIB_DIR=""
mkdir $EXTERNAL_MACOS_LIB_DIR
mkdir $EXTERNAL_MACOS_INCLUDE_DIR
mkdir -p $EXTERNAL_MACOS_LIB_DIR
mkdir -p $EXTERNAL_MACOS_INCLUDE_DIR
case $ARCH in
arm64) LIB_DIR="${BOOST_B2_BUILD_DIR_ARM_64}/stage/lib";;

View file

@ -3,7 +3,7 @@
. ./config.sh
LIBWALLET_PATH="${EXTERNAL_MACOS_SOURCE_DIR}/libwallet"
LIBWALLET_URL="https://github.com/itswisdomagain/libwallet.git"
LIBWALLET_URL="https://github.com/decred/libwallet.git"
LIBWALLET_VERSION="v1.0.4"
echo "======================= DECRED LIBWALLET ========================="
@ -13,7 +13,7 @@ if [ -e $LIBWALLET_PATH ]; then
rm -fr $LIBWALLET_PATH
fi
mkdir -p $LIBWALLET_PATH
git clone $LIBWALLET_URL $LIBWALLET_PATH --branch cgo
git clone $LIBWALLET_URL $LIBWALLET_PATH
cd $LIBWALLET_PATH
git checkout $LIBWALLET_VERSION

View file

@ -6,6 +6,10 @@ EXPAT_VERSION=R_2_4_8
EXPAT_HASH="3bab6c09bbe8bf42d84b81563ddbcf4cca4be838"
EXPAT_SRC_DIR=${EXTERNAL_MACOS_SOURCE_DIR}/libexpat
echo "
============================ EXPAT ============================
"
git clone https://github.com/libexpat/libexpat.git -b ${EXPAT_VERSION} ${EXPAT_SRC_DIR}
cd $EXPAT_SRC_DIR
test `git rev-parse HEAD` = ${EXPAT_HASH} || exit 1

View file

@ -11,6 +11,10 @@ DEST_LIB_DIR=${EXTERNAL_MACOS_LIB_DIR}/monero
DEST_INCLUDE_DIR=${EXTERNAL_MACOS_INCLUDE_DIR}/monero
ARCH=`uname -m`
echo "
============================ MONERO ============================
"
echo "Cloning monero from - $MONERO_URL to - $MONERO_DIR_PATH"
git clone $MONERO_URL $MONERO_DIR_PATH
cd $MONERO_DIR_PATH

View file

@ -1,4 +1,5 @@
#!/bin/sh
. ./config.sh
. ./build_openssl_common.sh
build_openssl_arm64

View file

@ -13,7 +13,9 @@ build_openssl_init_common() {
# Use 1.1.1s because of https://github.com/openssl/openssl/issues/18720
OPENSSL_VERSION="1.1.1s"
echo "============================ OpenSSL ============================"
echo "
============================ OPENSSL ============================
"
cd $EXTERNAL_MACOS_SOURCE_DIR
curl -O https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz

View file

@ -5,7 +5,9 @@
SODIUM_PATH="${EXTERNAL_MACOS_SOURCE_DIR}/libsodium"
SODIUM_URL="https://github.com/jedisct1/libsodium.git"
echo "============================ SODIUM ============================"
echo "
============================ SODIUM ============================
"
echo "Cloning SODIUM from - $SODIUM_URL"
git clone $SODIUM_URL $SODIUM_PATH --branch stable

View file

@ -7,7 +7,10 @@ UNBOUND_HASH="cbed768b8ff9bfcf11089a5f1699b7e5707f1ea5"
UNBOUND_URL="https://www.nlnetlabs.nl/downloads/unbound/unbound-${UNBOUND_VERSION}.tar.gz"
UNBOUND_DIR_PATH="${EXTERNAL_MACOS_SOURCE_DIR}/unbound-1.16.2"
echo "============================ Unbound ============================"
echo "
============================ Unbound ============================
"
rm -rf ${UNBOUND_DIR_PATH}
git clone https://github.com/NLnetLabs/unbound.git -b ${UNBOUND_VERSION} ${UNBOUND_DIR_PATH}
cd $UNBOUND_DIR_PATH

View file

@ -5,7 +5,9 @@
ZMQ_PATH="${EXTERNAL_MACOS_SOURCE_DIR}/libzmq"
ZMQ_URL="https://github.com/zeromq/libzmq.git"
echo "============================ ZMQ ============================"
echo "
============================ ZMQ ============================
"
echo "Cloning ZMQ from - $ZMQ_URL"
git clone $ZMQ_URL $ZMQ_PATH

6
scripts/macos/gen.sh Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
. ./gen_common.sh
ARCH=`uname -m`
gen $ARCH

View file

@ -15,6 +15,8 @@ gen_podspec() {
gen_project() {
ARCH=$1
CW_DIR="`pwd`/../../macos/Runner.xcodeproj"
BASE_FILENAME="project_base.pbxproj"
BASE_FILE_PATH="${CW_DIR}/${BASE_FILENAME}"
DEFAULT_FILENAME="project.pbxproj"
DEFAULT_FILE_PATH="${CW_DIR}/${DEFAULT_FILENAME}"
universal_sed "s/ARCHS =.*/ARCHS = \"${ARCH}\";/g" $DEFAULT_FILE_PATH
@ -24,4 +26,4 @@ gen() {
ARCH=$1
gen_podspec "${ARCH}"
gen_project "${ARCH}"
}
}