Cocoa Port: Perform post-build code signing for final stage of Release build.

This commit is contained in:
rogerman 2021-09-03 12:03:06 -07:00
parent 777329a993
commit 192e0f88b2
2 changed files with 1 additions and 2 deletions

View File

@ -4074,7 +4074,6 @@
AB407F381A620D6E00313213 /* OptimizationProfiles */ = { AB407F381A620D6E00313213 /* OptimizationProfiles */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
AB407F391A620D6E00313213 /* DeSmuME (Latest).profdata */,
); );
path = OptimizationProfiles; path = OptimizationProfiles;
sourceTree = "<group>"; sourceTree = "<group>";

View File

@ -10,7 +10,7 @@
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction"> ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent <ActionContent
title = "Run Script" title = "Run Script"
scriptText = "#!/bin/sh&#10;&#10;# This script creates an application package that merges the ppc binary of an&#10;# Xcode 3 PowerPC release build, the i386 binary of an Xcode 9 x86 32-bit &#10;# release build, and the x86_64 binary of an Xcode 12 (or later) release build.&#10;#&#10;# It also replaces the .nib files with ones that are created specifically in&#10;# Xcode 6, which is the last version of Xcode that can compile Leopard-compatible&#10;# .nib files.&#10;#&#10;# Before you build this final stage of the DeSmuME release build, make sure that&#10;# you have already created the following builds of DeSmuME and that they are all&#10;# located in the ${SRCROOT}/build/Release directory:&#10;# - DeSmuME (PPC).app | Use Xcode 3&#10;# - DeSmuME (extract NIB).app | Use Xcode 6&#10;# - DeSmuME (32bit).app | Use Xcode 9&#10;&#10;# Create the Merged Release directory, plus a working copy of the .app.&#10;mkdir -p &quot;${SRCROOT}/build/Merged Release&quot;&#10;cd &quot;${SRCROOT}/build/Merged Release&quot;&#10;cp -a &quot;${SRCROOT}/build/Release/${PRODUCT_NAME}.app&quot; &quot;./&quot;&#10;&#10;if test -e &quot;${SRCROOT}/build/Release/DeSmuME (PPC).app/Contents/MacOS/DeSmuME (PPC)&quot;&#10;then&#10;&#10;cd &quot;${SRCROOT}/build/Release/${PRODUCT_NAME}.app/Contents/MacOS&quot;&#10;&#10;# Create the temp binaries for Intel.&#10;cp -a &quot;${SRCROOT}/build/Release/DeSmuME (32bit).app/Contents/MacOS/DeSmuME (32bit)&quot; &quot;./${EXECUTABLE_NAME}_i386&quot;&#10;cp -a &quot;./${EXECUTABLE_NAME}&quot; &quot;./${EXECUTABLE_NAME}_x86_64&quot;&#10;&#10;# Merge the separate temp binaries into a single binary package.&#10;rm -f &quot;${SRCROOT}/build/Merged Release/${PRODUCT_NAME}.app/Contents/MacOS/${EXECUTABLE_NAME}&quot;&#10;lipo &quot;${SRCROOT}/build/Release/DeSmuME (PPC).app/Contents/MacOS/DeSmuME (PPC)&quot; &quot;./${EXECUTABLE_NAME}_i386&quot; &quot;./${EXECUTABLE_NAME}_x86_64&quot; -create -output &quot;${SRCROOT}/build/Merged Release/${PRODUCT_NAME}.app/Contents/MacOS/${EXECUTABLE_NAME}&quot;&#10;&#10;# Remove the temp binaries now that we&apos;re done with them.&#10;rm -f &quot;./${EXECUTABLE_NAME}_i386&quot;&#10;rm -f &quot;./${EXECUTABLE_NAME}_x86_64&quot;&#10;&#10;fi&#10;&#10;# Copy the .nib files from an &quot;extract NIB&quot; .app to the Merged Release .app&#10;cd &quot;${SRCROOT}/build/Merged Release/${PRODUCT_NAME}.app/Contents/Resources/English.lproj&quot;&#10;rm -f &quot;./MainMenu.nib&quot;&#10;rm -f &quot;./DisplayWindow.nib&quot;&#10;cp -af &quot;${SRCROOT}/build/Release/DeSmuME (extract NIB).app/Contents/Resources/English.lproj/MainMenu.nib&quot; &quot;./&quot;&#10;cp -af &quot;${SRCROOT}/build/Release/DeSmuME (extract NIB).app/Contents/Resources/English.lproj/DisplayWindow.nib&quot; &quot;./&quot;&#10;&#10;# This final stage build sets the minimum system version to macOS v10.7, so we need to reset it to macOS v10.5 here.&#10;defaults write &quot;${SRCROOT}/build/Merged Release/${PRODUCT_NAME}.app/Contents/Info.plist&quot; LSMinimumSystemVersion -string &apos;10.5&apos;&#10;"> scriptText = "#!/bin/sh&#10;&#10;# This script creates an application package that merges the ppc binary of an&#10;# Xcode 3 PowerPC release build, the i386 binary of an Xcode 9 x86 32-bit &#10;# release build, and the x86_64 binary of an Xcode 12 (or later) release build.&#10;#&#10;# It also replaces the .nib files with ones that are created specifically in&#10;# Xcode 6, which is the last version of Xcode that can compile Leopard-compatible&#10;# .nib files.&#10;#&#10;# Before you build this final stage of the DeSmuME release build, make sure that&#10;# you have already created the following builds of DeSmuME and that they are all&#10;# located in the ${SRCROOT}/build/Release directory:&#10;# - DeSmuME (PPC).app | Use Xcode 3&#10;# - DeSmuME (extract NIB).app | Use Xcode 6&#10;# - DeSmuME (32bit).app | Use Xcode 9&#10;&#10;# Create the Merged Release directory, plus a working copy of the .app.&#10;mkdir -p &quot;${SRCROOT}/build/Merged Release&quot;&#10;cd &quot;${SRCROOT}/build/Merged Release&quot;&#10;cp -a &quot;${SRCROOT}/build/Release/${PRODUCT_NAME}.app&quot; &quot;./&quot;&#10;&#10;if test -e &quot;${SRCROOT}/build/Release/DeSmuME (PPC).app/Contents/MacOS/DeSmuME (PPC)&quot;&#10;then&#10;&#10;cd &quot;${SRCROOT}/build/Release/${PRODUCT_NAME}.app/Contents/MacOS&quot;&#10;&#10;# Create the temp binaries for Intel.&#10;cp -a &quot;${SRCROOT}/build/Release/DeSmuME (32bit).app/Contents/MacOS/DeSmuME (32bit)&quot; &quot;./${EXECUTABLE_NAME}_i386&quot;&#10;cp -a &quot;./${EXECUTABLE_NAME}&quot; &quot;./${EXECUTABLE_NAME}_x86_64&quot;&#10;&#10;# Merge the separate temp binaries into a single binary package.&#10;rm -f &quot;${SRCROOT}/build/Merged Release/${PRODUCT_NAME}.app/Contents/MacOS/${EXECUTABLE_NAME}&quot;&#10;lipo &quot;${SRCROOT}/build/Release/DeSmuME (PPC).app/Contents/MacOS/DeSmuME (PPC)&quot; &quot;./${EXECUTABLE_NAME}_i386&quot; &quot;./${EXECUTABLE_NAME}_x86_64&quot; -create -output &quot;${SRCROOT}/build/Merged Release/${PRODUCT_NAME}.app/Contents/MacOS/${EXECUTABLE_NAME}&quot;&#10;&#10;# Remove the temp binaries now that we&apos;re done with them.&#10;rm -f &quot;./${EXECUTABLE_NAME}_i386&quot;&#10;rm -f &quot;./${EXECUTABLE_NAME}_x86_64&quot;&#10;&#10;fi&#10;&#10;# Copy the .nib files from an &quot;extract NIB&quot; .app to the Merged Release .app&#10;cd &quot;${SRCROOT}/build/Merged Release/${PRODUCT_NAME}.app/Contents/Resources/English.lproj&quot;&#10;rm -f &quot;./MainMenu.nib&quot;&#10;rm -f &quot;./DisplayWindow.nib&quot;&#10;cp -af &quot;${SRCROOT}/build/Release/DeSmuME (extract NIB).app/Contents/Resources/English.lproj/MainMenu.nib&quot; &quot;./&quot;&#10;cp -af &quot;${SRCROOT}/build/Release/DeSmuME (extract NIB).app/Contents/Resources/English.lproj/DisplayWindow.nib&quot; &quot;./&quot;&#10;&#10;# This final stage build sets the minimum system version to macOS v10.7, so we need to reset it to macOS v10.5 here.&#10;defaults write &quot;${SRCROOT}/build/Merged Release/${PRODUCT_NAME}.app/Contents/Info.plist&quot; LSMinimumSystemVersion -string &apos;10.5&apos;&#10;&#10;# We just modified stuff in the .app, so we need to code sign again. Since this is an&#10;# open source project, we&apos;ll just use ad hoc code signing here.&#10;codesign --force --deep -s - &quot;${SRCROOT}/build/Merged Release/${PRODUCT_NAME}.app&quot;&#10;">
<EnvironmentBuildable> <EnvironmentBuildable>
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"