From 7423c88e9aa285c283db4a1ae1fd7419ed7db9ba Mon Sep 17 00:00:00 2001
From: Philipp Bischoff
Date: Tue, 27 Oct 2026 10:31:16 +0100
Subject: [PATCH] feat(mac): bundle ffmpeg and ship a drag-to-Applications DMG
---
.github/workflows/ci.yml | 15 +-
AGENTS.md | 7 +-
CHANGELOG.md | 8 +
.../Resources/AppIcon.icon/Assets/lume-bw.svg | 17 ++
.../AppIcon.icon/Assets/record-dot.svg | 5 +
MacApp/Resources/AppIcon.icon/icon.json | 161 ++++++++++++++++++
MacApp/Resources/Info.plist | 4 +
MacApp/Resources/dmg-settings.py | 29 ++++
.../Sources/LumeRecorderApp/MenuContent.swift | 2 +-
MacApp/scripts/build-app.sh | 89 +++++++---
MacApp/scripts/build-ffmpeg.sh | 88 ++++++++++
README.md | 25 +--
12 files changed, 408 insertions(+), 42 deletions(-)
create mode 100644 MacApp/Resources/AppIcon.icon/Assets/lume-bw.svg
create mode 100644 MacApp/Resources/AppIcon.icon/Assets/record-dot.svg
create mode 100644 MacApp/Resources/AppIcon.icon/icon.json
create mode 100644 MacApp/Resources/dmg-settings.py
create mode 100755 MacApp/scripts/build-ffmpeg.sh
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index bec8ea0..56dc933 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -41,7 +41,7 @@ jobs:
done
# Pushes are signed with the Developer ID certificate when the secrets exist;
- # release tags are also notarized and attached to the GitHub release (and
+ # release tags are also notarized and their DMG attached to the GitHub release (and
# fail without the secrets). PRs build ad-hoc signed.
mac-app:
name: macOS app
@@ -86,7 +86,14 @@ jobs:
run: |
echo "$KEY_BASE64" | base64 --decode > "$RUNNER_TEMP/notary.p8"
echo "NOTARY_KEY_PATH=$RUNNER_TEMP/notary.p8" >> "$GITHUB_ENV"
- - name: Build LumeRecorder.app (universal)
+ # ffmpeg takes the longest; it only changes with build-ffmpeg.sh.
+ - uses: actions/cache@v4
+ with:
+ path: |
+ MacApp/.build/ffmpeg-*/ffmpeg
+ MacApp/.build/ffmpeg-*/*.txt
+ key: ffmpeg-${{ runner.os }}-${{ hashFiles('MacApp/scripts/build-ffmpeg.sh') }}
+ - name: Build LumeRecorder.app + DMG (universal)
env:
NOTARY_KEY_ID: ${{ secrets.NOTARY_KEY_ID }}
NOTARY_ISSUER_ID: ${{ secrets.NOTARY_ISSUER_ID }}
@@ -94,7 +101,7 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: LumeRecorder-macOS
- path: MacApp/dist/*.zip
+ path: MacApp/dist/*.dmg
if-no-files-found: error
- name: Attach to GitHub release
if: env.IS_RELEASE == 'true'
@@ -103,7 +110,7 @@ jobs:
run: |
gh release view "$GITHUB_REF_NAME" > /dev/null 2>&1 \
|| gh release create "$GITHUB_REF_NAME" --title "$GITHUB_REF_NAME" --generate-notes --verify-tag
- gh release upload "$GITHUB_REF_NAME" MacApp/dist/*.zip --clobber
+ gh release upload "$GITHUB_REF_NAME" MacApp/dist/*.dmg --clobber
- name: Remove signing material
if: always()
run: |
diff --git a/AGENTS.md b/AGENTS.md
index ac0eeaa..02368c3 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -24,8 +24,11 @@ Sources/lume-recorder/ CLI: serve (default) | pair | server-id
MacApp/ LumeRecorder.app: separate package, SwiftUI MenuBarExtra
Sources/LumeRecorderApp/ ServerController (ServiceGroup, polling, sleep assertion,
SMAppService), menu UI, file log handler
- scripts/build-app.sh universal build → .app bundle (+ optional ffmpeg, signing,
- notarization) → MacApp/dist/
+ Resources/ Info.plist, AppIcon.icon (Lume's icon + record badge),
+ dmg-settings.py (dmgbuild layout)
+ scripts/build-ffmpeg.sh pinned LGPL ffmpeg, universal, system libraries only
+ scripts/build-app.sh universal build → .app (bundled ffmpeg, icon, signing,
+ notarization) → drag-to-Applications DMG in MacApp/dist/
Tests/RecorderCoreTests/ Swift Testing: store, scheduler (fake launcher), recovery,
pairing, signing, routes (HummingbirdTesting), real ffmpeg
docker/entrypoint.sh avahi service file + avahi-daemon, then drop to `lume`
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8ec1e2f..de66d0c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,14 @@ All notable changes to this project are documented here. The format follows
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
[Semantic Versioning](https://semver.org/).
+## [Unreleased]
+
+### Changed
+- The Mac app ships as a drag-to-Applications DMG instead of a zip, with its
+ own icon. It bundles ffmpeg 9.0.2 (LGPL, built from the official source by
+ `MacApp/scripts/build-ffmpeg.sh`, system libraries only), so users install
+ nothing else.
+
## [0.3.0] - 2026-10-27
### Added
diff --git a/MacApp/Resources/AppIcon.icon/Assets/lume-bw.svg b/MacApp/Resources/AppIcon.icon/Assets/lume-bw.svg
new file mode 100644
index 0000000..b267a85
--- /dev/null
+++ b/MacApp/Resources/AppIcon.icon/Assets/lume-bw.svg
@@ -0,0 +1,17 @@
+
+
+
diff --git a/MacApp/Resources/AppIcon.icon/Assets/record-dot.svg b/MacApp/Resources/AppIcon.icon/Assets/record-dot.svg
new file mode 100644
index 0000000..58b7eb7
--- /dev/null
+++ b/MacApp/Resources/AppIcon.icon/Assets/record-dot.svg
@@ -0,0 +1,5 @@
+
+
diff --git a/MacApp/Resources/AppIcon.icon/icon.json b/MacApp/Resources/AppIcon.icon/icon.json
new file mode 100644
index 0000000..685d26a
--- /dev/null
+++ b/MacApp/Resources/AppIcon.icon/icon.json
@@ -0,0 +1,161 @@
+{
+ "fill": {
+ "automatic-gradient": "display-p3:0.95393,1.00000,0.95327,1.00000"
+ },
+ "groups": [
+ {
+ "layers": [
+ {
+ "blend-mode": "normal",
+ "glass": false,
+ "hidden": false,
+ "image-name": "record-dot.svg",
+ "name": "record-dot",
+ "position": {
+ "scale": 2.4,
+ "translation-in-points": [
+ 250,
+ 250
+ ]
+ }
+ }
+ ],
+ "lighting": "combined",
+ "shadow": {
+ "kind": "neutral",
+ "opacity": 0.5
+ },
+ "specular": true,
+ "translucency": {
+ "enabled": false,
+ "value": 0.5
+ }
+ },
+ {
+ "layers": [
+ {
+ "blend-mode": "normal",
+ "fill-specializations": [
+ {
+ "value": {
+ "linear-gradient": [
+ "display-p3:1.00000,0.54437,0.84501,1.00000",
+ "display-p3:0.43938,0.00000,0.70496,1.00000"
+ ],
+ "orientation": {
+ "start": {
+ "x": 0.5,
+ "y": 0.27784247008866125
+ },
+ "stop": {
+ "x": 0.189814101472092,
+ "y": 0.8720039438726773
+ }
+ }
+ }
+ },
+ {
+ "appearance": "dark",
+ "value": {
+ "linear-gradient": [
+ "display-p3:1.00000,0.54510,0.84314,1.00000",
+ "display-p3:0.43922,0.00000,0.70588,1.00000"
+ ],
+ "orientation": {
+ "start": {
+ "x": 0.5,
+ "y": 0.27784247008866125
+ },
+ "stop": {
+ "x": 0.189814101472092,
+ "y": 0.8720039438726773
+ }
+ }
+ }
+ }
+ ],
+ "glass": false,
+ "hidden": false,
+ "image-name": "lume-bw.svg",
+ "name": "lume-bw",
+ "position": {
+ "scale": 2,
+ "translation-in-points": [
+ 0,
+ 0
+ ]
+ }
+ },
+ {
+ "blend-mode": "normal",
+ "fill-specializations": [
+ {
+ "value": {
+ "linear-gradient": [
+ "display-p3:0.31994,0.54437,0.84501,1.00000",
+ "display-p3:0.96783,0.93485,0.00000,1.00000"
+ ],
+ "orientation": {
+ "start": {
+ "x": 0.5,
+ "y": 0.27784247008866125
+ },
+ "stop": {
+ "x": 0.189814101472092,
+ "y": 0.8720039438726773
+ }
+ }
+ }
+ },
+ {
+ "appearance": "dark",
+ "value": {
+ "linear-gradient": [
+ "display-p3:1.00000,0.54437,0.84501,1.00000",
+ "display-p3:0.43938,0.00000,0.70496,1.00000"
+ ],
+ "orientation": {
+ "start": {
+ "x": 0.5,
+ "y": 0.27784247008866125
+ },
+ "stop": {
+ "x": 0.189814101472092,
+ "y": 0.8720039438726773
+ }
+ }
+ }
+ }
+ ],
+ "glass": false,
+ "hidden": true,
+ "image-name": "lume-bw.svg",
+ "name": "lume-bw",
+ "position": {
+ "scale": 2,
+ "translation-in-points": [
+ 0,
+ 0
+ ]
+ }
+ }
+ ],
+ "lighting": "individual",
+ "shadow": {
+ "kind": "neutral",
+ "opacity": 0.5
+ },
+ "specular": true,
+ "translucency": {
+ "enabled": true,
+ "value": 0.5
+ }
+ }
+ ],
+ "supported-platforms": {
+ "circles": [
+ "watchOS"
+ ],
+ "squares": "shared"
+ }
+}
\ No newline at end of file
diff --git a/MacApp/Resources/Info.plist b/MacApp/Resources/Info.plist
index 33fbf9a..f63b71d 100644
--- a/MacApp/Resources/Info.plist
+++ b/MacApp/Resources/Info.plist
@@ -8,6 +8,10 @@
LumeRecorder
CFBundleExecutable
LumeRecorder
+ CFBundleIconFile
+ AppIcon
+ CFBundleIconName
+ AppIcon
CFBundleIdentifier
__BUNDLE_ID__
CFBundleInfoDictionaryVersion
diff --git a/MacApp/Resources/dmg-settings.py b/MacApp/Resources/dmg-settings.py
new file mode 100644
index 0000000..dc62fc4
--- /dev/null
+++ b/MacApp/Resources/dmg-settings.py
@@ -0,0 +1,29 @@
+# dmgbuild settings for LumeRecorder-.dmg: the app next to an
+# Applications link, with an arrow between them.
+# Used by scripts/build-app.sh: dmgbuild -s dmg-settings.py -D app=… -D icon=…
+import os.path
+
+app = defines["app"] # noqa: F821 (provided by dmgbuild)
+app_name = os.path.basename(app)
+
+format = "ULFO"
+filesystem = "APFS"
+files = [app]
+symlinks = {"Applications": "/Applications"}
+icon = defines["icon"] # noqa: F821
+
+background = "builtin-arrow"
+window_rect = ((200, 200), (640, 360))
+default_view = "icon-view"
+show_status_bar = False
+show_tab_view = False
+show_toolbar = False
+show_pathbar = False
+show_sidebar = False
+icon_size = 128
+text_size = 13
+hide_extensions = [app_name]
+icon_locations = {
+ app_name: (160, 140),
+ "Applications": (480, 140),
+}
diff --git a/MacApp/Sources/LumeRecorderApp/MenuContent.swift b/MacApp/Sources/LumeRecorderApp/MenuContent.swift
index 185cf8e..01d50a5 100644
--- a/MacApp/Sources/LumeRecorderApp/MenuContent.swift
+++ b/MacApp/Sources/LumeRecorderApp/MenuContent.swift
@@ -100,7 +100,7 @@ struct MenuContent: View {
VStack(alignment: .leading, spacing: 4) {
Label("ffmpeg not found", systemImage: "exclamationmark.triangle.fill")
.foregroundStyle(.orange)
- Text("Recordings fail until ffmpeg is installed. Install it with Homebrew (`brew install ffmpeg`), then restart the recorder.")
+ Text("LumeRecorder can't find the ffmpeg it ships with, so recordings fail. Download LumeRecorder again and replace the app.")
.font(.caption).foregroundStyle(.secondary)
.fixedSize(horizontal: false, vertical: true)
}
diff --git a/MacApp/scripts/build-app.sh b/MacApp/scripts/build-app.sh
index 550c29f..1da65c7 100755
--- a/MacApp/scripts/build-app.sh
+++ b/MacApp/scripts/build-app.sh
@@ -1,13 +1,14 @@
#!/usr/bin/env bash
-# Builds LumeRecorder.app (universal) and a zip next to it in MacApp/dist/.
+# Builds LumeRecorder.app (universal, bundled ffmpeg) and a drag-to-Applications
+# LumeRecorder-.dmg in MacApp/dist/.
#
-# FFMPEG_BINARY=/path/to/static/ffmpeg bundle this ffmpeg (Contents/MacOS/ffmpeg);
-# without it the app falls back to Homebrew's
+# FFMPEG_BINARY=/path/to/ffmpeg bundle this ffmpeg instead of building
+# one with scripts/build-ffmpeg.sh
# SIGN_IDENTITY="Developer ID Application: …" sign with hardened runtime
# (default: ad-hoc, runs only on this Mac
# unless the user clears quarantine)
-# NOTARY_PROFILE=name notarize + staple (xcrun notarytool
-# store-credentials name …); needs SIGN_IDENTITY
+# NOTARY_PROFILE=name notarize + staple app and DMG (xcrun
+# notarytool store-credentials name …)
# NOTARY_KEY_PATH=AuthKey.p8 NOTARY_KEY_ID=… NOTARY_ISSUER_ID=…
# notarize with an App Store Connect API key
# instead of a profile (CI)
@@ -21,8 +22,10 @@ dist="$root/dist"
app="$dist/LumeRecorder.app"
bundle_id="${BUNDLE_ID:-com.bilipp.lumerecorder}"
archs="${ARCHS:-arm64 x86_64}"
+export ARCHS="$archs"
version="$(sed -n 's/.*static let current = "\(.*\)".*/\1/p' ../Sources/RecorderCore/RecorderConfig.swift)"
build_number="$(git rev-list --count HEAD 2>/dev/null || echo 1)"
+dmg="$dist/LumeRecorder-$version.dmg"
arch_flags=()
for arch in $archs; do arch_flags+=(--arch "$arch"); done
@@ -31,53 +34,89 @@ echo "==> Building LumeRecorder $version ($build_number) for $archs"
swift build -c release --product LumeRecorderApp "${arch_flags[@]}"
bin_dir="$(swift build -c release --product LumeRecorderApp "${arch_flags[@]}" --show-bin-path)"
+if [[ -n "${FFMPEG_BINARY:-}" ]]; then
+ ffmpeg_binary="$FFMPEG_BINARY"
+ ffmpeg_notes=""
+else
+ scripts/build-ffmpeg.sh
+ ffmpeg_dir="$(ls -d "$root"/.build/ffmpeg-* | grep -v '\.tar' | sort -V | tail -1)"
+ ffmpeg_binary="$ffmpeg_dir/ffmpeg"
+ ffmpeg_notes="$ffmpeg_dir"
+fi
+if otool -L "$ffmpeg_binary" | grep -E '^\s' | grep -qvE '^\s+(/usr/lib/|/System/)'; then
+ echo "error: $ffmpeg_binary links libraries outside the OS (a Homebrew build?); use a static build" >&2
+ exit 1
+fi
+
echo "==> Assembling $app"
rm -rf "$app"
mkdir -p "$app/Contents/MacOS" "$app/Contents/Resources"
cp "$bin_dir/LumeRecorderApp" "$app/Contents/MacOS/LumeRecorder"
+cp "$ffmpeg_binary" "$app/Contents/MacOS/ffmpeg"
+chmod 755 "$app/Contents/MacOS/ffmpeg"
+if [[ -n "$ffmpeg_notes" ]]; then
+ mkdir -p "$app/Contents/Resources/FFmpeg"
+ cp "$ffmpeg_notes/LICENSE.txt" "$ffmpeg_notes/README.txt" "$app/Contents/Resources/FFmpeg/"
+fi
sed -e "s/__BUNDLE_ID__/$bundle_id/" -e "s/__VERSION__/$version/" -e "s/__BUILD__/$build_number/" \
Resources/Info.plist > "$app/Contents/Info.plist"
+# Icon Composer icon → Assets.car (macOS 26) + AppIcon.icns (older macOS).
+xcrun actool Resources/AppIcon.icon --compile "$app/Contents/Resources" \
+ --platform macosx --minimum-deployment-target 15.0 --app-icon AppIcon \
+ --output-partial-info-plist "$root/.build/AppIcon-partial.plist" > /dev/null
# Dependency resource bundles (privacy manifests).
find "$bin_dir" -maxdepth 1 -name '*.bundle' -exec cp -R {} "$app/Contents/Resources/" \;
-if [[ -n "${FFMPEG_BINARY:-}" ]]; then
- echo "==> Bundling ffmpeg from $FFMPEG_BINARY"
- if otool -L "$FFMPEG_BINARY" | tail -n +2 | grep -qvE '^\s+(/usr/lib/|/System/)'; then
- echo "error: $FFMPEG_BINARY links libraries outside the OS (a Homebrew build?); use a static build" >&2
- exit 1
- fi
- cp "$FFMPEG_BINARY" "$app/Contents/MacOS/ffmpeg"
- chmod 755 "$app/Contents/MacOS/ffmpeg"
-fi
-
identity="${SIGN_IDENTITY:--}"
sign_flags=(--force --timestamp=none --sign "$identity")
if [[ "$identity" != "-" ]]; then sign_flags=(--force --timestamp --options runtime --sign "$identity"); fi
echo "==> Signing (${identity})"
-if [[ -f "$app/Contents/MacOS/ffmpeg" ]]; then codesign "${sign_flags[@]}" "$app/Contents/MacOS/ffmpeg"; fi
+codesign "${sign_flags[@]}" "$app/Contents/MacOS/ffmpeg"
find "$app/Contents/Resources" -maxdepth 1 -name '*.bundle' -exec codesign "${sign_flags[@]}" {} \;
codesign "${sign_flags[@]}" "$app"
codesign --verify --strict --deep "$app"
-zip="$dist/LumeRecorder-$version.zip"
-rm -f "$zip"
-ditto -c -k --keepParent "$app" "$zip"
-
notary_auth=()
if [[ -n "${NOTARY_PROFILE:-}" ]]; then
notary_auth=(--keychain-profile "$NOTARY_PROFILE")
elif [[ -n "${NOTARY_KEY_PATH:-}" ]]; then
notary_auth=(--key "$NOTARY_KEY_PATH" --key-id "$NOTARY_KEY_ID" --issuer "$NOTARY_ISSUER_ID")
fi
+notarize() {
+ xcrun notarytool submit "$1" "${notary_auth[@]}" --wait --timeout 30m
+}
if [[ ${#notary_auth[@]} -gt 0 ]]; then
[[ "$identity" != "-" ]] || { echo "error: notarization needs SIGN_IDENTITY" >&2; exit 1; }
- echo "==> Notarizing"
- xcrun notarytool submit "$zip" "${notary_auth[@]}" --wait --timeout 30m
- xcrun stapler staple "$app"
- spctl --assess --type execute --verbose=2 "$app"
+ # Staple the app itself too, so a copy dragged out of the DMG opens offline.
+ echo "==> Notarizing the app"
+ zip="$root/.build/LumeRecorder-notarize.zip"
rm -f "$zip"
ditto -c -k --keepParent "$app" "$zip"
+ notarize "$zip"
+ rm -f "$zip"
+ xcrun stapler staple "$app"
+ spctl --assess --type execute --verbose=2 "$app"
+fi
+
+echo "==> Creating $dmg"
+venv="$root/.build/dmgbuild-venv"
+if [[ ! -x "$venv/bin/dmgbuild" ]]; then
+ python3 -m venv "$venv"
+ "$venv/bin/pip" install --quiet --disable-pip-version-check "dmgbuild==1.6.7"
+fi
+rm -f "$dmg"
+"$venv/bin/dmgbuild" -s Resources/dmg-settings.py -D app="$app" \
+ -D icon="$app/Contents/Resources/AppIcon.icns" "LumeRecorder" "$dmg"
+
+if [[ "$identity" != "-" ]]; then
+ codesign --force --timestamp --sign "$identity" "$dmg"
+fi
+if [[ ${#notary_auth[@]} -gt 0 ]]; then
+ echo "==> Notarizing the DMG"
+ notarize "$dmg"
+ xcrun stapler staple "$dmg"
+ spctl --assess --type open --context context:primary-signature --verbose=2 "$dmg"
fi
echo "==> Done: $app"
-echo " $zip"
+echo " $dmg"
diff --git a/MacApp/scripts/build-ffmpeg.sh b/MacApp/scripts/build-ffmpeg.sh
new file mode 100755
index 0000000..50e2d30
--- /dev/null
+++ b/MacApp/scripts/build-ffmpeg.sh
@@ -0,0 +1,88 @@
+#!/usr/bin/env bash
+# Builds the ffmpeg bundled into LumeRecorder.app: universal, LGPL, no external
+# libraries (TLS via SecureTransport, zlib from the OS), so the binary links
+# only system libraries and runs on any Mac with macOS 15+.
+#
+# The recorder only stream-copies (HTTP/HLS in, HLS/MPEG-TS out), so encoders
+# and devices are left out. Output: MacApp/.build/ffmpeg-/ffmpeg plus
+# the license and build notes copied into the app bundle.
+#
+# ARCHS="arm64 x86_64" architectures to build
+set -euo pipefail
+
+version="9.0.2"
+sha256="8c3850283eb25fa026482078a04051e0be17347b09ef81a0849bec15a96e002e"
+min_macos="15.0"
+
+cd "$(dirname "$0")/.."
+work="$(pwd)/.build/ffmpeg-$version"
+archs="${ARCHS:-arm64 x86_64}"
+
+if [[ -x "$work/ffmpeg" && "$(lipo -archs "$work/ffmpeg" | tr ' ' '\n' | sort | xargs)" == "$(echo "$archs" | tr ' ' '\n' | sort | xargs)" ]]; then
+ echo "==> ffmpeg $version already built: $work/ffmpeg"
+ exit 0
+fi
+
+mkdir -p "$work"
+tarball="$work/ffmpeg-$version.tar.xz"
+if [[ ! -f "$tarball" ]]; then
+ echo "==> Downloading ffmpeg $version"
+ curl -fsSL "https://ffmpeg.org/releases/ffmpeg-$version.tar.xz" -o "$tarball.part"
+ mv "$tarball.part" "$tarball"
+fi
+echo "$sha256 $tarball" | shasum -a 256 -c -
+
+configure_flags=(
+ --disable-gpl --disable-nonfree
+ --disable-autodetect --enable-securetransport --enable-zlib
+ --disable-shared --enable-static
+ --disable-programs --enable-ffmpeg
+ --disable-doc --disable-debug --disable-avdevice --disable-encoders --disable-x86asm
+)
+
+slices=()
+for arch in $archs; do
+ echo "==> Building ffmpeg $version for $arch"
+ src="$work/src-$arch"
+ rm -rf "$src"
+ mkdir -p "$src"
+ tar -xf "$tarball" -C "$src" --strip-components 1
+ cross=()
+ [[ "$arch" == "$(uname -m)" ]] || cross=(--enable-cross-compile --target-os=darwin)
+ (
+ cd "$src"
+ ./configure "${configure_flags[@]}" ${cross[@]+"${cross[@]}"} --arch="$arch" \
+ --cc="clang -arch $arch" \
+ --extra-cflags="-mmacosx-version-min=$min_macos" \
+ --extra-ldflags="-mmacosx-version-min=$min_macos" > "$work/configure-$arch.log"
+ make -j"$(sysctl -n hw.ncpu)" ffmpeg > "$work/make-$arch.log" 2>&1
+ )
+ slices+=("$src/ffmpeg")
+done
+
+lipo -create "${slices[@]}" -output "$work/ffmpeg"
+strip -x "$work/ffmpeg"
+
+# What ships next to the binary (LGPL: license, version, how it was built, where the source is).
+first_src="$work/src-${archs%% *}"
+cp "$first_src/COPYING.LGPLv2.1" "$work/LICENSE.txt"
+cat > "$work/README.txt" < Done: $work/ffmpeg"
diff --git a/README.md b/README.md
index b1af689..467bbaa 100644
--- a/README.md
+++ b/README.md
@@ -21,13 +21,13 @@ links.
On a Mac you can run LumeRecorder as a menu-bar app instead of a container:
-1. Unzip `LumeRecorder-.zip` and move `LumeRecorder.app` to
- Applications. Build it yourself with `MacApp/scripts/build-app.sh`.
-2. Install ffmpeg if the build doesn't bundle it: `brew install ffmpeg`.
-3. Open the app. A record icon appears in the menu bar. Click it to see the
+1. Download `LumeRecorder-.dmg` from the
+ [latest release](https://github.com/bilipp/LumeRecorder/releases/latest),
+ open it, and drag LumeRecorder into Applications.
+2. Open the app. A record icon appears in the menu bar. Click it to see the
pairing code, recording status and paired devices.
-The app registers itself to open at login (toggle it in the menu), keeps the
+ffmpeg is built in, so there's nothing else to install. The app registers itself to open at login (toggle it in the menu), keeps the
Mac from idle-sleeping while recordings are running or scheduled, and stops
ffmpeg cleanly when you quit. Data lives in
`~/Library/Application Support/LumeRecorder`, the log in
@@ -249,18 +249,23 @@ headers.
swift build && swift test # server (Swift Testing + HummingbirdTesting)
(cd Kit && swift test) # client kit
(cd MacApp && swift build) # macOS menu-bar app
-MacApp/scripts/build-app.sh # LumeRecorder.app + zip in MacApp/dist/
+MacApp/scripts/build-app.sh # LumeRecorder.app + DMG in MacApp/dist/
```
-`build-app.sh` signs ad-hoc by default. Set `SIGN_IDENTITY` (Developer ID) and
-`NOTARY_PROFILE` for a build that opens on other Macs without a Gatekeeper
-warning, and `FFMPEG_BINARY` to bundle a static ffmpeg.
+`build-app.sh` bundles an LGPL ffmpeg built from the official source release
+by `MacApp/scripts/build-ffmpeg.sh` (no external libraries, about 4 minutes on
+first build, cached in `MacApp/.build/`). Set `FFMPEG_BINARY` to bundle another
+static build. It signs ad-hoc by default. Set `SIGN_IDENTITY` (Developer ID)
+and `NOTARY_PROFILE` for a build that opens on other Macs without a Gatekeeper
+warning. The DMG layout comes from `MacApp/Resources/dmg-settings.py`
+([dmgbuild](https://dmgbuild.readthedocs.io), installed into a venv on first
+use).
### Signed Mac builds in CI
The `macOS app` job signs every push to `main` with a Developer ID
certificate. On a `v*` tag it also notarizes the app and attaches
-`LumeRecorder-.zip` to the GitHub release. A release tag fails
+`LumeRecorder-.dmg` to the GitHub release. A release tag fails
without these repository secrets, and PRs build ad-hoc signed:
| Secret | Value |