From 2952ef53eb154cdac3ed27daf664abfc106899f0 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 27 Oct 2018 16:49:09 -0700 Subject: [PATCH] Use create-dmg script to automate building of macOS image. --- dist/make-macosx-app | 19 +++++++++++++++++-- dist/shared.sh | 5 +++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/dist/make-macosx-app b/dist/make-macosx-app index fba4d5dba..dad39e2d6 100755 --- a/dist/make-macosx-app +++ b/dist/make-macosx-app @@ -47,6 +47,8 @@ shift 2 OUT=${MACOSX_OUT}-${ARCH} ARCH_BASE=${DIST_DIR}-${ARCH} +DMG_DIR=macos-app +DMG_FILE=${ARCH_BASE}.dmg compile () { @@ -54,6 +56,16 @@ compile () my_make compile-microcode } +make_dmg () +{ + new_temp_dir "${DMG_DIR}" + local APP_DIR="MIT:GNU Scheme ${RELEASE}.app" + my_mv "${DIST_DIR}"/src/mit-scheme.app "${DMG_DIR}"/"${APP_DIR}" + my_ln_s /Applications "${DMG_DIR}"/. + my_rm_f "${DMG_FILE}" + create-dmg --volname "MIT-GNU Scheme ${RELEASE}" "${DMG_FILE}" "${DMG_DIR}" +} + notify "Compiling executable" unpack_dist_file_to "${ARCH_BASE}" "${DIST_DIR}" run_command "${OUT}"-compile "${DIST_DIR}"/src compile "${@}" @@ -61,5 +73,8 @@ run_command "${OUT}"-compile "${DIST_DIR}"/src compile "${@}" notify "Building application bundle" VERSION_STRING=${RELEASE} \ run_command "${OUT}"-buildapp "${DIST_DIR}"/src etc/macosx/make-app.sh -my_rm_rf "${ARCH_BASE}".app -my_mv "${DIST_DIR}"/src/mit-scheme.app "${ARCH_BASE}".app + +notify "Building disk image" +run_command "${OUT}"-makedmg "${TL_DIR}" make_dmg + +notify_finished diff --git a/dist/shared.sh b/dist/shared.sh index e755b8601..25140d490 100644 --- a/dist/shared.sh +++ b/dist/shared.sh @@ -155,6 +155,11 @@ my_rm_rf () cmd rm -rf "${@}" } +my_ln_s () +{ + cmd ln -s "${@}" +} + my_rmdir () { cmd rmdir "${@}" -- 2.25.1