3 # usage: ./mkdmg-osx.sh release/debug (case insensitive)
4 # Allows us to run mkdmg-osx.sh from anywhere in the three, rather than the tools/darwin/packaging/osx folder only
6 case "$XCODE_BUILDTYPE" in
8 *) SWITCH
="$XCODE_BUILDTYPE" ;;
13 # use for case insensitive match. revert to system default after this block
17 echo "Packaging Debug target for OSX"
20 echo "Packaging Release target for OSX"
24 echo "You need to specify the build target"
30 if [ ! -d $APP ]; then
31 echo "@APP_NAME@.app not found! are you sure you built $1 target?"
34 ARCHITECTURE
=`file $APP/Contents/MacOS/@APP_NAME@ | awk '{print $NF}'`
37 if [ "$EXPANDED_CODE_SIGN_IDENTITY_NAME" ]; then
38 # execute codesign script
39 "$DIRNAME/Codesign.command"
41 if [ -f "$APP/Contents/Resources/Kodi/tools/darwin/runtime/XBMCHelper" ]; then
42 codesign
--verbose=4 --sign "$EXPANDED_CODE_SIGN_IDENTITY_NAME" --force --options runtime
--timestamp --entitlements Kodi.entitlements
"$APP/Contents/Resources/Kodi/tools/darwin/runtime/XBMCHelper"
44 # perform top-level signing (Xcode does it automatically when signing settings are configured)
45 codesign
--verbose=4 --sign "$EXPANDED_CODE_SIGN_IDENTITY_NAME" --force --options runtime
--timestamp --entitlements Kodi.entitlements
"$APP"
48 PACKAGE
=org.xbmc.@APP_NAME_LC@
-osx
50 VERSION
=@APP_VERSION_MAJOR@.@APP_VERSION_MINOR@
53 if [ "@APP_VERSION_TAG_LC@" != "" ]; then
54 REVISION
=$REVISION~@APP_VERSION_TAG_LC@
57 ARCHIVE
=${PACKAGE}_${VERSION}-${REVISION}_macosx-${ARCHITECTURE}
59 echo Creating
$PACKAGE package version
$VERSION revision
$REVISION
60 dmgPath
="$DIRNAME/$ARCHIVE.dmg"
63 if [ -e "/Volumes/@APP_NAME@" ]; then
64 umount
/Volumes
/@APP_NAME@
67 #generate volume iconset
68 if [ `which iconutil` ]
70 echo "Generating volumeIcon.icns"
71 iconutil
-c icns
--output "VolumeIcon.icns" "../media/osx/volumeIcon.iconset"
74 "$DIRNAME/dmgmaker.sh" "$APP" "@APP_NAME@" "$dmgPath"
78 # codesign and notarize dmg
79 if [ "$EXPANDED_CODE_SIGN_IDENTITY_NAME" ]; then
80 codesign
--verbose=4 --sign "$EXPANDED_CODE_SIGN_IDENTITY_NAME" "$dmgPath"
81 if ! .
/notarize.sh
"$dmgPath" && [ "$isReleaseBuild" = 1 ]; then