#!/bin/sh
set -eu
[ "$(uname -sm)" = "Linux aarch64" ] || { echo 'Linux-arm64-Buildhost erforderlich' >&2; exit 1; }
rustup toolchain install 1.97.1 --profile minimal --component clippy --component rustfmt
# Beide per Digest fixierten Cross-Images enthalten Python, Curl, Git und SDK/Clang.
# Separater fester 7-Zip-Download, kein stiller Ersatz durch ZIP oder tar.
curl --fail --location --silent --show-error https://www.7-zip.org/a/7z2501-linux-arm64.tar.xz -o /tmp/tb-7zip.tar.xz
printf '%s  %s\n' 39c5140f02ce4436599303c59a149f654cb1bbc47cdc105a942120d747ae040d /tmp/tb-7zip.tar.xz | sha256sum -c -
mkdir -p /tmp/tb-7zip
tar -xJf /tmp/tb-7zip.tar.xz -C /tmp/tb-7zip
install /tmp/tb-7zip/7zz /usr/local/bin/7zz
rustc --version
7zz | head -4
