macOS build: universal app for Apple Silicon and Intel, macOS 11+
- scripts/build-wx-macos.sh: static, monolithic, universal (arm64 + x86_64) wxOSX/Cocoa 3.3.3 from the vendored tree, with wx's bundled image/zlib/regex/expat so the app links only system frameworks. Minimum macOS 11.0: current SDKs' libc++ supports nothing older. - scripts/build-gui-macos.sh: builds both Rust targets against that prefix and merges them with lipo. - ci/package-macos.py: "Alkane Toolkit.app" (Info.plist, icon, local network usage string), ad-hoc signed, zipped with ditto as alkane-toolkit-vX.Y.Z-macos-universal.zip with LICENSE and README. - crates/alkane-gui/macos: app icon (.icns) from the same glyph as the Windows icon, plus the script that makes it. - wx-rs patch 0009: macOS goes through wx-config (drops the universal -arch flags, maps -framework), reports logical sizes like GTK/MSW instead of narrowing floats to ints, and links clang's compiler runtime for wxOSX's @available checks. - docs/macos.md, README and the manual's install chapter. Verified on an M1 running macOS 27.0.1: both slices build, all workspace unit tests pass, and the headless UI self-test passes 52/52 on arm64. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,9 +1,28 @@
|
||||
#!/bin/sh
|
||||
# Build the alkane-toolkit GUI on macOS.
|
||||
# wx-rs upstream supports macOS: its build.rs clones/builds wx 3.2.2.1 into
|
||||
# ./dist (osx-release-build) on first build. Requires Xcode Command Line
|
||||
# Tools. Run this ON a Mac - macOS cannot be linked from Linux.
|
||||
# Build the alkane-toolkit GUI on macOS as one universal binary.
|
||||
#
|
||||
# scripts/build-gui-macos.sh [extra cargo build args]
|
||||
# -> target/universal-apple-darwin/release/alkane-toolkit (arm64 + x86_64)
|
||||
#
|
||||
# Needs the Xcode Command Line Tools, rustup with the aarch64-apple-darwin and
|
||||
# x86_64-apple-darwin targets, and the universal static wx prefix from
|
||||
# scripts/build-wx-macos.sh (WX_MACOS_PREFIX, default ~/.cache/wx-3.3.3-macos).
|
||||
# Each target is built separately against that prefix, then the two slices
|
||||
# are merged with lipo. MACOSX_DEPLOYMENT_TARGET matches the wx build.
|
||||
set -e
|
||||
cd "$(dirname -- "$0")/.."
|
||||
cargo build --release -p alkane-gui
|
||||
echo "binary: target/release/alkane-toolkit (app bundle packaging is follow-up)"
|
||||
PREFIX="${WX_MACOS_PREFIX:-$HOME/.cache/wx-3.3.3-macos}"
|
||||
[ -x "$PREFIX/bin/wx-config" ] || {
|
||||
echo "no wx prefix at $PREFIX; run scripts/build-wx-macos.sh first" >&2; exit 1; }
|
||||
export WX_RS_WXCONFIG="$PREFIX/bin/wx-config"
|
||||
export MACOSX_DEPLOYMENT_TARGET="${MACOSX_MIN:-11.0}"
|
||||
for target in aarch64-apple-darwin x86_64-apple-darwin; do
|
||||
cargo build --release --offline --locked -p alkane-gui --target "$target" "$@"
|
||||
done
|
||||
out=target/universal-apple-darwin/release
|
||||
mkdir -p "$out"
|
||||
lipo -create -output "$out/alkane-toolkit" \
|
||||
target/aarch64-apple-darwin/release/alkane-toolkit \
|
||||
target/x86_64-apple-darwin/release/alkane-toolkit
|
||||
lipo -info "$out/alkane-toolkit"
|
||||
echo "binary: $out/alkane-toolkit"
|
||||
|
||||
Reference in New Issue
Block a user