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

12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
  1. # Builds fat lib for macOS (ARM64 & x86_64).
  2. # Pass PREFIX as argument. If not passed, "local/" is used as deafult. Config can also be passed.
  3. # Sample:
  4. # `sh build-pEpEngine-macOS.sh $MyPREFIX [RELEASE|DEBUG]
  5. # Exit on errors
  6. set -e
  7. SCRIPT_DIR=$(dirname "$0")
  8. PREFIX=$1
  9. CONFIG=$2
  10. if [ "${CONFIG}" = "" ]; then
  11. CONFIG="RELEASE"
  12. fi
  13. MACOSADAPTER_VERSION=$(sh "${SCRIPT_DIR}/get-pEp-version.sh" "MAC_OS_ADAPTER_VERSION")
  14. DOWNLOADCLIENT_VERSION=$(sh "${SCRIPT_DIR}/get-pEp-version.sh" "DOWNLOADCLIENT_VERSION")
  15. # Get Absolute Paths & Setup
  16. pushd "${SCRIPT_DIR}"
  17. SCRIPT_DIR=$(pwd)
  18. popd
  19. if [ "${PREFIX}" = "" ]; then
  20. PREFIX="${SCRIPT_DIR}/local"
  21. fi
  22. mkdir -p "${PREFIX}"
  23. pushd "${PREFIX}"
  24. PREFIX=$(pwd)
  25. popd
  26. PARENT_DIR="${SCRIPT_DIR}/.."
  27. if [ -f "${PREFIX}/bin/foundation.pEp.adapter.macOS" ]; then
  28. echo "lib exists already in ${LIB_DIR}. If you want to rebuild it, delete the existing one."
  29. exit 0
  30. fi
  31. echo "###########################################"
  32. echo "# BUILDING MACOSADAPTER"
  33. echo "###########################################"
  34. pushd "${PARENT_DIR}"
  35. MAC_OS_ADAPTER_DIR="${PARENT_DIR}/pEpMacOSAdapter"
  36. if [ ! -d "${MAC_OS_ADAPTER_DIR}" ]; then
  37. git clone -b "${MACOSADAPTER_VERSION}" https://gitea.pep.foundation/pEp.foundation/pEpMacOSAdapter/
  38. fi
  39. DOWNLOADCLIENT_DIR="${PARENT_DIR}/downloadclient"
  40. if [ ! -d "${DOWNLOADCLIENT_DIR}" ]; then
  41. git clone -b "${DOWNLOADCLIENT_VERSION}" https://gitea.pep.foundation/pEp.foundation/downloadclient
  42. # Is build with macOSAdapter Xcode project
  43. fi
  44. # Copy Artefacts & PLIST
  45. pushd ${MAC_OS_ADAPTER_DIR}
  46. xcodebuild -workspace "pEpMacOSAdapter.xcworkspace" -scheme "All" -configuration ${CONFIG}
  47. cp -r "build/foundation.pEp.adapter.macOS.xpc/Contents/MacOS/foundation.pEp.adapter.macOS" "${PREFIX}/bin/foundation.pEp.adapter.macOS"
  48. mkdir -p "${PREFIX}/apps"
  49. cp -r "Submodules/pEpNotifications/build/p≡p updates.app" "${PREFIX}/apps/p≡p updates.app"
  50. PLISTS_DIR="${PREFIX}/plists"
  51. mkdir -p "${PLISTS_DIR}"
  52. cp pEpMacOSAdapter/foundation.pEp.adapter.macOS.plist "${PLISTS_DIR}"
  53. popd
  54. popd