mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39:51 +00:00
Dashboard desktop view (#737)
* Add build scripts for macOS. Add macos for cw_monero plugin. Add macos proj to the application. * - Update Flutter secure storage to work with macos - Enable uni links only on Mobile - Update devcelocale to work with macos * Add network access to mac * Change Dashboard view on desktop size screens * Add on Tap to desktop_action_button.dart Remove unused functions * Fix arch match for monero lib for darwin x86_64 -> x86-64 * Add Bundle ID in entitlements files through app config script * Update deployment target to 10.13 * Revert back to Cake fork for secure storage * Revert back to Cake fork for secure storage * Revert mac os version * Revert mac os version * Add platform channel specific code for mac os * Add desktop sidebar * [skip ci] Add desktop sidebar * [skip ci] Add desktop sidebar * - Remove legacy migration from macos - Remove wake lock native code and just use the ready made package * Remove wake lock native code and just use the ready made package * Remove unstoppable domain from macos since it's not supported * Temporarily fetch unstoppable domains only on mobile * refactor desktop settings sidebar * Ignore increasing brightness for non-mobile platforms * Add Wallet selection dropdown to dashboard desktop view * Generate MacOS icons * localize settings * fix dashboard sidebar and responsive utils * Change Mac os app name and bundle id * Fix exchange page as fullScreenDialog * Remove constants * - Refactor onRamper to have a single point of modification - Enlarge initial app size - update Flutter and Packages * Add pubspec.lock and Podfile.lock to gitignore * Remove Podfile.lock from cache * Fix bug on sidebar reset * Fix issues from code review * [skip ci] reformat desktop dashboard * [skip ci] reformat desktop dashboard * Revert removing .lock files * Revert changes in .gitignore * [skip ci] remove .project changes * [skip ci] remove .project changes * Separate Dashboard desktop view from mobile view * constraint images and pincoded box * Remove drawer from mac os * - Listen to keyboard events in PIN screen - Fix PIN buttons style * Fix desktop nav bar UI * Add Marketplace to dashboard view * Update trailing icon to open transaction page * Update widget contraints * Add empty trailing to center page title on desktop * Refresh desktop dashboard actions on wallet change * Change ionia welcome page animation * Fix Constrained width screens UI * Refactor sidebar state management * remove empty line * Add max width constrain to Welcome page * Change Exchange page UI depending on platform * - Change design/paddings for Send page on desktop view - Make AddTemplateButton instead of having it duplicated in send/exchange * Fix Desktop dashboard actions background color * Constrain primary Buttons width * Make side menu items toggle back to dashboard * Add padding to support page * Add width constraints to desktop dashboard * Fix UI issues, paddings and alignments * Rename misleading variable Change initial mac window size * Fix wallet create in settings * remove unnecessary code * remove unnecessary code * Remove duplicated constrains * - Use close icon on main screens - Minor UI fixes * fix pageview controller reset index * Add create and restore wallet options to dropdown menu * Fix desktop background color and address book view issues * Fix input field * Add onFieldSubmitted to allow "enter" button interaction * Fix issue from code review * Fix Popup width constraint and add focus orders * Fix variable name * Fix issues from code review * refactor dropdown items * Fix alignment in create and restore wallet screens * Fix dropdown change state bug Hide scanner for desktop * remove space * override navbar with desktopnavbar * Remove autofocus * remove unused code * Fix ionia input field alignment * Replace removed code * Add app lock feature on mac * Add assertion to avoid null * Add Nano currency image * Enable adding contact from send screen * Fix UI issues Add missing translation * pop only PIN screen after successful auth * Add back wallet settings page to desktop settings actions * Fix Navigation animation for settings screens * Fixate MobX version to fix restore issue * CW-324 Refresh current settings page if wallet changed (#811) * Fix refresh current settings page if wallet changed * Fix refresh current settings page if wallet changed * Refresh Wallet Seeds/Keys List upon wallet change --------- Co-authored-by: OmarHatem <omarh.ismail1@gmail.com> * Remove navigation workaround for duplicate key, and fix the issue by handling creation/disposing of global key (#840) * Cw 323 add wallet list to settings on mac (#843) * Remove navigation workaround for duplicate key, and fix the issue by handling creation/disposing of global key * - Register Wallet List as singleton in Desktop to be modify the same instance from settings and dropdown - General Fixes and Enhancements * Fix Changing/Restoring wallet from settings * Fix Create wallet not showing seeds screens if launched from settings * Add max width constraint for Alerts * - Add Desktop API keys - Fix Change back up password issue - Fix Popup width * Sync Mac with latest main updates * Swap Transactions icon with lock icon * Save backup file locally on desktop * Sync with latest main updates * Fix Navigation issues with anonpay * Update macos build version * Remove deprecated custom wake lock code for Android * Remove Legacy CryptoSwift package from MacOS * - Refactor Payfura page code - Add OnRamper new configs to onramper_buy_provider.dart - Fix Conflicts with main * Updated device locale package * Update android tools * Revert changes and update only gradle version * Downgrade android tools version * Update gradle version * Update package/gradle/plugin version * - Fixate device locale version - Downgrade gradle version * Update kotlin version * Update gradle version * Trial for a custom fork from devicelocale * Fixate shared preferences package version * Revert gradle version * Revert kotlin version * Downgrade gradle version * Downgrade gradle version * Repair cache and clean before build * Fixate flutter version * update google services version * revert google services version * Force shared pref android version * Override shared prefs android package version * Override shared prefs android package [skip ci] --------- Co-authored-by: M <m@cakewallet.com> Co-authored-by: Godwin Asuquo <godilite@gmail.com> Co-authored-by: Godwin Asuquo <41484542+godilite@users.noreply.github.com>
This commit is contained in:
parent
5c4fd78951
commit
c5477e4f9e
231 changed files with 9946 additions and 2653 deletions
34
scripts/macos/app_config.sh
Executable file
34
scripts/macos/app_config.sh
Executable file
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
|
||||
CAKEWALLET="cakewallet"
|
||||
DIR=`pwd`
|
||||
|
||||
if [ -z "$APP_MACOS_TYPE" ]; then
|
||||
echo "Please set APP_MACOS_TYPE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd ../.. # go to root
|
||||
cp -rf ./macos/Runner/InfoBase.plist ./macos/Runner/Info.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier ${APP_MACOS_BUNDLE_ID}" ./macos/Runner/Info.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString ${APP_MACOS_VERSION}" ./macos/Runner/Info.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${APP_MACOS_BUILD_NUMBER}" ./macos/Runner/Info.plist
|
||||
|
||||
# Fill entitlements Bundle ID
|
||||
cp -rf ./macos/Runner/DebugProfileBase.entitlements ./macos/Runner/DebugProfile.entitlements
|
||||
cp -rf ./macos/Runner/ReleaseBase.entitlements ./macos/Runner/Release.entitlements
|
||||
sed -i '' "s/\${BUNDLE_ID}/${APP_MACOS_BUNDLE_ID}/g" ./macos/Runner/DebugProfile.entitlements
|
||||
sed -i '' "s/\${BUNDLE_ID}/${APP_MACOS_BUNDLE_ID}/g" ./macos/Runner/Release.entitlements
|
||||
CONFIG_ARGS=""
|
||||
|
||||
case $APP_MACOS_TYPE in
|
||||
$CAKEWALLET)
|
||||
CONFIG_ARGS="--monero --bitcoin";; #--haven
|
||||
esac
|
||||
|
||||
cp -rf pubspec_description.yaml pubspec.yaml
|
||||
flutter pub get
|
||||
flutter pub run tool/generate_pubspec.dart
|
||||
flutter pub get
|
||||
flutter packages pub run tool/configure.dart $CONFIG_ARGS
|
||||
cd $DIR
|
39
scripts/macos/app_env.sh
Executable file
39
scripts/macos/app_env.sh
Executable file
|
@ -0,0 +1,39 @@
|
|||
#!/bin/sh
|
||||
|
||||
APP_MACOS_NAME=""
|
||||
APP_MACOS_VERSION=""
|
||||
APP_MACOS_BUILD_VERSION=""
|
||||
APP_MACOS_BUNDLE_ID=""
|
||||
|
||||
CAKEWALLET="cakewallet"
|
||||
|
||||
TYPES=($CAKEWALLET)
|
||||
APP_MACOS_TYPE=$CAKEWALLET
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
APP_MACOS_TYPE=$1
|
||||
fi
|
||||
|
||||
CAKEWALLET_NAME="Cake Wallet"
|
||||
CAKEWALLET_VERSION="1.0.1"
|
||||
CAKEWALLET_BUILD_NUMBER=11
|
||||
CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet"
|
||||
|
||||
if ! [[ " ${TYPES[*]} " =~ " ${APP_MACOS_TYPE} " ]]; then
|
||||
echo "Wrong app type."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case $APP_MACOS_TYPE in
|
||||
$CAKEWALLET)
|
||||
APP_MACOS_NAME=$CAKEWALLET_NAME
|
||||
APP_MACOS_VERSION=$CAKEWALLET_VERSION
|
||||
APP_MACOS_BUILD_NUMBER=$CAKEWALLET_BUILD_NUMBER
|
||||
APP_MACOS_BUNDLE_ID=$CAKEWALLET_BUNDLE_ID;;
|
||||
esac
|
||||
|
||||
export APP_MACOS_TYPE
|
||||
export APP_MACOS_NAME
|
||||
export APP_MACOS_VERSION
|
||||
export APP_MACOS_BUILD_NUMBER
|
||||
export APP_MACOS_BUNDLE_ID
|
3
scripts/macos/build_all.sh
Executable file
3
scripts/macos/build_all.sh
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
./build_monero_all.sh
|
4
scripts/macos/build_boost_arm64.sh
Executable file
4
scripts/macos/build_boost_arm64.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ./build_boost_common.sh
|
||||
build_boost_arm64
|
210
scripts/macos/build_boost_common.sh
Executable file
210
scripts/macos/build_boost_common.sh
Executable file
|
@ -0,0 +1,210 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ./config.sh
|
||||
|
||||
# Boost combined
|
||||
|
||||
BOOST_CXXFLAGS_COMBINED="-arch x86_64 -arch arm64"
|
||||
BOOST_CFLAGS_COMBINED="-arch x86_64 -arch arm64"
|
||||
BOOST_LINKFLAGS_COMBINED="-arch x86_64 -arch arm64"
|
||||
|
||||
# Boost arm64
|
||||
|
||||
BOOST_CXXFLAGS_ARM64="-arch arm64"
|
||||
BOOST_CFLAGS_ARM64="-arch arm64"
|
||||
BOOST_LINKFLAGS_ARM64="-arch arm64"
|
||||
|
||||
# Boost x86_64
|
||||
|
||||
BOOST_CXXFLAGS_X86_64="-arch x86_64"
|
||||
BOOST_CFLAGS_X86_64="-arch x86_64"
|
||||
BOOST_LINKFLAGS_X86_64="-arch x86_64"
|
||||
|
||||
# Boost B2 arm64
|
||||
|
||||
BOOST_B2_CXXFLAGS_ARM_64="-arch arm64"
|
||||
BOOST_B2_CFLAGS_ARM_64="-arch arm64"
|
||||
BOOST_B2_LINKFLAGS_ARM_64="-arch arm64"
|
||||
BOOST_B2_BUILD_DIR_ARM_64=macos-arm64
|
||||
|
||||
# Boost B2 x86_64
|
||||
|
||||
BOOST_B2_CXXFLAGS_X86_64="-arch x86_64"
|
||||
BOOST_B2_CFLAGS_X86_64="-arch x86_64"
|
||||
BOOST_B2_LINKFLAGS_X86_64="-arch x86_64"
|
||||
BOOST_B2_BUILD_DIR_X86_64=macos-x86_64
|
||||
|
||||
build_boost_init_common() {
|
||||
CXXFLAGS=$1
|
||||
CFLAGS=$2
|
||||
LINKFLAGS=$3
|
||||
BOOST_SRC_DIR=${EXTERNAL_MACOS_SOURCE_DIR}/boost_1_72_0
|
||||
BOOST_FILENAME=boost_1_72_0.tar.bz2
|
||||
BOOST_VERSION=1.72.0
|
||||
BOOST_FILE_PATH=${EXTERNAL_MACOS_SOURCE_DIR}/${BOOST_FILENAME}
|
||||
BOOST_SHA256="59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa143417cc660722"
|
||||
|
||||
if [ ! -e "$BOOST_FILE_PATH" ]; then
|
||||
curl -L http://downloads.sourceforge.net/project/boost/boost/${BOOST_VERSION}/${BOOST_FILENAME} > $BOOST_FILE_PATH
|
||||
fi
|
||||
|
||||
echo $BOOST_SHA256 *$BOOST_FILE_PATH | shasum -a 256 -c - || exit 1
|
||||
|
||||
cd $EXTERNAL_MACOS_SOURCE_DIR
|
||||
rm -rf $BOOST_SRC_DIR
|
||||
tar -xvf $BOOST_FILE_PATH -C $EXTERNAL_MACOS_SOURCE_DIR
|
||||
cd $BOOST_SRC_DIR
|
||||
./bootstrap.sh --with-toolset=clang-darwin cxxflags="${CXXFLAGS}" cflags="${CFLAGS}" linkflags="${LINKFLAGS}"
|
||||
}
|
||||
|
||||
build_boost_init_arm64() {
|
||||
CXXFLAGS="-arch arm64"
|
||||
CFLAGS="-arch arm64"
|
||||
LINKFLAGS="-arch arm64"
|
||||
build_boost_init_common "${CXXFLAGS}" "${CFLAGS}" "${LINKFLAGS}"
|
||||
}
|
||||
|
||||
build_boost_init_x86_64() {
|
||||
CXXFLAGS="-arch x86_64"
|
||||
CFLAGS="-arch x86_64"
|
||||
LINKFLAGS="-arch x86_64"
|
||||
build_boost_init_common "${CXXFLAGS}" "${CFLAGS}" "${LINKFLAGS}"
|
||||
}
|
||||
|
||||
build_boost_init_universal() {
|
||||
CXXFLAGS="-arch x86_64 -arch arm64"
|
||||
CFLAGS="-arch x86_64 -arch arm64"
|
||||
LINKFLAGS="-arch x86_64 -arch arm64"
|
||||
build_boost_init_common "${CXXFLAGS}" "${CFLAGS}" "${LINKFLAGS}"
|
||||
}
|
||||
|
||||
build_boost_compile_common() {
|
||||
ARCH=$1
|
||||
ABI=$2
|
||||
CXXFLAGS=$3
|
||||
CFLAGS=$4
|
||||
LINKFLAGS=$5
|
||||
FLAGS=$6
|
||||
BUILD_DIR=$7
|
||||
./b2 toolset=clang-darwin target-os=darwin architecture="${ARCH}" cxxflags="${CXXFLAGS}" cflags="${CFLAGS}" linkflags="${LINKFLAGS}" abi="${ABI}" "${FLAGS}" -a \
|
||||
--with-chrono \
|
||||
--with-date_time \
|
||||
--with-filesystem \
|
||||
--with-program_options \
|
||||
--with-regex \
|
||||
--with-serialization \
|
||||
--with-system \
|
||||
--with-thread \
|
||||
--with-locale \
|
||||
--build-dir=$BUILD_DIR \
|
||||
--stagedir=${BUILD_DIR}/stage \
|
||||
link=static
|
||||
}
|
||||
|
||||
build_boost_compile_arm64() {
|
||||
ARCH="arm"
|
||||
ABI="aapcs"
|
||||
CXXFLAGS="-arch arm64"
|
||||
CFLAGS="-arch arm64"
|
||||
LINKFLAGS="-arch arm64"
|
||||
FLAGS=""
|
||||
BUILD_DIR="macos-arm64"
|
||||
build_boost_compile_common "${ARCH}" "${ABI}" "${CXXFLAGS}" "${CFLAGS}" "${LINKFLAGS}" "${FLAGS}" "${BUILD_DIR}"
|
||||
}
|
||||
|
||||
build_boost_compile_x86_64() {
|
||||
ARCH="x86"
|
||||
ABI="sysv"
|
||||
CXXFLAGS="-arch x86_64"
|
||||
CFLAGS="-arch x86_64"
|
||||
LINKFLAGS="-arch x86_64"
|
||||
FLAGS="binary-format=mach-o"
|
||||
BUILD_DIR="macos-x86_64"
|
||||
build_boost_compile_common "${ARCH}" "${ABI}" "${CXXFLAGS}" "${CFLAGS}" "${LINKFLAGS}" "${FLAGS}" "${BUILD_DIR}"
|
||||
}
|
||||
|
||||
build_boost_compile_universal() {
|
||||
ARCHES=(arm x86)
|
||||
for ARCH in ${ARCHES[@]}; do
|
||||
ABI=""
|
||||
CXXFLAGS=""
|
||||
CFLAGS=""
|
||||
LINKFLAGS=""
|
||||
FLAGS=""
|
||||
BUILD_DIR=""
|
||||
|
||||
case $ARCH in
|
||||
arm)
|
||||
ABI="aapcs"
|
||||
CXXFLAGS="-arch arm64"
|
||||
CFLAGS="-arch arm64"
|
||||
LINKFLAGS="-arch arm64"
|
||||
FLAGS=""
|
||||
BUILD_DIR="macos-arm64";;
|
||||
x86)
|
||||
ABI="sysv"
|
||||
CXXFLAGS="-arch x86_64"
|
||||
CFLAGS="-arch x86_64"
|
||||
LINKFLAGS="-arch x86_64"
|
||||
FLAGS="binary-format=mach-o"
|
||||
BUILD_DIR="macos-x86_64"
|
||||
esac
|
||||
|
||||
build_boost_compile_common "${ARCH}" "${ABI}" "${CXXFLAGS}" "${CFLAGS}" "${LINKFLAGS}" "${FLAGS}" "${BUILD_DIR}"
|
||||
done
|
||||
}
|
||||
|
||||
build_boost_install_common() {
|
||||
ARCH=$1
|
||||
LIB_DIR=""
|
||||
mkdir $EXTERNAL_MACOS_LIB_DIR
|
||||
mkdir $EXTERNAL_MACOS_INCLUDE_DIR
|
||||
|
||||
case $ARCH in
|
||||
arm64) LIB_DIR="${BOOST_B2_BUILD_DIR_ARM_64}/stage/lib";;
|
||||
x86_64) LIB_DIR="${BOOST_B2_BUILD_DIR_X86_64}/stage/lib";;
|
||||
*) LIB_DIR="lib";;
|
||||
esac
|
||||
|
||||
cp -r ${LIB_DIR}/*.a ${EXTERNAL_MACOS_LIB_DIR}
|
||||
cp -r boost ${EXTERNAL_MACOS_INCLUDE_DIR}
|
||||
}
|
||||
|
||||
build_boost_install_arm64() {
|
||||
ARCH="arm64"
|
||||
build_boost_install_common $ARCH
|
||||
}
|
||||
|
||||
build_boost_install_x86_64() {
|
||||
ARCH="x86_64"
|
||||
build_boost_install_common $ARCH
|
||||
}
|
||||
|
||||
build_boost_install_universal() {
|
||||
mkdir lib
|
||||
|
||||
for blib in ${BOOST_B2_BUILD_DIR_ARM_64}/stage/lib/*.a; do
|
||||
lipo -create -arch arm64 $blib -arch x86_64 ${BOOST_B2_BUILD_DIR_X86_64}/stage/lib/$(basename $blib) -output lib/$(basename $blib);
|
||||
done
|
||||
|
||||
cp -r lib/* ${EXTERNAL_MACOS_LIB_DIR}
|
||||
cp -r boost ${EXTERNAL_MACOS_INCLUDE_DIR}
|
||||
}
|
||||
|
||||
build_boost_arm64() {
|
||||
build_boost_init_arm64
|
||||
build_boost_compile_arm64
|
||||
build_boost_install_arm64
|
||||
}
|
||||
|
||||
build_boost_x86_64() {
|
||||
build_boost_init_x86_64
|
||||
build_boost_compile_x86_64
|
||||
build_boost_install_x86_64
|
||||
}
|
||||
|
||||
build_boost_universal() {
|
||||
build_boost_init_universal
|
||||
build_boost_compile_universal
|
||||
build_boost_install_universal
|
||||
}
|
4
scripts/macos/build_boost_universal.sh
Executable file
4
scripts/macos/build_boost_universal.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ./build_boost_common.sh
|
||||
build_boost_universal
|
4
scripts/macos/build_boost_x86_64.sh
Executable file
4
scripts/macos/build_boost_x86_64.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ./build_boost_common.sh
|
||||
build_boost_x86_64
|
17
scripts/macos/build_expat.sh
Executable file
17
scripts/macos/build_expat.sh
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
|
||||
. ./config.sh
|
||||
|
||||
EXPAT_VERSION=R_2_4_8
|
||||
EXPAT_HASH="3bab6c09bbe8bf42d84b81563ddbcf4cca4be838"
|
||||
EXPAT_SRC_DIR=${EXTERNAL_MACOS_SOURCE_DIR}/libexpat
|
||||
|
||||
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
|
||||
cd $EXPAT_SRC_DIR/expat
|
||||
|
||||
./buildconf.sh
|
||||
./configure --enable-static --disable-shared --prefix=${EXTERNAL_MACOS_DIR}
|
||||
make
|
||||
make install
|
50
scripts/macos/build_haven.sh
Executable file
50
scripts/macos/build_haven.sh
Executable file
|
@ -0,0 +1,50 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ./config.sh
|
||||
|
||||
HAVEN_URL="https://github.com/haven-protocol-org/haven-main.git"
|
||||
HAVEN_DIR_PATH="${EXTERNAL_MACOS_SOURCE_DIR}/haven"
|
||||
HAVEN_VERSION=tags/v3.0.0
|
||||
BUILD_TYPE=release
|
||||
PREFIX=${EXTERNAL_MACOS_DIR}
|
||||
DEST_LIB_DIR=${EXTERNAL_MACOS_LIB_DIR}/haven
|
||||
DEST_INCLUDE_DIR=${EXTERNAL_MACOS_INCLUDE_DIR}/haven
|
||||
ARCH=`uname -m`
|
||||
|
||||
echo "Cloning haven from - $HAVEN_URL to - $HAVEN_DIR_PATH"
|
||||
git clone $HAVEN_URL $HAVEN_DIR_PATH
|
||||
cd $HAVEN_DIR_PATH
|
||||
git checkout $HAVEN_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
|
||||
|
||||
mkdir -p $DEST_LIB_DIR
|
||||
mkdir -p $DEST_INCLUDE_DIR
|
||||
|
||||
echo "Building MACOS ${ARCH}"
|
||||
export CMAKE_INCLUDE_PATH="${PREFIX}/include"
|
||||
export CMAKE_LIBRARY_PATH="${PREFIX}/lib"
|
||||
rm -rf haven/build > /dev/null
|
||||
|
||||
mkdir -p haven/build/${BUILD_TYPE}
|
||||
pushd haven/build/${BUILD_TYPE}
|
||||
cmake -DARCH=${ARCH} \
|
||||
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DSTATIC=ON \
|
||||
-DBUILD_GUI_DEPS=ON \
|
||||
-DINSTALL_VENDORED_LIBUNBOUND=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
|
||||
-DUSE_DEVICE_TREZOR=OFF \
|
||||
../..
|
||||
make -j4 && make install
|
||||
find . -path ./lib -prune -o -name '*.a' -exec cp '{}' lib \;
|
||||
cp -r ./lib/* $DEST_LIB_DIR
|
||||
cp ../../src/wallet/api/wallet2_api.h $DEST_INCLUDE_DIR
|
||||
popd
|
||||
|
54
scripts/macos/build_monero.sh
Executable file
54
scripts/macos/build_monero.sh
Executable file
|
@ -0,0 +1,54 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ./config.sh
|
||||
|
||||
MONERO_URL="https://github.com/cake-tech/monero.git"
|
||||
MONERO_DIR_PATH="${EXTERNAL_MACOS_SOURCE_DIR}/monero"
|
||||
MONERO_VERSION=release-v0.18.0.0
|
||||
BUILD_TYPE=release
|
||||
PREFIX=${EXTERNAL_MACOS_DIR}
|
||||
DEST_LIB_DIR=${EXTERNAL_MACOS_LIB_DIR}/monero
|
||||
DEST_INCLUDE_DIR=${EXTERNAL_MACOS_INCLUDE_DIR}/monero
|
||||
ARCH=`uname -m`
|
||||
|
||||
echo "Cloning monero from - $MONERO_URL to - $MONERO_DIR_PATH"
|
||||
git clone $MONERO_URL $MONERO_DIR_PATH
|
||||
cd $MONERO_DIR_PATH
|
||||
git checkout $MONERO_VERSION
|
||||
git submodule update --init --force
|
||||
mkdir -p build
|
||||
cd ..
|
||||
|
||||
mkdir -p $DEST_LIB_DIR
|
||||
mkdir -p $DEST_INCLUDE_DIR
|
||||
|
||||
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
if [ -z $INSTALL_PREFIX ]; then
|
||||
INSTALL_PREFIX=${ROOT_DIR}/monero
|
||||
fi
|
||||
|
||||
echo "Building MACOS ${ARCH}"
|
||||
export CMAKE_INCLUDE_PATH="${PREFIX}/include"
|
||||
export CMAKE_LIBRARY_PATH="${PREFIX}/lib"
|
||||
rm -r monero/build > /dev/null
|
||||
|
||||
if [ "${ARCH}" == "x86_64" ]; then
|
||||
ARCH="x86-64"
|
||||
fi
|
||||
|
||||
mkdir -p monero/build/${BUILD_TYPE}
|
||||
pushd monero/build/${BUILD_TYPE}
|
||||
cmake -DARCH=${ARCH} \
|
||||
-DBUILD_64=ON \
|
||||
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DSTATIC=ON \
|
||||
-DBUILD_GUI_DEPS=ON \
|
||||
-DUNBOUND_INCLUDE_DIR=${EXTERNAL_MACOS_INCLUDE_DIR} \
|
||||
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
|
||||
-DUSE_DEVICE_TREZOR=OFF \
|
||||
../..
|
||||
make wallet_api -j4
|
||||
find . -path ./lib -prune -o -name '*.a' -exec cp '{}' lib \;
|
||||
cp -r ./lib/* $DEST_LIB_DIR
|
||||
cp ../../src/wallet/api/wallet2_api.h $DEST_INCLUDE_DIR
|
||||
popd
|
20
scripts/macos/build_monero_all.sh
Executable file
20
scripts/macos/build_monero_all.sh
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
ARCH=`uname -m`
|
||||
|
||||
. ./config.sh
|
||||
|
||||
case $ARCH in
|
||||
arm64)
|
||||
./build_openssl_arm64.sh
|
||||
./build_boost_arm64.sh;;
|
||||
x86_64)
|
||||
./build_openssl_x86_64.sh
|
||||
./build_boost_x86_64.sh;;
|
||||
esac
|
||||
|
||||
./build_zmq.sh
|
||||
./build_expat.sh
|
||||
./build_unbound.sh
|
||||
./build_sodium.sh
|
||||
./build_monero.sh
|
4
scripts/macos/build_openssl_arm64.sh
Executable file
4
scripts/macos/build_openssl_arm64.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ./build_openssl_common.sh
|
||||
build_openssl_arm64
|
116
scripts/macos/build_openssl_common.sh
Executable file
116
scripts/macos/build_openssl_common.sh
Executable file
|
@ -0,0 +1,116 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ./config.sh
|
||||
|
||||
OPEN_SSL_DIR_NAME="OpenSSL"
|
||||
OPEN_SSL_x86_64_DIR_NAME="${OPEN_SSL_DIR_NAME}-x86_64"
|
||||
OPEN_SSL_ARM_DIR_NAME="${OPEN_SSL_DIR_NAME}-arm"
|
||||
OPEN_SSL_X86_64_DIR_PATH="${EXTERNAL_MACOS_SOURCE_DIR}/${OPEN_SSL_x86_64_DIR_NAME}"
|
||||
OPEN_SSL_ARM_DIR_PATH="${EXTERNAL_MACOS_SOURCE_DIR}/${OPEN_SSL_ARM_DIR_NAME}"
|
||||
|
||||
build_openssl_init_common() {
|
||||
DIR=$1
|
||||
# Use 1.1.1s becasue of https://github.com/openssl/openssl/issues/18720
|
||||
OPENSSL_VERSION="1.1.1s"
|
||||
|
||||
echo "============================ OpenSSL ============================"
|
||||
|
||||
cd $EXTERNAL_MACOS_SOURCE_DIR
|
||||
curl -O https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz
|
||||
tar -xvzf openssl-$OPENSSL_VERSION.tar.gz
|
||||
rm -rf $DIR
|
||||
rm -rf $OPEN_SSL_DIR_PATH
|
||||
mv openssl-$OPENSSL_VERSION $DIR
|
||||
tar -xvzf openssl-$OPENSSL_VERSION.tar.gz
|
||||
mv openssl-$OPENSSL_VERSION $OPEN_SSL_ARM_DIR_NAME
|
||||
}
|
||||
|
||||
build_openssl_init_arm64() {
|
||||
DIR=$OPEN_SSL_ARM_DIR_PATH
|
||||
build_openssl_init_common ${DIR}
|
||||
}
|
||||
|
||||
build_openssl_init_x86_64() {
|
||||
DIR=$OPEN_SSL_X86_64_DIR_PATH
|
||||
build_openssl_init_common ${DIR}
|
||||
}
|
||||
|
||||
build_openssl_compile_common() {
|
||||
ARCH=$1
|
||||
DIR=""
|
||||
XARCH=""
|
||||
case $ARCH in
|
||||
arm64)
|
||||
DIR=$OPEN_SSL_ARM_DIR_PATH
|
||||
XARCH="darwin64-arm64-cc";;
|
||||
x86_64)
|
||||
DIR=$OPEN_SSL_X86_64_DIR_PATH
|
||||
XARCH="darwin64-x86_64-cc";;
|
||||
esac
|
||||
|
||||
echo "Build OpenSSL for ${ARCH}"
|
||||
cd $DIR
|
||||
./Configure $XARCH
|
||||
make
|
||||
|
||||
}
|
||||
|
||||
build_openssl_compile_arm64() {
|
||||
ARCH=arm64
|
||||
build_openssl_compile_common "${ARCH}"
|
||||
}
|
||||
|
||||
build_openssl_compile_x86_64() {
|
||||
ARCH=x86_64
|
||||
build_openssl_compile_common "${ARCH}"
|
||||
}
|
||||
|
||||
build_openssl_install_common() {
|
||||
DIR=$1
|
||||
mv ${DIR}/include/* $EXTERNAL_MACOS_INCLUDE_DIR
|
||||
mv ${DIR}/libcrypto.a ${EXTERNAL_MACOS_LIB_DIR}/libcrypto.a
|
||||
mv ${DIR}/libssl.a ${EXTERNAL_MACOS_LIB_DIR}/libssl.a
|
||||
}
|
||||
|
||||
build_openssl_install_arm64() {
|
||||
build_openssl_install_common "${OPEN_SSL_ARM_DIR_PATH}"
|
||||
}
|
||||
|
||||
build_openssl_install_x86_64() {
|
||||
build_openssl_install_common "${OPEN_SSL_X86_64_DIR_PATH}"
|
||||
}
|
||||
|
||||
build_openssl_install_universal() {
|
||||
OPEN_SSL_DIR_PATH="${EXTERNAL_MACOS_SOURCE_DIR}/${OPEN_SSL_DIR_NAME}"
|
||||
mv ${OPEN_SSL_ARM_DIR_PATH}/include/* $OPEN_SSL_DIR_PATH/include
|
||||
build_openssl_install_common "${OPEN_SSL_DIR_PATH}"
|
||||
}
|
||||
|
||||
build_openssl_arm64() {
|
||||
build_openssl_init_arm64
|
||||
build_openssl_compile_arm64
|
||||
build_openssl_install_arm64
|
||||
}
|
||||
|
||||
build_openssl_x86_64() {
|
||||
build_openssl_init_x86_64
|
||||
build_openssl_compile_x86_64
|
||||
build_openssl_install_x86_64
|
||||
}
|
||||
|
||||
build_openssl_combine() {
|
||||
OPEN_SSL_DIR_PATH="${EXTERNAL_MACOS_SOURCE_DIR}/${OPEN_SSL_DIR_NAME}"
|
||||
echo "Create universal bin"
|
||||
mkdir -p $OPEN_SSL_DIR_PATH/include
|
||||
lipo -create ${OPEN_SSL_ARM_DIR_PATH}/libcrypto.a ${OPEN_SSL_X86_64_DIR_PATH}/libcrypto.a -output ${OPEN_SSL_DIR_PATH}/libcrypto.a
|
||||
lipo -create ${OPEN_SSL_ARM_DIR_PATH}/libssl.a ${OPEN_SSL_X86_64_DIR_PATH}/libssl.a -output ${OPEN_SSL_DIR_PATH}/libssl.a
|
||||
}
|
||||
|
||||
build_openssl_universal() {
|
||||
build_openssl_init_arm64
|
||||
build_openssl_compile_arm64
|
||||
build_openssl_init_x86_64
|
||||
build_openssl_compile_x86_64
|
||||
build_openssl_combine
|
||||
build_openssl_install_universal
|
||||
}
|
4
scripts/macos/build_openssl_universal.sh
Executable file
4
scripts/macos/build_openssl_universal.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ./build_openssl_common.sh
|
||||
build_openssl_universal
|
4
scripts/macos/build_openssl_x86_64.sh
Executable file
4
scripts/macos/build_openssl_x86_64.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ./build_openssl_common.sh
|
||||
build_openssl_x86_64
|
16
scripts/macos/build_sodium.sh
Executable file
16
scripts/macos/build_sodium.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ./config.sh
|
||||
|
||||
SODIUM_PATH="${EXTERNAL_MACOS_SOURCE_DIR}/libsodium"
|
||||
SODIUM_URL="https://github.com/jedisct1/libsodium.git"
|
||||
|
||||
echo "============================ SODIUM ============================"
|
||||
|
||||
echo "Cloning SODIUM from - $SODIUM_URL"
|
||||
git clone $SODIUM_URL $SODIUM_PATH --branch stable
|
||||
cd $SODIUM_PATH
|
||||
./dist-build/osx.sh
|
||||
|
||||
mv ${SODIUM_PATH}/libsodium-osx/include/* $EXTERNAL_MACOS_INCLUDE_DIR
|
||||
mv ${SODIUM_PATH}/libsodium-osx/lib/* $EXTERNAL_MACOS_LIB_DIR
|
23
scripts/macos/build_unbound.sh
Executable file
23
scripts/macos/build_unbound.sh
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ./config.sh
|
||||
|
||||
UNBOUND_VERSION=release-1.16.2
|
||||
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 ============================"
|
||||
rm -rf ${UNBOUND_DIR_PATH}
|
||||
git clone https://github.com/NLnetLabs/unbound.git -b ${UNBOUND_VERSION} ${UNBOUND_DIR_PATH}
|
||||
cd $UNBOUND_DIR_PATH
|
||||
test `git rev-parse HEAD` = ${UNBOUND_HASH} || exit 1
|
||||
|
||||
./configure --prefix="${EXTERNAL_MACOS_DIR}" \
|
||||
--with-ssl="${EXTERNAL_MACOS_DIR}" \
|
||||
--with-libexpat="${EXTERNAL_MACOS_DIR}" \
|
||||
--enable-static \
|
||||
--disable-shared \
|
||||
--disable-flto
|
||||
make
|
||||
make install
|
17
scripts/macos/build_zmq.sh
Executable file
17
scripts/macos/build_zmq.sh
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ./config.sh
|
||||
|
||||
ZMQ_PATH="${EXTERNAL_MACOS_SOURCE_DIR}/libzmq"
|
||||
ZMQ_URL="https://github.com/zeromq/libzmq.git"
|
||||
|
||||
echo "============================ ZMQ ============================"
|
||||
|
||||
echo "Cloning ZMQ from - $ZMQ_URL"
|
||||
git clone $ZMQ_URL $ZMQ_PATH
|
||||
cd $ZMQ_PATH
|
||||
mkdir cmake-build
|
||||
cd cmake-build
|
||||
cmake .. -DCMAKE_INSTALL_PREFIX="${EXTERNAL_MACOS_DIR}"
|
||||
make
|
||||
make install
|
4
scripts/macos/cakewallet.sh
Executable file
4
scripts/macos/cakewallet.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ./app_env.sh "cakewallet"
|
||||
. ./app_config.sh
|
13
scripts/macos/config.sh
Executable file
13
scripts/macos/config.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
export MACOS_SCRIPTS_DIR=`pwd`
|
||||
export CW_ROOT=${MACOS_SCRIPTS_DIR}/../..
|
||||
export EXTERNAL_DIR=${CW_ROOT}/cw_shared_external/ios/External
|
||||
export EXTERNAL_MACOS_DIR=${EXTERNAL_DIR}/macos
|
||||
export EXTERNAL_MACOS_SOURCE_DIR=${EXTERNAL_MACOS_DIR}/sources
|
||||
export EXTERNAL_MACOS_LIB_DIR=${EXTERNAL_MACOS_DIR}/lib
|
||||
export EXTERNAL_MACOS_INCLUDE_DIR=${EXTERNAL_MACOS_DIR}/include
|
||||
|
||||
mkdir -p $EXTERNAL_MACOS_LIB_DIR
|
||||
mkdir -p $EXTERNAL_MACOS_INCLUDE_DIR
|
||||
mkdir -p $EXTERNAL_MACOS_SOURCE_DIR
|
5
scripts/macos/gen_arm64.sh
Executable file
5
scripts/macos/gen_arm64.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
. ./gen_common.sh
|
||||
|
||||
gen "arm64"
|
31
scripts/macos/gen_common.sh
Executable file
31
scripts/macos/gen_common.sh
Executable file
|
@ -0,0 +1,31 @@
|
|||
#!/bin/sh
|
||||
|
||||
gen_podspec() {
|
||||
ARCH=$1
|
||||
CW_PLUGIN_DIR="`pwd`/../../cw_monero/macos"
|
||||
BASE_FILENAME="cw_monero_base.podspec"
|
||||
BASE_FILE_PATH="${CW_PLUGIN_DIR}/${BASE_FILENAME}"
|
||||
DEFAULT_FILENAME="cw_monero.podspec"
|
||||
DEFAULT_FILE_PATH="${CW_PLUGIN_DIR}/${DEFAULT_FILENAME}"
|
||||
rm -f $DEFAULT_FILE_PATH
|
||||
cp $BASE_FILE_PATH $DEFAULT_FILE_PATH
|
||||
sed -i '' "s/#___VALID_ARCHS___#/${ARCH}/g" $DEFAULT_FILE_PATH
|
||||
}
|
||||
|
||||
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}"
|
||||
rm -f $DEFAULT_FILE_PATH
|
||||
cp $BASE_FILE_PATH $DEFAULT_FILE_PATH
|
||||
sed -i '' "s/ARCHS =.*/ARCHS = ${ARCH};/g" $DEFAULT_FILE_PATH
|
||||
}
|
||||
|
||||
gen() {
|
||||
ARCH=$1
|
||||
gen_podspec "${ARCH}"
|
||||
gen_project "${ARCH}"
|
||||
}
|
5
scripts/macos/gen_universal.sh
Executable file
5
scripts/macos/gen_universal.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
. ./gen_common.sh
|
||||
|
||||
gen "arm64, x86_64"
|
5
scripts/macos/gen_x86_64.sh
Executable file
5
scripts/macos/gen_x86_64.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
. ./gen_common.sh
|
||||
|
||||
gen "x86_64"
|
40
scripts/macos/setup.sh
Executable file
40
scripts/macos/setup.sh
Executable file
|
@ -0,0 +1,40 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ./config.sh
|
||||
|
||||
cd $EXTERNAL_MACOS_LIB_DIR
|
||||
|
||||
|
||||
# LIBRANDOMX_PATH=${EXTERNAL_MACOS_LIB_DIR}/monero/librandomx.a
|
||||
|
||||
# if [ -f "$LIBRANDOMX_PATH" ]; then
|
||||
# cp $LIBRANDOMX_PATH ./haven
|
||||
# fi
|
||||
|
||||
libtool -static -o libboost.a ./libboost_*.a
|
||||
libtool -static -o libmonero.a ./monero/*.a
|
||||
|
||||
# CW_HAVEN_EXTERNAL_LIB=../../../../../cw_haven/macos/External/macos/lib
|
||||
# CW_HAVEN_EXTERNAL_INCLUDE=../../../../../cw_haven/macos/External/macos/include
|
||||
CW_MONERO_EXTERNAL_LIB=../../../../../cw_monero/macos/External/macos/lib
|
||||
CW_MONERO_EXTERNAL_INCLUDE=../../../../../cw_monero/macos/External/macos/include
|
||||
|
||||
# mkdir -p $CW_HAVEN_EXTERNAL_INCLUDE
|
||||
mkdir -p $CW_MONERO_EXTERNAL_INCLUDE
|
||||
# mkdir -p $CW_HAVEN_EXTERNAL_LIB
|
||||
mkdir -p $CW_MONERO_EXTERNAL_LIB
|
||||
|
||||
# ln ./libboost.a ${CW_HAVEN_EXTERNAL_LIB}/libboost.a
|
||||
# ln ./libcrypto.a ${CW_HAVEN_EXTERNAL_LIB}/libcrypto.a
|
||||
# ln ./libssl.a ${CW_HAVEN_EXTERNAL_LIB}/libssl.a
|
||||
# ln ./libsodium.a ${CW_HAVEN_EXTERNAL_LIB}/libsodium.a
|
||||
# cp ./libhaven.a $CW_HAVEN_EXTERNAL_LIB
|
||||
# cp ../include/haven/* $CW_HAVEN_EXTERNAL_INCLUDE
|
||||
|
||||
ln ./libboost.a ${CW_MONERO_EXTERNAL_LIB}/libboost.a
|
||||
ln ./libcrypto.a ${CW_MONERO_EXTERNAL_LIB}/libcrypto.a
|
||||
ln ./libssl.a ${CW_MONERO_EXTERNAL_LIB}/libssl.a
|
||||
ln ./libsodium.a ${CW_MONERO_EXTERNAL_LIB}/libsodium.a
|
||||
ln ./libunbound.a ${CW_MONERO_EXTERNAL_LIB}/libunbound.a
|
||||
cp ./libmonero.a $CW_MONERO_EXTERNAL_LIB
|
||||
cp ../include/monero/* $CW_MONERO_EXTERNAL_INCLUDE
|
Loading…
Add table
Add a link
Reference in a new issue