summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-06-30 18:46:32 (GMT)
committerTobias Markmann <tm@ayena.de>2016-06-30 18:46:49 (GMT)
commita1be6105b97dddc1e03db0075f6ca3fc47fa8e1d (patch)
tree9abb38c4966a2b7871257b0f2e5df90764ce70c7 /Swift
parent82dd5a11131b3bd3641316b87aa279d806c970b0 (diff)
downloadswift-a1be6105b97dddc1e03db0075f6ca3fc47fa8e1d.zip
swift-a1be6105b97dddc1e03db0075f6ca3fc47fa8e1d.tar.bz2
Add initial support for code signing on OS X
See DEVELOPMENT.md for instructions. Test-Information: Tested using a self-signed code signing certificate created using Keychain Access.app. Compared the output of 'codesign -vvv -d' on Swift.app with preinstall apps. The output looks much the same except for the signing authority. Change-Id: Idbb3209ad917091c371ced61ec8a77e3e5d18884
Diffstat (limited to 'Swift')
-rwxr-xr-xSwift/Packaging/MacOSX/package.sh6
-rw-r--r--Swift/QtUI/SConscript2
2 files changed, 7 insertions, 1 deletions
diff --git a/Swift/Packaging/MacOSX/package.sh b/Swift/Packaging/MacOSX/package.sh
index a13a03c..7a63237 100755
--- a/Swift/Packaging/MacOSX/package.sh
+++ b/Swift/Packaging/MacOSX/package.sh
@@ -4,6 +4,7 @@ APP=$1
TEMPLATE=$2
TARGET=$3
QTDIR=$4
+CODESIGN_IDENTITY=$5
if [[ ! -f "$TEMPLATE" || ! -d "$APP" || ! -d "$QTDIR" || -z "$TARGET" ]]; then
echo "Error"
@@ -30,6 +31,11 @@ rm "$WC_DIR"/`basename $APP`/Contents/PlugIns/bearer/*.dylib
# Remove debugging symbols from the application bundle
rm -rf "$WC_DIR"/`basename $APP`/Contents/MacOS/*.dSYM
+# Codesign the app bundle if requested by caller
+if [ ! -z "$CODESIGN_IDENTITY" ]; then
+ codesign --verbose --force --deep --sign "$CODESIGN_IDENTITY" "$WC_DIR"/`basename $APP`
+fi
+
hdiutil detach "$WC_DIR" -quiet -force
rm -f $TARGET
hdiutil convert "$WC_DMG" -quiet -format UDZO -imagekey zlib-level=9 -o "$TARGET"
diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript
index 9c3d0af..4b3d716 100644
--- a/Swift/QtUI/SConscript
+++ b/Swift/QtUI/SConscript
@@ -368,7 +368,7 @@ if env["PLATFORM"] == "darwin" :
commonResources[""] = commonResources.get("", []) + ["#/Swift/resources/MacOSX/Swift.icns"]
app = myenv.AppBundle("Swift", version = myenv["SWIFT_VERSION"], resources = commonResources, frameworks = frameworks, handlesXMPPURIs = True)
if env["DIST"] :
- myenv.Command(["#/Packages/Swift/Swift-${SWIFT_VERSION}.dmg"], [app], ["Swift/Packaging/MacOSX/package.sh " + app.path + " Swift/Packaging/MacOSX/Swift.dmg.gz $TARGET $QTDIR"])
+ myenv.Command(["#/Packages/Swift/Swift-${SWIFT_VERSION}.dmg"], [app], ["Swift/Packaging/MacOSX/package.sh " + app.path + " Swift/Packaging/MacOSX/Swift.dmg.gz $TARGET $QTDIR " + "\"$CODE_SIGN_IDENTITY\""])
dsym = myenv.Command(["Swift-${SWIFT_VERSION}.dSYM"], ["Swift"], ["dsymutil -o ${TARGET} ${SOURCE}"])
myenv.Command(["#/Packages/Swift/Swift-${SWIFT_VERSION}.dSYM.zip"], dsym, ["cd ${SOURCE.dir} && zip -r ${TARGET.abspath} ${SOURCE.name}"])