macOS: osxcross packaging path (scripts/package.sh mac → .app .zip)

Add a `mac` target that cross-compiles an Apple binary via osxcross
(MAC_ARCH=arm64 default, or x86_64), assembles an unsigned yt-offline.app
(Info.plist + Mach-O + best-effort .icns via png2icns), and zips it. The
crypto stack is ring, which builds against the osxcross SDK cleanly.

- Sets the per-target linker + cc-rs CC/CXX/AR env from the osxcross
  wrappers (oa64-clang / o64-clang); discovers the versioned ar triple.
- Gated on the toolchain being present: `all` folds it in only when an
  Apple rust target + an osxcross wrapper + zip exist, and a bare `mac`
  run skips cleanly (exit 0) otherwise — verified.
- Local-only, not in CI: the macOS SDK can't be hosted in a public image.
- Refresh the stale Windows + macOS sections of docs/PACKAGING.md (they
  still described the pre-cfg-gating blocked state) and the CI section;
  note a possible future MacPorts port. ROADMAP 3.1 updated.

Untested end-to-end (no osxcross/SDK on this box); the scaffolding + skip
path are verified and `all` on a stock box is unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Luna 2026-06-16 03:09:30 -07:00
parent 207013e957
commit 983864f421
3 changed files with 217 additions and 38 deletions

View file

@ -154,13 +154,19 @@ Linux; `disk_space` (`statvfs`), `plex` (symlinks, with a Windows
`symlink_file` path), the mpv IPC `UnixStream`, and the
`chmod`/`PermissionsExt` guards are all `cfg(unix)`-gated.
**macOS is deferred, not blocked.** The code is Unix and cfg-gated, so it
*should* compile on a Mac unchanged, but it can't be linked from the
Linux host (no osxcross/SDK) and Codeberg has no macOS runners — so a real
tested `.app`/binary needs either a GitHub Actions `macos-latest` runner
(mirror CI there) or a local osxcross setup. Remaining for either OS: a
real per-OS tray backend (e.g. `tray-icon`) if the tray is wanted off
Linux, and on-hardware runtime testing.
**macOS has a packaging path, pending the toolchain.** `scripts/package.sh
mac` cross-compiles an Apple target (`MAC_ARCH=arm64` default, or
`x86_64`) via osxcross, assembles an unsigned `yt-offline.app`
(`Info.plist` + Mach-O + best-effort `.icns`), and zips it. The crypto
stack is `ring`, which builds against the osxcross SDK fine. It's gated on
the operator having osxcross built with a macOS SDK on PATH (the SDK comes
from Xcode and can't be redistributed, so this stays **local-only, not in
CI** — `all` skips it cleanly when the toolchain is absent). Untested
end-to-end here because this box has no osxcross/SDK. Remaining: actually
run it through osxcross + on-hardware testing; codesigning/notarization
and a `.dmg`; and a real macOS tray backend (e.g. `tray-icon` — the tray
is a no-op off Linux today). A GitHub Actions `macos-latest` job is the
alternative that also unlocks signing.
### 3.2 Android client