You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

62 lines
2.1 KiB

# Builds fat lib for macOS (ARM64 & x86_64).
# Pass PREFIX as argument. If not passed, "local/" is used as deafult. Config can also be passed.
# Sample:
# `sh build-pEpEngine-macOS.sh $MyPREFIX [RELEASE|DEBUG]
# Exit on errors
set -e
SCRIPT_DIR=$(dirname "$0")
PREFIX=$1
CONFIG=$2
if [ "${CONFIG}" = "" ]; then
CONFIG="RELEASE"
fi
MACOSADAPTER_VERSION=$(sh "${SCRIPT_DIR}/get-pEp-version.sh" "MAC_OS_ADAPTER_VERSION")
DOWNLOADCLIENT_VERSION=$(sh "${SCRIPT_DIR}/get-pEp-version.sh" "DOWNLOADCLIENT_VERSION")
# Get Absolute Paths & Setup
pushd "${SCRIPT_DIR}"
SCRIPT_DIR=$(pwd)
popd
if [ "${PREFIX}" = "" ]; then
PREFIX="${SCRIPT_DIR}/local"
fi
mkdir -p "${PREFIX}"
pushd "${PREFIX}"
PREFIX=$(pwd)
popd
PARENT_DIR="${SCRIPT_DIR}/.."
if [ -f "${PREFIX}/bin/foundation.pEp.adapter.macOS" ]; then
echo "lib exists already in ${LIB_DIR}. If you want to rebuild it, delete the existing one."
exit 0
fi
echo "###########################################"
echo "# BUILDING MACOSADAPTER"
echo "###########################################"
pushd "${PARENT_DIR}"
MAC_OS_ADAPTER_DIR="${PARENT_DIR}/pEpMacOSAdapter"
if [ ! -d "${MAC_OS_ADAPTER_DIR}" ]; then
git clone -b "${MACOSADAPTER_VERSION}" https://gitea.pep.foundation/pEp.foundation/pEpMacOSAdapter/
fi
DOWNLOADCLIENT_DIR="${PARENT_DIR}/downloadclient"
if [ ! -d "${DOWNLOADCLIENT_DIR}" ]; then
git clone -b "${DOWNLOADCLIENT_VERSION}" https://gitea.pep.foundation/pEp.foundation/downloadclient
# Is build with macOSAdapter Xcode project
fi
# Copy Artefacts & PLIST
pushd ${MAC_OS_ADAPTER_DIR}
xcodebuild -workspace "pEpMacOSAdapter.xcworkspace" -scheme "All" -configuration ${CONFIG}
cp -r "build/foundation.pEp.adapter.macOS.xpc/Contents/MacOS/foundation.pEp.adapter.macOS" "${PREFIX}/bin/foundation.pEp.adapter.macOS"
mkdir -p "${PREFIX}/apps"
cp -r "Submodules/pEpNotifications/build/p≡p updates.app" "${PREFIX}/apps/p≡p updates.app"
PLISTS_DIR="${PREFIX}/plists"
mkdir -p "${PLISTS_DIR}"
cp pEpMacOSAdapter/foundation.pEp.adapter.macOS.plist "${PLISTS_DIR}"
popd
popd