Something went wrong. Try again.
🔭 A minimal and fast FITS/XISF viewer for astro images for Windows, MacOS, and Linux blip.sascha.sh
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839#!/usr/bin/env bash# Builds the macOS app bundle and disk image (blip-<version>-macos-universal.dmg) into dist/ as a universal binary# (Apple Silicon + Intel):## ./scripts/package-macos.sh## Needs Rust and the Xcode command line tools (for lipo). cargo-packager and# cargo-about are installed on first use.
set -euo pipefailcd "$(dirname "$0")/.."
if ! command -v cargo-packager >/dev/null; then cargo install cargo-packager --version 0.11.8 --lockedfiif ! command -v cargo-about >/dev/null; then cargo install cargo-about --version 0.9.2 --locked --features clifi
targets=(aarch64-apple-darwin x86_64-apple-darwin)rustup target add "${targets[@]}"for target in "${targets[@]}"; do cargo build --release --target "$target"done
universal=target/universal-apple-darwin/releasemkdir -p "$universal"lipo -create -output "$universal/blip" \ "target/aarch64-apple-darwin/release/blip" \ "target/x86_64-apple-darwin/release/blip"
cargo about generate about.hbs -o target/THIRD_PARTY_LICENSES.txt
cargo packager --release --target universal-apple-darwin --formats app,dmg
version=$(cargo pkgid | sed 's/.*[@#]//')# cargo-packager names the disk image blip_<version>_<arch>.dmg.mv -f "dist/blip_${version}_universal.dmg" "dist/blip-${version}-macos-universal.dmg"