Commit 272a03d7 authored by Ivan Yossi's avatar Ivan Yossi 👌

packaging macOS: Remove need of external template

- Generating a dmg does not depend on external download
- It is no longer necessary to provide a background to make dmg,
  we have a default style and default background.
parent 6d7f665b
This diff is collapsed.
......@@ -2,22 +2,12 @@
# Krita tool to create dmg from installed source
# Copies all files to a folder to be converted into the final dmg
# Background image must be set for it to deploy correcly
# automates the creation of the release DMG. It needs an image
# either png or jpg as first argument as it will use the image to set
# the background of the DMG.
# Necessary files can be downloaded from
# automates the creation of the release DMG.
# default background and style are used if none provided
# A short explanation of what it does:
# - Creates a copy of "krita-template" folder (this containes Terms of use
# and Applications) into kritadmg folder.
# Application folder symlink can be created with applescript but Terms of use contents cannot,
# also working like this allows to add other files to dmg if needed.
# Place the folder in ${BUILDROOT}
# - Copies contents to kritadmg folder
# - Copies i/share to Contents/Resources excluding unnecesary files
# - Copies translations, qml and quicklook PlugIns
......@@ -74,6 +64,7 @@ SCRIPT_SOURCE_DIR="$(get_script_dir)"
# There is some duplication between build and deploy scripts
# a config env file could would be a nice idea.
KIS_BUILD_DIR=${BUILDROOT}/kisbuild # only used for getting git sha number
......@@ -93,9 +84,10 @@ PY_VERSION="${local_PY_MAYOR_VERSION}.${local_PY_MINOR_VERSION}"
echo "Detected Python ${PY_VERSION}"
print_usage () {
echo "USAGE: [-s=<identity>] [-style=<style.txt>] <background-image>"
echo "USAGE: [-s=<identity>] [-style=<style.txt>] [-bg=<background-image>]"
echo "\t -s Code sign identity for codesign"
echo "\t -style Style file defined from '' output"
echo "\t -bg Set a background image for dmg folder"
echo "\t osxdeploy needs an input image to add to the dmg background
\t image recomended size is at least 950x500\n"
......@@ -121,14 +113,15 @@ if test ${#} -eq 0; then
for arg in "${@}"; do
if [[ -f ${arg} ]]; then
if [ "${arg}" = -bg=* -a -f "${arg#*=}" ]; then
echo "attempting to check background is valid jpg or png..."
BG_FORMAT=$(sips --getProperty format ${arg} | awk '{printf $2}')
BG_FORMAT=$(sips --getProperty format ${bg_filename} | awk '{printf $2}')
if [[ "png" = ${BG_FORMAT} || "jpeg" = ${BG_FORMAT} ]];then
echo "valid image file"
DMG_background=$(cd "$(dirname "${arg}")"; pwd -P)/$(basename "${arg}")
DMG_background=$(cd "$(dirname "${bg_filename}")"; pwd -P)/$(basename "${bg_filename}")
# check imageDPI
BG_DPI=$(sips --getProperty dpiWidth ${DMG_background} | grep dpi | awk '{print $2}')
......@@ -164,11 +157,10 @@ echo "Using style from: ${DMG_STYLE}"
if [[ ${DMG_validBG} -eq 0 ]]; then
echo "No jpg or png valid file detected!!"
echo "exiting"
echo "Using default style"
if [[ -z "${CODE_SIGNATURE}" ]]; then
echo "WARNING: No signature provided, Code will not be signed"
......@@ -323,7 +315,8 @@ krita_deploy () {
echo "Preparing ${KRITA_DMG} for deployment..."
echo "Copying"
mkdir "${KRITA_DMG}"
rsync -prul ${KIS_INSTALL_DIR}/bin/ ${KRITA_DMG}
mkdir -p ${KRITA_DMG}/
......@@ -487,9 +480,12 @@ createDMG () {
if [[ ! -d "/Volumes/${DMG_title}/.background" ]]; then
mkdir "/Volumes/${DMG_title}/.background"
cp -v ${DMG_background} "/Volumes/${DMG_title}/.background/"
mkdir "/Volumes/${DMG_title}/Terms of Use"
cp -v "${KIS_SRC_DIR}/packaging/macos/Terms_of_use.rtf" "/Volumes/${DMG_title}/Terms of Use/"
ln -s "/Applications" "/Volumes/${DMG_title}/Applications"
## Apple script to set style
printf "${style}" "${DMG_title}" "${DMG_background##*/}" | osascript
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment