mac packaging fixes

This commit is contained in:
Agel committed 2026-11-12 15:51:24 +01:00
1 parent c3a89e88d2
commit 5151e40bde
4 files changed
+31 -3

No files matched your search

+22 -2
View File
@@ -11,7 +11,7 @@ PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
APP_PATH="$BUILD_DIR/asteria-qt.app"
DMG_NAME="Asteria.dmg"
CODESIGN="${CODESIGN:-false}"
CODESIGN="${CODESIGN:-true}"
CODESIGN_IDENTITY="${CODESIGN_IDENTITY:--}"
if [ ! -d "$APP_PATH" ]; then
@@ -24,7 +24,27 @@ fi
if [ "$CODESIGN" = "true" ]; then
echo "Signing $APP_PATH with identity '$CODESIGN_IDENTITY'..."
codesign --force --deep --sign "$CODESIGN_IDENTITY" "$APP_PATH"
xattr -cr "$APP_PATH"
CODESIGN_ARGS=(--force --sign "$CODESIGN_IDENTITY")
if [ "$CODESIGN_IDENTITY" != "-" ]; then
CODESIGN_ARGS+=(--options runtime --timestamp)
fi
# Sign nested libraries and plugins inside-out before sealing the bundle
find "$APP_PATH/Contents/Frameworks" "$APP_PATH/Contents/PlugIns" \
-type f \( -name "*.dylib" -o -name "*.so" \) -print0 2>/dev/null | \
while IFS= read -r -d '' bin; do
codesign "${CODESIGN_ARGS[@]}" "$bin"
done
find "$APP_PATH/Contents/Frameworks" -maxdepth 1 -type d -name "*.framework" -print0 2>/dev/null | \
while IFS= read -r -d '' fw; do
codesign "${CODESIGN_ARGS[@]}" "$fw"
done
codesign "${CODESIGN_ARGS[@]}" "$APP_PATH"
codesign --verify --deep --strict --verbose=2 "$APP_PATH"
fi
# Create .dmg directly in output directory