Something went wrong. Try again.
Monorepo for wisp.place. A static site hosting service built on top of the AT Protocol.
Something went wrong. Try again.
1.8 kB · 44 lines
Shell
123456789101112131415161718192021222324252627282930313233343536373839404142434445#!/usr/bin/env bash## Build the distributable wispctl binaries into ./binaries from the Rust port# (cli-rs). Binaries keep the legacy `wisp-cli-*` names so existing CI pipelines# that curl them keep working.## Linux builds are fully static (musl) so they run on any distro, nixery and# busybox included; Windows is a self-contained GNU build. Both cross-compile# with cargo-zigbuild. macOS builds link only the system frameworks.## Needs: rustup targets below, zig, cargo-zigbuild, lipo (Xcode tools).# rustup target add x86_64-unknown-linux-musl aarch64-unknown-linux-musl \# x86_64-pc-windows-gnu x86_64-apple-darwin aarch64-apple-darwin# brew install zig && cargo install cargo-zigbuild --lockedset -euo pipefail
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"OUT_DIR="$REPO_ROOT/binaries"TARGET_DIR="$REPO_ROOT/cli-rs/target"
mkdir -p "$OUT_DIR"cd "$REPO_ROOT/cli-rs"
build() { local tool="$1" target="$2" out="$3" exe="${4:-wispctl}" echo "==> $out ($target)" cargo $tool --locked --release -p wispctl --target "$target" cp "$TARGET_DIR/$target/release/$exe" "$OUT_DIR/$out"}
build build aarch64-apple-darwin wisp-cli-aarch64-darwinbuild build x86_64-apple-darwin wisp-cli-x86_64-darwinbuild zigbuild x86_64-unknown-linux-musl wisp-cli-x86_64-linuxbuild zigbuild aarch64-unknown-linux-musl wisp-cli-aarch64-linuxbuild zigbuild x86_64-pc-windows-gnu wisp-cli-x86_64-windows.exe wispctl.exe
# Universal macOS binary for the install docs.echo "==> wisp-cli-darwin-universal (lipo)"lipo -create -output "$OUT_DIR/wisp-cli-darwin-universal" \ "$OUT_DIR/wisp-cli-aarch64-darwin" "$OUT_DIR/wisp-cli-x86_64-darwin"
chmod +x "$OUT_DIR"/wisp-cli-*cd "$OUT_DIR"shasum -a 256 wisp-cli-* | tee SHA256SUMS