aboutsummaryrefslogtreecommitdiff
path: root/tools/darwin/packaging/osx
diff options
context:
space:
mode:
authorAndrey Filipenkov <decapitator@ukr.net>2020-01-11 18:42:56 +0300
committerAndrey Filipenkov <decapitator@ukr.net>2020-07-14 19:53:04 +0300
commitfb4551fc4725a7d0c879a7e8506d8d0829da40bb (patch)
tree066bf1596b51080d1dfcef5ee753233825941760 /tools/darwin/packaging/osx
parent6af6f252c1f8a2fd14b25f8e68f37beeadaae334 (diff)
[macos] add ability to codesign app and dmg
Diffstat (limited to 'tools/darwin/packaging/osx')
-rw-r--r--tools/darwin/packaging/osx/Kodi.entitlements.in10
-rwxr-xr-xtools/darwin/packaging/osx/mkdmg-osx.sh.in20
2 files changed, 28 insertions, 2 deletions
diff --git a/tools/darwin/packaging/osx/Kodi.entitlements.in b/tools/darwin/packaging/osx/Kodi.entitlements.in
new file mode 100644
index 0000000000..f65c3581d8
--- /dev/null
+++ b/tools/darwin/packaging/osx/Kodi.entitlements.in
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>com.apple.security.cs.disable-library-validation</key>
+ <true/>
+ <key>com.apple.security.get-task-allow</key>
+ <@ALLOW_DEBUGGER@/>
+</dict>
+</plist>
diff --git a/tools/darwin/packaging/osx/mkdmg-osx.sh.in b/tools/darwin/packaging/osx/mkdmg-osx.sh.in
index ad9d44e51e..4d7a3e88f0 100755
--- a/tools/darwin/packaging/osx/mkdmg-osx.sh.in
+++ b/tools/darwin/packaging/osx/mkdmg-osx.sh.in
@@ -2,7 +2,7 @@
# usage: ./mkdmg-osx.sh release/debug (case insensitive)
# Allows us to run mkdmg-osx.sh from anywhere in the three, rather than the tools/darwin/packaging/osx folder only
-SWITCH=`echo $1 | tr [A-Z] [a-z]`
+SWITCH="$1"
DIRNAME=`dirname $0`
if [ ${SWITCH:-""} = "debug" ]; then
@@ -22,6 +22,16 @@ if [ ! -d $APP ]; then
fi
ARCHITECTURE=`file $APP/Contents/MacOS/@APP_NAME@ | awk '{print $NF}'`
+# codesign .app
+if [ "$EXPANDED_CODE_SIGN_IDENTITY_NAME" ]; then
+ # execute codesign script
+ "$DIRNAME/Codesign.command"
+ # sign helper tool
+ codesign --verbose=4 --sign "$EXPANDED_CODE_SIGN_IDENTITY_NAME" --options runtime --timestamp --entitlements Kodi.entitlements "$APP/Contents/Resources/Kodi/tools/darwin/runtime/XBMCHelper"
+ # perform top-level signing (Xcode does it automatically when signing settings are configured)
+ codesign --verbose=4 --sign "$EXPANDED_CODE_SIGN_IDENTITY_NAME" --options runtime --timestamp --entitlements Kodi.entitlements "$APP"
+fi
+
PACKAGE=org.xbmc.@APP_NAME_LC@-osx
VERSION=@APP_VERSION_MAJOR@.@APP_VERSION_MINOR@
@@ -34,7 +44,8 @@ fi
ARCHIVE=${PACKAGE}_${VERSION}-${REVISION}_macosx-intel-${ARCHITECTURE}
echo Creating $PACKAGE package version $VERSION revision $REVISION
-rm -rf $DIRNAME/$ARCHIVE.dmg
+dmgPath="$DIRNAME/$ARCHIVE.dmg"
+rm -rf "$dmgPath"
if [ -e "/Volumes/@APP_NAME_LC@" ]; then
umount /Volumes/@APP_NAME_LC@
@@ -50,3 +61,8 @@ fi
$DIRNAME/dmgmaker.pl $APP $ARCHIVE
echo "done"
+
+# codesign dmg
+if [ "$EXPANDED_CODE_SIGN_IDENTITY_NAME" ]; then
+ codesign --verbose=4 --sign "$EXPANDED_CODE_SIGN_IDENTITY_NAME" "$dmgPath"
+fi