From 267a6ff62e343ba603b98f47e5ed6c49bb24d782 Mon Sep 17 00:00:00 2001 From: zzoro Date: Mon, 16 Nov 2020 04:37:05 -0500 Subject: [PATCH] Add macOS signing options, sandbox signed bundles --- macos/Info.plist | 8 +++++--- macos/macpack.sh | 16 ++++++++-------- macos/meson.build | 4 ++++ meson_options.txt | 6 ++++-- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/macos/Info.plist b/macos/Info.plist index 66096aca..455cc982 100644 --- a/macos/Info.plist +++ b/macos/Info.plist @@ -2,14 +2,12 @@ - NSRequiresAquaSystemAppearance - False CFBundleGetInfoString mkxp-z CFBundleExecutable mkxp-z CFBundleIdentifier - com.inori.mkxpz + com.zoro.mkxpz CFBundleName mkxp-z CFBundleIconFile @@ -24,5 +22,9 @@ 0 IFMinorVersion 1 + NSRequiresAquaSystemAppearance + False + SDL_FILESYSTEM_BASE_DIR_TYPE + resource diff --git a/macos/macpack.sh b/macos/macpack.sh index c5f1f217..10cdc8bd 100755 --- a/macos/macpack.sh +++ b/macos/macpack.sh @@ -4,12 +4,12 @@ EXE=${MESON_INSTALL_PREFIX}/Contents/MacOS/$2 if [ -n "$1" ]; then echo "Setting up steam_api manually..." - mkdir -p "${MESON_INSTALL_PREFIX}/Contents/libs" - cp "$1/libsteam_api.dylib" "${MESON_INSTALL_PREFIX}/Contents/libs" - install_name_tool -change "@loader_path/libsteam_api.dylib" "@executable_path/../libs/libsteam_api.dylib" $EXE - install_name_tool -add_rpath "@executable_path/../libs" ${EXE}_rt - macpack ${EXE}_rt + mkdir -p "${MESON_INSTALL_PREFIX}/Contents/Frameworks" + cp "$1/libsteam_api.dylib" "${MESON_INSTALL_PREFIX}/Contents/Frameworks" + install_name_tool -change "@loader_path/libsteam_api.dylib" "@executable_path/../Frameworks/libsteam_api.dylib" $EXE + install_name_tool -add_rpath "@executable_path/../Frameworks" ${EXE}_rt + macpack -d "${MESON_INSTALL_PREFIX}/Contents/Frameworks" ${EXE}_rt else - install_name_tool -add_rpath "@executable_path/../libs" ${EXE} - macpack ${EXE} -fi + install_name_tool -add_rpath "@executable_path/../Frameworks" ${EXE} + macpack -d "${MESON_INSTALL_PREFIX}/Contents/Frameworks" ${EXE} +fi \ No newline at end of file diff --git a/macos/meson.build b/macos/meson.build index 42b301ee..80950174 100644 --- a/macos/meson.build +++ b/macos/meson.build @@ -7,3 +7,7 @@ if steamworks == true endif meson.add_install_script('macpack.sh', swarg, meson.project_name()) + +if get_option('codesign') == true + meson.add_install_script('codesign.sh', get_option('codesign_identity')) +endif \ No newline at end of file diff --git a/meson_options.txt b/meson_options.txt index e015f96e..b108ce6f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -3,7 +3,6 @@ option('mri_includes', type: 'string', value: '', description: 'Ruby manual incl option('mri_libpath', type: 'string', value: '', description: 'Ruby manual lib path') option('mri_library', type: 'string', value: '', description: 'Ruby manual link name') -option('mk', type: 'boolean', value: false, description: 'Build to fit Marin\'s MK standard') option('console', type: 'boolean', value: false, description: 'Whether to debug information in the console') option('macos_min_version', type: 'string', value: '', description: 'Minimum macOS system version to support (does not affect dependencies)') option('force32', type: 'boolean', value: false, description: 'Force compiler to build a 32-bit executable') @@ -17,7 +16,10 @@ option('no_preload_scripts', type: 'boolean', value: false, description: 'Disabl option('workdir_current', type: 'boolean', value: false, description: 'Keep current directory on startup') option('static_executable', type: 'boolean', value: false, description: 'Build a static executable (Windows-only)') +option('appimagekit_path', type: 'string', value: '', description: 'Path to AppImageKit, used for building AppImages') option('appimage', type: 'boolean', value: false, description: 'Whether to install to an AppImage or just copy everything') option('steamworks_path', type: 'string', value: '', description: 'Path to Steamshim') option('steam_appid', type: 'string', value: '', description: 'Steam AppID. Set this to use SteamAPI_RestartAppIfNecessary') -option('appimagekit_path', type: 'string', value: '', description: 'Path to AppImageKit, used for building AppImages') + +option('codesign', type: 'boolean', value: false, description: 'Whether to codesign the Mac app bundle upon creation. If codesign_identity is not set, signs for local use.') +option('codesign_identity', type: 'string', value: '', description: 'A valid Apple Developer ID for signing Mac apps.') \ No newline at end of file