From bb5326adf439797b563978f54444c37667ceecee Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Tue, 30 Jul 2024 21:44:46 -0400 Subject: [PATCH 01/14] DolphinQt: Rename output bundle on macOS to DolphinQt --- Source/Core/DolphinQt/CMakeLists.txt | 4 ++-- Source/Core/DolphinQt/Info.plist.in | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt index 25a3c0daa8..c828a446a3 100644 --- a/Source/Core/DolphinQt/CMakeLists.txt +++ b/Source/Core/DolphinQt/CMakeLists.txt @@ -566,7 +566,7 @@ endif() if(APPLE) include(BundleUtilities) - set(BUNDLE_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Dolphin.app) + set(BUNDLE_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DolphinQt.app) # Ask for an application bundle. set_target_properties(dolphin-emu PROPERTIES @@ -574,7 +574,7 @@ if(APPLE) MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_BINARY_DIR}/Info.plist" XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/DolphinEmu.entitlements" XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "--deep --options=runtime" - OUTPUT_NAME Dolphin + OUTPUT_NAME DolphinQt ) # Copy qt.conf into the bundle diff --git a/Source/Core/DolphinQt/Info.plist.in b/Source/Core/DolphinQt/Info.plist.in index 93c2266280..2a3d17291e 100644 --- a/Source/Core/DolphinQt/Info.plist.in +++ b/Source/Core/DolphinQt/Info.plist.in @@ -30,7 +30,7 @@ CFBundleExecutable - Dolphin + DolphinQt CFBundleIconFile Dolphin.icns CFBundleIdentifier From 8499b43501f93b5b1cc138773d24040a0d34a52d Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Tue, 30 Jul 2024 21:46:06 -0400 Subject: [PATCH 02/14] MacUpdater: Always use the same signing identity as the DolphinQt bundle --- BuildMacOSUniversalBinary.py | 2 -- CMakeLists.txt | 1 - Source/Core/MacUpdater/CMakeLists.txt | 6 +----- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/BuildMacOSUniversalBinary.py b/BuildMacOSUniversalBinary.py index bcf5ce97d6..33973393a6 100755 --- a/BuildMacOSUniversalBinary.py +++ b/BuildMacOSUniversalBinary.py @@ -317,8 +317,6 @@ def build(config): + config[arch+"_mac_os_deployment_target"], "-DMACOS_CODE_SIGNING_IDENTITY=" + config["codesign_identity"], - "-DMACOS_CODE_SIGNING_IDENTITY_UPDATER=" - + config["codesign_identity"], '-DMACOS_CODE_SIGNING="ON"', "-DSTEAM=" + python_to_cmake_bool(config["steam"]), diff --git a/CMakeLists.txt b/CMakeLists.txt index ce5d64715f..e3a33876d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,7 +138,6 @@ if(APPLE) option(MACOS_CODE_SIGNING "Enable codesigning" ON) option(USE_BUNDLED_MOLTENVK "Build MoltenVK from Externals with Dolphin-specific patches" ON) set(MACOS_CODE_SIGNING_IDENTITY "-" CACHE STRING "The identity used for codesigning.") - set(MACOS_CODE_SIGNING_IDENTITY_UPDATER "-" CACHE STRING "The identity used for codesigning, for the updater.") endif() if(CMAKE_SYSTEM_NAME STREQUAL "Linux") diff --git a/Source/Core/MacUpdater/CMakeLists.txt b/Source/Core/MacUpdater/CMakeLists.txt index 71c0408317..60abe88792 100644 --- a/Source/Core/MacUpdater/CMakeLists.txt +++ b/Source/Core/MacUpdater/CMakeLists.txt @@ -54,10 +54,6 @@ foreach(sb ${STORYBOARDS}) endforeach() if(MACOS_CODE_SIGNING) - if (MACOS_CODE_SIGNING_IDENTITY_UPDATER STREQUAL "") - set(MACOS_CODE_SIGNING_IDENTITY_UPDATER "${MACOS_CODE_SIGNING_IDENTITY}") - endif() - add_custom_command(TARGET MacUpdater POST_BUILD - COMMAND /usr/bin/codesign -f -s "${MACOS_CODE_SIGNING_IDENTITY_UPDATER}" --deep --options runtime $) + COMMAND /usr/bin/codesign -f -s "${MACOS_CODE_SIGNING_IDENTITY}" --deep --options runtime $) endif() From 5c401bd5da0fa88a1b4e33cdc0d0318d1531ebb9 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Tue, 30 Jul 2024 21:51:39 -0400 Subject: [PATCH 03/14] MacUpdater: Change CFBundleName to match the bundle's output name --- Source/Core/MacUpdater/Info.plist.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/MacUpdater/Info.plist.in b/Source/Core/MacUpdater/Info.plist.in index df5967f289..ba3eae075d 100644 --- a/Source/Core/MacUpdater/Info.plist.in +++ b/Source/Core/MacUpdater/Info.plist.in @@ -13,7 +13,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - Updater + Dolphin Updater CFBundlePackageType APPL CFBundleShortVersionString From f74f748ff6329fdf0572015cd355fde0684189a6 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Tue, 30 Jul 2024 21:53:17 -0400 Subject: [PATCH 04/14] MacUpdater: Change bundle ID to org.dolphin-emu.updater The domain "dolphinteam.com" is not under our control, so we shouldn't be using it. --- Source/Core/MacUpdater/Info.plist.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/MacUpdater/Info.plist.in b/Source/Core/MacUpdater/Info.plist.in index ba3eae075d..574843c28d 100644 --- a/Source/Core/MacUpdater/Info.plist.in +++ b/Source/Core/MacUpdater/Info.plist.in @@ -9,7 +9,7 @@ CFBundleIconFile Dolphin.icns CFBundleIdentifier - com.dolphinteam.dolphin-updater + org.dolphin-emu.updater CFBundleInfoDictionaryVersion 6.0 CFBundleName From 4883889e23ac784e004b4c80ab809920f11a69d3 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Wed, 31 Jul 2024 13:31:23 -0400 Subject: [PATCH 05/14] Tools: Add script to codesign a macOS bundle or executable With our current setup, we use the --deep option, which should be avoided. This tool signs bundles in the "correct" way as recommended by Apple (each Mach-O individually, from the inside-out). --- Tools/mac-codesign.sh | 74 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100755 Tools/mac-codesign.sh diff --git a/Tools/mac-codesign.sh b/Tools/mac-codesign.sh new file mode 100755 index 0000000000..9fb330bc6c --- /dev/null +++ b/Tools/mac-codesign.sh @@ -0,0 +1,74 @@ +#!/bin/bash + +# This script signs a specific object with the specified identity, entitlements, +# and optional flags. If the target is a bundle, it will also sign all frameworks +# and dylibs within the bundle. + +set -eu + +function usage() { + echo "Usage: $0 [-t] [-e ] " + exit 1 +} + +USE_SECURE_TIMESTAMP=0 +ENTITLEMENTS_FILE="" + +while getopts ":te:" opt; do + case $opt in + t) + USE_SECURE_TIMESTAMP=1 + ;; + e) + ENTITLEMENTS_FILE=$OPTARG + ;; + \?) + usage + ;; + esac +done + +if [ $USE_SECURE_TIMESTAMP -eq 1 ]; then + TIMESTAMP_FLAG="--timestamp" +else + TIMESTAMP_FLAG="--timestamp=none" +fi + +shift $((OPTIND - 1)) + +if [ $# -ne 2 ]; then + usage +fi + +IDENTITY=$1 +TARGET_PATH=$2 + +# Signs the given target with the specified identity and optional flags. +function sign() { + /usr/bin/codesign -f -s "$IDENTITY" $TIMESTAMP_FLAG ${2:-} "$1" +} + +if [ -d "$TARGET_PATH" ]; then + # Newlines are the only valid separator character in find's output. + IFS=$'\n' + + for framework in $(find "$TARGET_PATH" -not -path "*/Helpers/*" -name '*.dylib' -or -name '*.framework'); do + sign "$framework" + done + + unset IFS +fi + +TARGET_EXTRA_CODESIGN_FLAGS="-o runtime" + +if [ -n "$ENTITLEMENTS_FILE" ]; then + # "preserve" is a special keyword which tells us we should preserve the + # existing entitlements in the target. + if [ "$ENTITLEMENTS_FILE" == "preserve" ]; then + TARGET_EXTRA_CODESIGN_FLAGS+=" --preserve-metadata=entitlements" + else + TARGET_EXTRA_CODESIGN_FLAGS+=" --entitlements $ENTITLEMENTS_FILE" + fi +fi + +sign "$TARGET_PATH" "$TARGET_EXTRA_CODESIGN_FLAGS" From cbbffce79aa7811a6bd9c00dc4ac955662ca0a17 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Wed, 31 Jul 2024 13:31:41 -0400 Subject: [PATCH 06/14] MacUpdater: Switch to mac-codesign script for code signing --- Source/Core/MacUpdater/CMakeLists.txt | 8 ++++++-- Tools/mac-codesign.sh | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Source/Core/MacUpdater/CMakeLists.txt b/Source/Core/MacUpdater/CMakeLists.txt index 60abe88792..b27b466df9 100644 --- a/Source/Core/MacUpdater/CMakeLists.txt +++ b/Source/Core/MacUpdater/CMakeLists.txt @@ -54,6 +54,10 @@ foreach(sb ${STORYBOARDS}) endforeach() if(MACOS_CODE_SIGNING) - add_custom_command(TARGET MacUpdater POST_BUILD - COMMAND /usr/bin/codesign -f -s "${MACOS_CODE_SIGNING_IDENTITY}" --deep --options runtime $) + add_custom_command(TARGET MacUpdater + POST_BUILD + COMMAND "${CMAKE_SOURCE_DIR}/Tools/mac-codesign.sh" + "${MACOS_CODE_SIGNING_IDENTITY}" + "$" + ) endif() diff --git a/Tools/mac-codesign.sh b/Tools/mac-codesign.sh index 9fb330bc6c..2b26d461ee 100755 --- a/Tools/mac-codesign.sh +++ b/Tools/mac-codesign.sh @@ -52,7 +52,7 @@ if [ -d "$TARGET_PATH" ]; then # Newlines are the only valid separator character in find's output. IFS=$'\n' - for framework in $(find "$TARGET_PATH" -not -path "*/Helpers/*" -name '*.dylib' -or -name '*.framework'); do + for framework in $(find "$TARGET_PATH" -depth -not -path "*/Helpers/*" -name '*.dylib' -or -name '*.framework'); do sign "$framework" done From 22dda0b0c40dde0167a952442b90410f815643a0 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Wed, 31 Jul 2024 13:32:25 -0400 Subject: [PATCH 07/14] DolphinQt: Disable Xcode code signing to avoid double code signing --- Source/Core/DolphinQt/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt index c828a446a3..071b56972f 100644 --- a/Source/Core/DolphinQt/CMakeLists.txt +++ b/Source/Core/DolphinQt/CMakeLists.txt @@ -572,8 +572,7 @@ if(APPLE) set_target_properties(dolphin-emu PROPERTIES MACOSX_BUNDLE true MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_BINARY_DIR}/Info.plist" - XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/DolphinEmu.entitlements" - XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "--deep --options=runtime" + XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "" OUTPUT_NAME DolphinQt ) From 37a7b1e5c95fc08af231455931ed3c39b314731d Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Wed, 31 Jul 2024 13:32:52 -0400 Subject: [PATCH 08/14] DolphinQt: Switch to mac-codesign script for code signing --- Source/Core/DolphinQt/CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt index 071b56972f..3f8c087cd1 100644 --- a/Source/Core/DolphinQt/CMakeLists.txt +++ b/Source/Core/DolphinQt/CMakeLists.txt @@ -637,9 +637,13 @@ if(APPLE) endif() if(MACOS_CODE_SIGNING) - # Code sign make file builds - add_custom_command(TARGET dolphin-emu POST_BUILD - COMMAND /usr/bin/codesign -f -s "${MACOS_CODE_SIGNING_IDENTITY}" --deep --options=runtime --entitlements "${CMAKE_SOURCE_DIR}/Source/Core/DolphinQt/DolphinEmu$<$:Debug>.entitlements" "$") + add_custom_command(TARGET dolphin-emu + POST_BUILD + COMMAND "${CMAKE_SOURCE_DIR}/Tools/mac-codesign.sh" + "-e" "${CMAKE_CURRENT_SOURCE_DIR}/DolphinEmu$<$:Debug>.entitlements" + "${MACOS_CODE_SIGNING_IDENTITY}" + "${BUNDLE_PATH}" + ) endif() else() install(TARGETS dolphin-emu RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) From b0ca5f2666690d094264bd168a1a1a8e9773acf1 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Thu, 1 Aug 2024 11:59:15 -0400 Subject: [PATCH 09/14] DolphinPostprocessBundle: Use TARGET_BUNDLE_DIR to avoid having to make a relative path absolute --- CMake/DolphinPostprocessBundle.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMake/DolphinPostprocessBundle.cmake b/CMake/DolphinPostprocessBundle.cmake index ba412ba48d..dfc71779f7 100644 --- a/CMake/DolphinPostprocessBundle.cmake +++ b/CMake/DolphinPostprocessBundle.cmake @@ -14,14 +14,13 @@ if(CMAKE_GENERATOR) set(_DOLPHIN_POSTPROCESS_BUNDLE_MODULE_LOCATION "${CMAKE_CURRENT_LIST_FILE}") function(dolphin_postprocess_bundle target) add_custom_command(TARGET ${target} POST_BUILD - COMMAND ${CMAKE_COMMAND} -DDOLPHIN_BUNDLE_PATH="$/../.." + COMMAND ${CMAKE_COMMAND} -DDOLPHIN_BUNDLE_PATH="$" -P "${_DOLPHIN_POSTPROCESS_BUNDLE_MODULE_LOCATION}" ) endfunction() return() endif() -get_filename_component(DOLPHIN_BUNDLE_PATH "${DOLPHIN_BUNDLE_PATH}" ABSOLUTE) message(STATUS "Fixing up application bundle: ${DOLPHIN_BUNDLE_PATH}") # Make sure to fix up any additional shared libraries (like plugins) that are From 4fa78be3ad256a339adfa1b1f7e7b62319d31878 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Thu, 1 Aug 2024 12:02:21 -0400 Subject: [PATCH 10/14] DolphinPostprocessBundle: Separate "-D" from DOLPHIN_BUNDLE_PATH definition For whatever reason, the previous way would inject backslashes into any path that has spaces. --- CMake/DolphinPostprocessBundle.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMake/DolphinPostprocessBundle.cmake b/CMake/DolphinPostprocessBundle.cmake index dfc71779f7..4a1c68562c 100644 --- a/CMake/DolphinPostprocessBundle.cmake +++ b/CMake/DolphinPostprocessBundle.cmake @@ -14,7 +14,7 @@ if(CMAKE_GENERATOR) set(_DOLPHIN_POSTPROCESS_BUNDLE_MODULE_LOCATION "${CMAKE_CURRENT_LIST_FILE}") function(dolphin_postprocess_bundle target) add_custom_command(TARGET ${target} POST_BUILD - COMMAND ${CMAKE_COMMAND} -DDOLPHIN_BUNDLE_PATH="$" + COMMAND ${CMAKE_COMMAND} "-D" "DOLPHIN_BUNDLE_PATH=$" -P "${_DOLPHIN_POSTPROCESS_BUNDLE_MODULE_LOCATION}" ) endfunction() From 16acdb630b3e231a9319edd84bc45a72e064b086 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Thu, 1 Aug 2024 12:02:43 -0400 Subject: [PATCH 11/14] MacUpdater: Post-process the bundle --- Source/Core/MacUpdater/CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Source/Core/MacUpdater/CMakeLists.txt b/Source/Core/MacUpdater/CMakeLists.txt index b27b466df9..d72dd46cd2 100644 --- a/Source/Core/MacUpdater/CMakeLists.txt +++ b/Source/Core/MacUpdater/CMakeLists.txt @@ -53,6 +53,18 @@ foreach(sb ${STORYBOARDS}) COMMENT "Compiling Storyboard ${sb}...") endforeach() +if(NOT SKIP_POSTPROCESS_BUNDLE) + # Update library references to make the bundle portable + include(DolphinPostprocessBundle) + dolphin_postprocess_bundle(MacUpdater) + + # Fix rpath + add_custom_command(TARGET MacUpdater + POST_BUILD COMMAND + ${CMAKE_INSTALL_NAME_TOOL} -add_rpath "@executable_path/../Frameworks/" + $) +endif() + if(MACOS_CODE_SIGNING) add_custom_command(TARGET MacUpdater POST_BUILD From 7c94edb02cae578515c345d699b378f67c2ad610 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Thu, 1 Aug 2024 12:31:11 -0400 Subject: [PATCH 12/14] CMakeLists: Embed macOS Updater app inside DolphinQt I accomplish this by adding a new step where a copy of the DolphinQt bundle is created, and then the Updater is inserted into it. --- Source/Core/CMakeLists.txt | 56 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/Source/Core/CMakeLists.txt b/Source/Core/CMakeLists.txt index 576e3eec62..b1c5a3ab17 100644 --- a/Source/Core/CMakeLists.txt +++ b/Source/Core/CMakeLists.txt @@ -30,3 +30,59 @@ endif() if (WIN32 AND ENABLE_AUTOUPDATE) add_subdirectory(WinUpdater) endif() + +if (APPLE AND ENABLE_QT) + set(DOLPHIN_MAC_BUNDLE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Dolphin.app") + + add_custom_target(build_final_bundle ALL + COMMAND ${CMAKE_COMMAND} -E remove_directory + ${DOLPHIN_MAC_BUNDLE} + + COMMAND cp -R + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DolphinQt.app + ${DOLPHIN_MAC_BUNDLE} + + # HACK: The Updater does not support setting the executable bit on new files, + # so don't use the new executable name, and instead continue to use "Dolphin". + COMMAND ${CMAKE_COMMAND} -E rename + ${DOLPHIN_MAC_BUNDLE}/Contents/MacOS/DolphinQt + ${DOLPHIN_MAC_BUNDLE}/Contents/MacOS/Dolphin + + COMMAND plutil + -replace CFBundleExecutable -string Dolphin + ${DOLPHIN_MAC_BUNDLE}/Contents/Info.plist + + DEPENDS dolphin-emu) + + if (ENABLE_AUTOUPDATE) + add_dependencies(build_final_bundle MacUpdater) + + add_custom_command(TARGET build_final_bundle + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory + "${DOLPHIN_MAC_BUNDLE}/Contents/Helpers" + + COMMAND cp -R + "$" + "${DOLPHIN_MAC_BUNDLE}/Contents/Helpers/Dolphin Updater.app") + + if (MACOS_CODE_SIGNING) + add_custom_command(TARGET build_final_bundle + POST_BUILD + COMMAND "${CMAKE_SOURCE_DIR}/Tools/mac-codesign.sh" + "-t" + "${MACOS_CODE_SIGNING_IDENTITY}" + "${DOLPHIN_MAC_BUNDLE}/Contents/Helpers/Dolphin Updater.app") + endif() + endif() + + if (MACOS_CODE_SIGNING) + add_custom_command(TARGET build_final_bundle + POST_BUILD + COMMAND "${CMAKE_SOURCE_DIR}/Tools/mac-codesign.sh" + "-t" + "-e" "${CMAKE_SOURCE_DIR}/Source/Core/DolphinQt/DolphinEmu$<$:Debug>.entitlements" + "${MACOS_CODE_SIGNING_IDENTITY}" + "${DOLPHIN_MAC_BUNDLE}") + endif() +endif() From 058000851b1c261858b4b89cd8636c6f5ecf6284 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Thu, 1 Aug 2024 12:38:16 -0400 Subject: [PATCH 13/14] AutoUpdate: Use the embedded Updater on macOS --- Source/Core/UICommon/AutoUpdate.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Source/Core/UICommon/AutoUpdate.cpp b/Source/Core/UICommon/AutoUpdate.cpp index 0bf87e4886..0f1ea63d58 100644 --- a/Source/Core/UICommon/AutoUpdate.cpp +++ b/Source/Core/UICommon/AutoUpdate.cpp @@ -49,15 +49,13 @@ const char UPDATER_LOG_FILE[] = "Updater.log"; std::string UpdaterPath(bool relocated = false) { - std::string path(File::GetExeDirectory() + DIR_SEP); #ifdef __APPLE__ if (relocated) - path += ".Dolphin Updater.2.app"; + return File::GetExeDirectory() + DIR_SEP + ".Dolphin Updater.2.app"; else - path += "Dolphin Updater.app"; - return path; + return File::GetBundleDirectory() + DIR_SEP + "Contents/Helpers/Dolphin Updater.app"; #else - return path + "Updater.exe"; + return File::GetExeDirectory() + DIR_SEP + "Updater.exe"; #endif } From 352bf09ef70f3c37335628fad22dcce2341be5f7 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Thu, 1 Aug 2024 14:55:34 -0400 Subject: [PATCH 14/14] BuildMacOSUniversalBinary: Switch to mac-codesign tool and codesign embedded updater --- BuildMacOSUniversalBinary.py | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/BuildMacOSUniversalBinary.py b/BuildMacOSUniversalBinary.py index 33973393a6..d09bd9a8b3 100755 --- a/BuildMacOSUniversalBinary.py +++ b/BuildMacOSUniversalBinary.py @@ -59,8 +59,6 @@ DEFAULT_CONFIG = { # running corrupted binaries and allows for access to the extended # permisions needed for ARM builds "codesign_identity": "-", - # Entitlements file to use for code signing - "entitlements": "../Source/Core/DolphinQt/DolphinEmu.entitlements", # Minimum macOS version for each architecture slice "arm64_mac_os_deployment_target": "11.0.0", @@ -119,11 +117,6 @@ def parse_args(conf=DEFAULT_CONFIG): help="Directory where universal binary will be stored", default=conf["dst_app"]) - parser.add_argument( - "--entitlements", - help="Path to .entitlements file for code signing", - default=conf["entitlements"]) - parser.add_argument("--run_unit_tests", action="store_true", default=conf["run_unit_tests"]) @@ -352,21 +345,21 @@ def build(config): src_app1 = ARCHITECTURES[1]+"/Binaries/" recursive_merge_binaries(src_app0, src_app1, dst_app) - for path in glob.glob(dst_app+"/*"): - if os.path.isdir(path) and os.path.splitext(path)[1] != ".app": - continue - + + if config["autoupdate"]: subprocess.check_call([ - "codesign", - "-d", - "--force", - "-s", + "../Tools/mac-codesign.sh", + "-t", + "-e", "preserve", config["codesign_identity"], - "--options=runtime", - "--entitlements", config["entitlements"], - "--deep", - "--verbose=2", - path]) + dst_app+"/Dolphin.app/Contents/Helpers/Dolphin Updater.app"]) + + subprocess.check_call([ + "../Tools/mac-codesign.sh", + "-t", + "-e", "preserve", + config["codesign_identity"], + dst_app+"/Dolphin.app"]) print("Built Universal Binary successfully!")