Files
iccery-v2-mac/scripts/dmgbuild-settings.py
gronod 7f6c47d85c
macOS CI / package (pull_request) Canceled after 0s
macOS CI / build-and-test (pull_request) Canceled after 6m31s
fix(ci): do not require dmgbuild 1.6.7 on Monterey Python 3.9
The tools step runs on the test job. System Python is 3.9;
dmgbuild 1.6.6+ declares Requires-Python >=3.10, so pip only
lists 1.6.5 and the 1.6.7 floor failed the gate.

Install the newest wheel this interpreter accepts. Keep the
HiDPI TIFF background path and the hard-fail if art is missing.
2026-09-14 10:14:29 +00:00

62 lines
2.1 KiB
Python
Executable File

#!/usr/bin/env python3
# scripts/dmgbuild-settings.py
#
# dmgbuild settings for ICCery. scripts/package-release.sh exports
# DMG_APP, DMG_FILENAME, DMG_VOLUME_NAME, and DMG_BACKGROUND (a
# HiDPI TIFF). A missing background is a hard error — a grey
# Finder window is not an acceptable release artefact (#95).
import os
import sys
filename = os.environ.get('DMG_FILENAME', 'ICCery.dmg')
volume_name = os.environ.get('DMG_VOLUME_NAME', 'ICCery')
# The built .app must be staged into the image. Without this the DMG mounts
# empty (#32). DMG_APP is exported by scripts/package-release.sh.
app_path = os.environ.get('DMG_APP', '')
if not app_path or not app_path.endswith('.app') or not os.path.isdir(app_path):
sys.stderr.write(
'error: DMG_APP must point at an existing .app bundle '
'(got %r)\n' % app_path)
sys.exit(1)
files = [app_path]
# Finder on Sonoma+ is picky about PNG-with-alpha window pictures and
# about classic Alias Manager blobs. package-release.sh always passes
# a flattened HiDPI TIFF as DMG_BACKGROUND. dmgbuild 1.6.7 (bookmark
# .DS_Store) needs Python >= 3.10, which the Monterey runner does not
# have; 1.6.5 + TIFF is what CI can ship (#95).
background = os.environ.get('DMG_BACKGROUND', '')
if not background or not os.path.isfile(background):
sys.stderr.write(
'error: DMG_BACKGROUND must point at an existing image '
'(got %r)\n' % background)
sys.exit(1)
icon = None
# Window size is enough for the app icon and the Applications alias.
# Bitmap is slightly larger than this rect so title-bar chrome on
# 14+ does not crop the wordmark.
window_rect = ((100, 100), (660, 400))
# Use icon view without extra chrome.
default_view = 'icon-view'
show_status_bar = False
show_tab_view = False
show_toolbar = False
show_pathbar = False
show_sidebar = False
sidebar_width = 180
# Position the .app on the left and the Applications alias on the right.
icon_locations = {
'ICCery.app': (180, 220),
'Applications': (480, 220),
}
# Symlink to /Applications for drag-and-drop install.
symlinks = {'Applications': '/Applications'}