Add macOS signing options, sandbox signed bundles

This commit is contained in:
Struma 2020-11-16 04:37:05 -05:00 committed by zzoro
parent bd549a65ad
commit fe47cc91e5
4 changed files with 21 additions and 13 deletions

View file

@ -2,14 +2,12 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSRequiresAquaSystemAppearance</key>
<string>False</string>
<key>CFBundleGetInfoString</key>
<string>mkxp-z</string>
<key>CFBundleExecutable</key>
<string>mkxp-z</string>
<key>CFBundleIdentifier</key>
<string>com.inori.mkxpz</string>
<string>com.zoro.mkxpz</string>
<key>CFBundleName</key>
<string>mkxp-z</string>
<key>CFBundleIconFile</key>
@ -24,5 +22,9 @@
<integer>0</integer>
<key>IFMinorVersion</key>
<integer>1</integer>
<key>NSRequiresAquaSystemAppearance</key>
<string>False</string>
<key>SDL_FILESYSTEM_BASE_DIR_TYPE</key>
<string>resource</string>
</dict>
</plist>

View file

@ -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

View file

@ -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

View file

@ -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.')