From adc00ad5a94d1d96a9b6603c05289272255aa03e Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Sat, 1 Jun 2024 17:26:52 +1200 Subject: [PATCH] This should now work --- .../package_mavsdk_server_framework.bash | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/mavsdk_server/tools/package_mavsdk_server_framework.bash b/src/mavsdk_server/tools/package_mavsdk_server_framework.bash index 453a3b687..88dd8e5c9 100644 --- a/src/mavsdk_server/tools/package_mavsdk_server_framework.bash +++ b/src/mavsdk_server/tools/package_mavsdk_server_framework.bash @@ -4,10 +4,12 @@ set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" BUILD_DIR=${SCRIPT_DIR}/../../../build + IOS_BACKEND_DIR=${BUILD_DIR}/ios/src/mavsdk_server/src IOS_SIM_X64_BACKEND_DIR=${BUILD_DIR}/ios_simulator_x64/src/mavsdk_server/src IOS_SIM_ARM64_BACKEND_DIR=${BUILD_DIR}/ios_simulator_arm64/src/mavsdk_server/src IOS_SIM_FAT_BACKEND_DIR=${BUILD_DIR}/ios_simulator/src/mavsdk_server/src + MACOS_X64_BACKEND_DIR=${BUILD_DIR}/macos_x64/src/mavsdk_server/src MACOS_ARM64_BACKEND_DIR=${BUILD_DIR}/macos_arm64/src/mavsdk_server/src MACOS_FAT_BACKEND_DIR=${BUILD_DIR}/macos/src/mavsdk_server/src @@ -17,13 +19,10 @@ if [ -d ${BUILD_DIR}/mavsdk_server.xcframework ]; then exit 1 fi -#echo "Fixing Modules in macOS framework" -#ln -sf Versions/Current/Modules ${MACOS_X64_BACKEND_DIR}/mavsdk_server.framework +echo "Running lipo for simulator" mkdir -p ${IOS_SIM_FAT_BACKEND_DIR} cp -a ${IOS_SIM_X64_BACKEND_DIR}/mavsdk_server.framework ${IOS_SIM_FAT_BACKEND_DIR} - -echo "Running lipo for simulator" xcrun lipo -create -output ${IOS_SIM_FAT_BACKEND_DIR}/mavsdk_server.framework/mavsdk_server \ ${IOS_SIM_X64_BACKEND_DIR}/mavsdk_server.framework/mavsdk_server \ ${IOS_SIM_ARM64_BACKEND_DIR}/mavsdk_server.framework/mavsdk_server @@ -33,11 +32,11 @@ tree ${IOS_SIM_FAT_BACKEND_DIR}/mavsdk_server.framework echo "Running codesign for simulator" xcrun codesign --verbose --sign - ${IOS_SIM_FAT_BACKEND_DIR}/mavsdk_server.framework -mkdir -p ${MACOS_FAT_BACKEND_DIR} -cp -a ${MACOS_X64_BACKEND_DIR}/mavsdk_server.framework ${MACOS_FAT_BACKEND_DIR} echo "Running lipo for macos" +mkdir -p ${MACOS_FAT_BACKEND_DIR} +cp -a ${MACOS_X64_BACKEND_DIR}/mavsdk_server.framework ${MACOS_FAT_BACKEND_DIR} xcrun lipo -create -output ${MACOS_FAT_BACKEND_DIR}/mavsdk_server.framework/mavsdk_server \ ${MACOS_X64_BACKEND_DIR}/mavsdk_server.framework/mavsdk_server \ ${MACOS_ARM64_BACKEND_DIR}/mavsdk_server.framework/mavsdk_server @@ -54,14 +53,12 @@ xcodebuild -create-xcframework \ -framework ${MACOS_FAT_BACKEND_DIR}/mavsdk_server.framework \ -output ${BUILD_DIR}/mavsdk_server.xcframework -tree ${BUILD_DIR}/mavsdk_server.xcframework - +echo "Setting executable bit" chmod +x ${BUILD_DIR}/mavsdk_server.xcframework/ios-arm64/mavsdk_server.framework/mavsdk_server -chmod +x ${BUILD_DIR}/mavsdk_server.xcframework/ios-x86_64-simulator/mavsdk_server.framework/mavsdk_server -chmod +x ${BUILD_DIR}/mavsdk_server.xcframework/ios-arm64-simulator/mavsdk_server.framework/mavsdk_server -chmod +x ${BUILD_DIR}/mavsdk_server.xcframework/macos-x86_64/mavsdk_server.framework/mavsdk_server -chmod +x ${BUILD_DIR}/mavsdk_server.xcframework/macos-arm64/mavsdk_server.framework/mavsdk_server +chmod +x ${BUILD_DIR}/mavsdk_server.xcframework/ios-arm64_x86_64-simulator/mavsdk_server.framework/mavsdk_server +chmod +x ${BUILD_DIR}/mavsdk_server.xcframework/macos-arm64_x86_64/mavsdk_server.framework/mavsdk_server +echo "Creating zip archive" cd ${BUILD_DIR} zip -9 -y -r mavsdk_server.xcframework.zip mavsdk_server.xcframework