summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Lantinga <slouken@libsdl.org>2013-07-30 21:39:38 -0700
committerSam Lantinga <slouken@libsdl.org>2013-07-30 21:39:38 -0700
commit1a3a905aa960fb4e1b74d307fd677971a8012db0 (patch)
tree9be3f3c05e8cf9aa2899676ae01092389c69f1bb
parent94c6b39a045e55028e44d34bf0a2ce77652edb5f (diff)
Added code signature step to Framework build process
-rwxr-xr-xXcode/SDL/SDL.xcodeproj/project.pbxproj15
-rwxr-xr-xXcode/SDL/pkg-support/codesign-frameworks.sh43
2 files changed, 58 insertions, 0 deletions
diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj
index 09631ea5a1..494340bcb9 100755
--- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj
+++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj
@@ -2155,6 +2155,7 @@
BECDF62A0761BA81005FE872 /* Resources */,
BECDF62C0761BA81005FE872 /* Sources */,
BECDF6680761BA81005FE872 /* Frameworks */,
+ AA5C3FDC17A8C58600D6C8A1 /* Sign Frameworks */,
);
buildRules = (
);
@@ -2283,6 +2284,20 @@
/* End PBXRezBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
+ AA5C3FDC17A8C58600D6C8A1 /* Sign Frameworks */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Sign Frameworks";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "if [ \"$USER\" = \"slouken\" ]; then\n CODE_SIGN_IDENTITY=\"Mac Developer: Sam Lantinga (84TP7N5TA4)\" pkg-support/codesign-frameworks.sh || exit 1\nfi";
+ };
BECDF6BD0761BA81005FE872 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 12;
diff --git a/Xcode/SDL/pkg-support/codesign-frameworks.sh b/Xcode/SDL/pkg-support/codesign-frameworks.sh
new file mode 100755
index 0000000000..16dea25195
--- /dev/null
+++ b/Xcode/SDL/pkg-support/codesign-frameworks.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+# WARNING: You may have to run Clean in Xcode after changing CODE_SIGN_IDENTITY!
+
+# Verify that $CODE_SIGN_IDENTITY is set
+if [ -z "$CODE_SIGN_IDENTITY" ] ; then
+ echo "CODE_SIGN_IDENTITY needs to be non-empty for codesigning frameworks!"
+
+ if [ "$CONFIGURATION" = "Release" ] ; then
+ exit 1
+ else
+ # Codesigning is optional for non-release builds.
+ exit 0
+ fi
+fi
+
+SAVEIFS=$IFS
+IFS=$(echo -en "\n\b")
+
+FRAMEWORK_DIR="${TARGET_BUILD_DIR}"
+
+# Loop through all frameworks
+FRAMEWORKS=`find "${FRAMEWORK_DIR}" -type d -name "*.framework" | sed -e "s/\(.*\)/\1\/Versions\/A\//"`
+RESULT=$?
+if [[ $RESULT != 0 ]] ; then
+ exit 1
+fi
+
+echo "Found:"
+echo "${FRAMEWORKS}"
+
+for FRAMEWORK in $FRAMEWORKS;
+do
+ echo "Signing '${FRAMEWORK}'"
+ `codesign -f -v -s "${CODE_SIGN_IDENTITY}" "${FRAMEWORK}"`
+ RESULT=$?
+ if [[ $RESULT != 0 ]] ; then
+ exit 1
+ fi
+done
+
+# restore $IFS
+IFS=$SAVEIFS