Moved code signature step to after the framework build step is complete, and don't hardcode the codesign identity
authorSam Lantinga <slouken@libsdl.org>
Sun, 26 Apr 2015 20:46:07 -0700
changeset 957705445a09a406
parent 9576 ae673db0ca8f
child 9578 e78393ffcd50
Moved code signature step to after the framework build step is complete, and don't hardcode the codesign identity
Xcode/SDL/SDL.xcodeproj/project.pbxproj
Xcode/SDL/pkg-support/codesign-frameworks.sh
     1.1 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj	Sun Apr 26 20:21:06 2015 -0700
     1.2 +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj	Sun Apr 26 20:46:07 2015 -0700
     1.3 @@ -2248,7 +2248,6 @@
     1.4  				BECDF62A0761BA81005FE872 /* Resources */,
     1.5  				BECDF62C0761BA81005FE872 /* Sources */,
     1.6  				BECDF6680761BA81005FE872 /* Frameworks */,
     1.7 -				AA5C3FDC17A8C58600D6C8A1 /* Sign Frameworks */,
     1.8  			);
     1.9  			buildRules = (
    1.10  			);
    1.11 @@ -2385,20 +2384,6 @@
    1.12  /* End PBXRezBuildPhase section */
    1.13  
    1.14  /* Begin PBXShellScriptBuildPhase section */
    1.15 -		AA5C3FDC17A8C58600D6C8A1 /* Sign Frameworks */ = {
    1.16 -			isa = PBXShellScriptBuildPhase;
    1.17 -			buildActionMask = 2147483647;
    1.18 -			files = (
    1.19 -			);
    1.20 -			inputPaths = (
    1.21 -			);
    1.22 -			name = "Sign Frameworks";
    1.23 -			outputPaths = (
    1.24 -			);
    1.25 -			runOnlyForDeploymentPostprocessing = 0;
    1.26 -			shellPath = /bin/sh;
    1.27 -			shellScript = "if [ \"$USER\" = \"slouken\" ]; then\n    CODE_SIGN_IDENTITY=\"Mac Developer: Sam Lantinga (84TP7N5TA4)\" pkg-support/codesign-frameworks.sh || exit 1\nfi";
    1.28 -		};
    1.29  		BECDF6BD0761BA81005FE872 /* ShellScript */ = {
    1.30  			isa = PBXShellScriptBuildPhase;
    1.31  			buildActionMask = 12;
    1.32 @@ -2406,7 +2391,7 @@
    1.33  			);
    1.34  			runOnlyForDeploymentPostprocessing = 0;
    1.35  			shellPath = /bin/sh;
    1.36 -			shellScript = "# clean up the framework, remove headers, extra files\nmkdir -p build/dmg-tmp\nxcrun CpMac -r $TARGET_BUILD_DIR/SDL2.framework build/dmg-tmp/\n\ncp pkg-support/resources/License.txt build/dmg-tmp\ncp pkg-support/resources/ReadMe.txt build/dmg-tmp\n\n# remove the .DS_Store files if any (we may want to provide one in the future for fancy .dmgs)\nfind build/dmg-tmp -name .DS_Store -exec rm -f \"{}\" \\;\n\n# for fancy .dmg\nmkdir -p build/dmg-tmp/.logo\ncp pkg-support/resources/SDL_DS_Store build/dmg-tmp/.DS_Store\ncp pkg-support/sdl_logo.pdf build/dmg-tmp/.logo\n\n# create the dmg\nhdiutil create -ov -fs HFS+ -volname SDL2 -srcfolder build/dmg-tmp build/SDL2.dmg\n\n# clean up\nrm -rf build/dmg-tmp";
    1.37 +			shellScript = "# Sign framework\nif [ \"$SDL_CODESIGN_IDENTITY\" != \"\" ]; then\n    codesign --force --sign \"$SDL_CODESIGN_IDENTITY\" $TARGET_BUILD_DIR/SDL2.framework/Versions/A\nfi\n\n# clean up the framework, remove headers, extra files\nmkdir -p build/dmg-tmp\nxcrun CpMac -r $TARGET_BUILD_DIR/SDL2.framework build/dmg-tmp/\n\ncp pkg-support/resources/License.txt build/dmg-tmp\ncp pkg-support/resources/ReadMe.txt build/dmg-tmp\n\n# remove the .DS_Store files if any (we may want to provide one in the future for fancy .dmgs)\nfind build/dmg-tmp -name .DS_Store -exec rm -f \"{}\" \\;\n\n# for fancy .dmg\nmkdir -p build/dmg-tmp/.logo\ncp pkg-support/resources/SDL_DS_Store build/dmg-tmp/.DS_Store\ncp pkg-support/sdl_logo.pdf build/dmg-tmp/.logo\n\n# create the dmg\nhdiutil create -ov -fs HFS+ -volname SDL2 -srcfolder build/dmg-tmp build/SDL2.dmg\n\n# clean up\nrm -rf build/dmg-tmp";
    1.38  		};
    1.39  /* End PBXShellScriptBuildPhase section */
    1.40  
     2.1 --- a/Xcode/SDL/pkg-support/codesign-frameworks.sh	Sun Apr 26 20:21:06 2015 -0700
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,43 +0,0 @@
     2.4 -#!/bin/sh
     2.5 -
     2.6 -# WARNING: You may have to run Clean in Xcode after changing CODE_SIGN_IDENTITY!
     2.7 -
     2.8 -# Verify that $CODE_SIGN_IDENTITY is set
     2.9 -if [ -z "$CODE_SIGN_IDENTITY" ] ; then
    2.10 -    echo "CODE_SIGN_IDENTITY needs to be non-empty for codesigning frameworks!"
    2.11 -
    2.12 -    if [ "$CONFIGURATION" = "Release" ] ; then
    2.13 -        exit 1
    2.14 -    else
    2.15 -        # Codesigning is optional for non-release builds.
    2.16 -        exit 0
    2.17 -    fi
    2.18 -fi
    2.19 -
    2.20 -FRAMEWORK_DIR="${TARGET_BUILD_DIR}"
    2.21 -
    2.22 -# Loop through all frameworks
    2.23 -FRAMEWORKS=`find "${FRAMEWORK_DIR}" -type d -name "*.framework" | sort -r`
    2.24 -RESULT=$?
    2.25 -if [[ $RESULT != 0 ]] ; then
    2.26 -    exit 1
    2.27 -fi
    2.28 -
    2.29 -for FRAMEWORK in $FRAMEWORKS;
    2.30 -do
    2.31 -    if [[ "$CONFIGURATION" = "Release" ]]; then
    2.32 -        echo "Stripping '${FRAMEWORK}'"
    2.33 -        NAME=$(basename "${FRAMEWORK}" .framework)
    2.34 -        xcrun strip -x "${FRAMEWORK}/${NAME}"
    2.35 -        RESULT=$?
    2.36 -        if [[ $RESULT != 0 ]] ; then
    2.37 -            exit 1
    2.38 -        fi
    2.39 -    fi
    2.40 -    echo "Signing '${FRAMEWORK}'"
    2.41 -    codesign -f -v -s "${CODE_SIGN_IDENTITY}" "${FRAMEWORK}"
    2.42 -    RESULT=$?
    2.43 -    if [[ $RESULT != 0 ]] ; then
    2.44 -        exit 1
    2.45 -    fi
    2.46 -done