Browse Source

build: Use 'create-dmg' on macOS for prettier .dmg files (#288)

enemy-events-ext
Alice D 2 months ago
committed by GitHub
parent
commit
6cd4fa2127
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 6 deletions
  1. +25
    -6
      scripts/macos-gen-dmg.py

+ 25
- 6
scripts/macos-gen-dmg.py View File

@ -9,6 +9,7 @@ import argparse
import subprocess
import shlex
import os
from sys import platform
def main(args):
@ -28,12 +29,30 @@ def main(args):
args = parser.parse_args(args[1:])
with temp_install(args.build_dir) as install_path:
(install_path / 'Applications').symlink_to('/Applications')
command = shlex.split('genisoimage -V Taisei -D -R -apple -no-pad -o') + [
args.output,
str(install_path),
]
# for compiling on Darwin as 'genisoimage' doesn't exist
# uses 'create-dmg' (brew install create-dmg)
if platform == "darwin":
command = shlex.split('''create-dmg
--volname "Taisei"
--volicon "Taisei.app/Contents/Resources/Taisei.icns"
--window-pos 200 120
--window-size 550 480
--icon-size 64
--icon "Taisei.app" 100 50
--icon "README.txt" 50 200
--icon "STORY.txt" 200 200
--icon "GAME.html" 350 200
--icon "COPYING" 125 350
--icon "ENVIRON.html" 275 350
--hide-extension "Taisei.app"
--app-drop-link 300 50''') + [args.output, str(install_path)]
else:
(install_path / 'Applications').symlink_to('/Applications')
command = shlex.split('genisoimage -V Taisei -D -R -apple -no-pad -o') + [
args.output,
str(install_path),
]
subprocess.check_call(command, cwd=str(install_path))


Loading…
Cancel
Save