mirror of
https://github.com/felixfoertsch/EurKEY-macOS.git
synced 2026-04-16 06:28:28 +02:00
- rename v2.0 → EurKEY Next across all files, scripts, workflows, website - rename bundle EurKey-macOS → EurKEY-macOS - add §/± to ¬ dead key (¬+s → §, ¬+S → ±) for ANSI keyboard compatibility - normalize Caps Lock = Shift across all four layouts, remove custom Caps bindings - fix v1.4: revert accidental Caps/ẞ changes, correct changelog to super/subscript swap - update README: remove duplicate v1.2–v1.4 changelog, reorder versions (Next first) - update website: ISO+ANSI feature card, EurKEY Next branding, consistent version order Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
69 lines
1.7 KiB
Bash
Executable File
69 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Create a .dmg installer for EurKEY-macOS keyboard layouts.
|
|
#
|
|
# The DMG contains the keyboard layout bundle, layout PDFs, and a symlink
|
|
# to /Library/Keyboard Layouts/ for drag-and-drop installation.
|
|
#
|
|
# Auto-builds the bundle and PDFs if missing.
|
|
#
|
|
# Usage: bash scripts/build-dmg.sh [--version YYYY.MM.DD]
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
|
BUILD_DIR="${PROJECT_DIR}/build"
|
|
BUNDLE_DIR="${BUILD_DIR}/EurKEY-Next.bundle"
|
|
|
|
# parse arguments
|
|
VERSION="${1:-$(date +%Y.%m.%d)}"
|
|
if [[ "${1:-}" == "--version" ]]; then
|
|
VERSION="${2:?missing version argument}"
|
|
fi
|
|
|
|
DMG_NAME="EurKEY-Next-${VERSION}"
|
|
DMG_PATH="${BUILD_DIR}/${DMG_NAME}.dmg"
|
|
STAGING_DIR="${BUILD_DIR}/dmg-staging"
|
|
|
|
echo "Creating DMG: ${DMG_NAME}"
|
|
|
|
# --- build bundle (includes validation) ---
|
|
bash "${SCRIPT_DIR}/build-bundle.sh" --version "${VERSION}"
|
|
|
|
# --- auto-build PDFs ---
|
|
echo "Building PDFs..."
|
|
bash "${SCRIPT_DIR}/build-pdf.sh" --output "${BUILD_DIR}"
|
|
|
|
# --- prepare staging directory ---
|
|
rm -rf "${STAGING_DIR}"
|
|
mkdir -p "${STAGING_DIR}"
|
|
|
|
# copy the bundle
|
|
cp -R "${BUNDLE_DIR}" "${STAGING_DIR}/"
|
|
|
|
# copy layout PDFs
|
|
cp "${BUILD_DIR}"/eurkey-*layout.pdf "${STAGING_DIR}/"
|
|
|
|
# create symlink to installation target
|
|
ln -s "/Library/Keyboard Layouts" "${STAGING_DIR}/Install Here (Keyboard Layouts)"
|
|
|
|
echo "Staged files:"
|
|
ls -la "${STAGING_DIR}/"
|
|
|
|
# --- create DMG ---
|
|
mkdir -p "${BUILD_DIR}"
|
|
rm -f "${DMG_PATH}"
|
|
|
|
hdiutil create \
|
|
-volname "${DMG_NAME}" \
|
|
-srcfolder "${STAGING_DIR}" \
|
|
-ov \
|
|
-format UDZO \
|
|
"${DMG_PATH}"
|
|
|
|
# --- clean up ---
|
|
rm -rf "${STAGING_DIR}"
|
|
|
|
echo
|
|
echo "DMG created: ${DMG_PATH}"
|
|
echo "Size: $(du -h "${DMG_PATH}" | cut -f1)"
|