mac packaging fixes
This commit is contained in:
4 files changed
+31
-3
No files matched your search
+1
-1
@@ -267,7 +267,7 @@ package-macos:
|
|||||||
- build-macos
|
- build-macos
|
||||||
- test-macos
|
- test-macos
|
||||||
variables:
|
variables:
|
||||||
CODESIGN: "false"
|
CODESIGN: "true"
|
||||||
script:
|
script:
|
||||||
- export PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}"
|
- export PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}"
|
||||||
- chmod +x packaging/package-macos.sh
|
- chmod +x packaging/package-macos.sh
|
||||||
|
|||||||
@@ -122,6 +122,13 @@ set(SOURCES
|
|||||||
if(WIN32)
|
if(WIN32)
|
||||||
list(APPEND SOURCES src/asteria.rc)
|
list(APPEND SOURCES src/asteria.rc)
|
||||||
endif()
|
endif()
|
||||||
|
if(APPLE)
|
||||||
|
set(APP_ICON_MACOS "${CMAKE_CURRENT_SOURCE_DIR}/src/assets/asteria-qt.icns")
|
||||||
|
set_source_files_properties(${APP_ICON_MACOS} PROPERTIES
|
||||||
|
MACOSX_PACKAGE_LOCATION "Resources"
|
||||||
|
)
|
||||||
|
list(APPEND SOURCES ${APP_ICON_MACOS})
|
||||||
|
endif()
|
||||||
|
|
||||||
# Executable
|
# Executable
|
||||||
qt_add_executable(asteria-qt ${SOURCES})
|
qt_add_executable(asteria-qt ${SOURCES})
|
||||||
@@ -142,6 +149,7 @@ if(APPLE)
|
|||||||
MACOSX_BUNDLE_GUI_IDENTIFIER "com.asteria-bookreader.asteria-qt"
|
MACOSX_BUNDLE_GUI_IDENTIFIER "com.asteria-bookreader.asteria-qt"
|
||||||
MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}"
|
MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}"
|
||||||
MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}"
|
MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}"
|
||||||
|
MACOSX_BUNDLE_ICON_FILE "asteria-qt.icns"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|||||||
|
|
||||||
APP_PATH="$BUILD_DIR/asteria-qt.app"
|
APP_PATH="$BUILD_DIR/asteria-qt.app"
|
||||||
DMG_NAME="Asteria.dmg"
|
DMG_NAME="Asteria.dmg"
|
||||||
CODESIGN="${CODESIGN:-false}"
|
CODESIGN="${CODESIGN:-true}"
|
||||||
CODESIGN_IDENTITY="${CODESIGN_IDENTITY:--}"
|
CODESIGN_IDENTITY="${CODESIGN_IDENTITY:--}"
|
||||||
|
|
||||||
if [ ! -d "$APP_PATH" ]; then
|
if [ ! -d "$APP_PATH" ]; then
|
||||||
@@ -24,7 +24,27 @@ fi
|
|||||||
|
|
||||||
if [ "$CODESIGN" = "true" ]; then
|
if [ "$CODESIGN" = "true" ]; then
|
||||||
echo "Signing $APP_PATH with identity '$CODESIGN_IDENTITY'..."
|
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
|
fi
|
||||||
|
|
||||||
# Create .dmg directly in output directory
|
# Create .dmg directly in output directory
|
||||||
|
|||||||
Binary file not shown.
Reference in new issue
Block a user