diff --git a/dist/DS_Store.in b/dist/DS_Store.in new file mode 100644 index 000000000..bea3a4bcf Binary files /dev/null and b/dist/DS_Store.in differ diff --git a/dist/create-dmg.sh b/dist/create-dmg.sh new file mode 100755 index 000000000..7b02be27a --- /dev/null +++ b/dist/create-dmg.sh @@ -0,0 +1,59 @@ +#!/bin/sh +# author: max@last.fm, muesli@tomahawk-player.org +# brief: Produces a compressed DMG from a bundle directory +# usage: Pass the bundle directory as the only parameter +# note: This script depends on the Tomahawk build system, and must be run from +# the build directory +################################################################################ + + +#if [ -z $VERSION ] +#then +# echo VERSION must be set +# exit 2 +#fi + +if [ -z "$1" ] +then + echo "Please pass the bundle.app directory as the first parameter." + exit 3 +fi +################################################################################ + + +NAME=$(basename "$1" | perl -pe 's/(.*).app/\1/') +IN="$1" +TMP="dmg/$NAME" +OUT="$NAME.dmg" +mkdir -p "$TMP" +################################################################################ + + +# clean up +rm -rf "$TMP" +rm -f "$OUT" + +# create DMG contents and copy files +mkdir -p "$TMP/.background" +cp ../dist/dmg_background.png "$TMP/.background/background.png" +cp ../dist/DS_Store.in "$TMP/.DS_Store" +chmod go-rwx "$TMP/.DS_Store" +ln -s /Applications "$TMP/Applications" +# copies the prepared bundle into the dir that will become the DMG +cp -R "$IN" "$TMP" + +# create +hdiutil makehybrid -hfs -hfs-volume-name Clementine -hfs-openfolder "$TMP" "$TMP" -o tmp.dmg +hdiutil convert -format UDZO -imagekey zlib-level=9 tmp.dmg -o "$OUT" + +# cleanup +rm tmp.dmg + +#hdiutil create -srcfolder "$TMP" \ +# -format UDZO -imagekey zlib-level=9 \ +# -scrub \ +# "$OUT" \ +# || die "Error creating DMG :(" + +# done ! +echo 'DMG size:' `du -hs "$OUT" | awk '{print $1}'` diff --git a/dist/dmg_background.png b/dist/dmg_background.png new file mode 100644 index 000000000..a516605d9 Binary files /dev/null and b/dist/dmg_background.png differ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 10cd81cbe..1eecc2637 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1182,7 +1182,7 @@ if (APPLE) add_custom_command( OUTPUT ${PROJECT_BINARY_DIR}/clementine-${CLEMENTINE_VERSION_RPM}.dmg ${CMAKE_COMMAND} -E remove -f ${PROJECT_BINARY_DIR}/clementine-${CLEMENTINE_VERSION_RPM}.dmg - COMMAND macdeployqt clementine.app -no-plugins -dmg + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../dist/create-dmg.sh ${PROJECT_BINARY_DIR}/clementine.app COMMAND ${CMAKE_COMMAND} -E rename ${PROJECT_BINARY_DIR}/clementine.dmg ${PROJECT_BINARY_DIR}/clementine-${CLEMENTINE_VERSION_RPM}.dmg