Files
netflex/package.sh
Tamas Csikel af4e21ee6f
Some checks failed
release / release (push) Failing after 18m38s
Netflex 0.1.2: new screens, and an ARM build for the Raspberry Pi
- Pages from the web app: search, my list, anime hub and anime details,
  settings; the home and detail screens moved under src/screens on the
  shared page model (src/page.rs, ui/page.slint).
- package.sh --arm cross-compiles support.bluefox.netflex-<version>-aarch64.tar.zst,
  which Fennec OS on ARM installs (docs/store.md). The release CI builds
  both: the GStreamer dev packages of amd64 and arm64 can't be installed
  together, so it swaps them between the two builds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 18:33:29 +01:00

56 lines
2.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Builds the store release assets into dist/:
#
# ./package.sh app.toml and support.bluefox.netflex-<version>.tar.zst
# (x86-64; dist/ is emptied first)
# ./package.sh --arm adds support.bluefox.netflex-<version>-aarch64.tar.zst
# (Raspberry Pi, cross-compiled)
#
# Build on Debian trixie or older (the TV's glibc), with the GStreamer dev
# packages (libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev) and
# sf-pack from the Fennec SDK:
# cargo install --locked --git https://gitea.bluefox.support/fennec/sdk --tag v0.1.0 sf-pack
# --arm needs gcc-aarch64-linux-gnu and the arm64 (multiarch) dev packages
# instead. The GStreamer dev packages of the two architectures can't be
# installed together: swap them between the two runs, as
# .gitea/workflows/release.yml does.
set -euo pipefail
cd "$(dirname "$0")"
target="${CARGO_TARGET_DIR:-target}"
id=$(sed -n 's/^id *= *"\(.*\)".*/\1/p' app.toml | head -1)
version=$(sed -n 's/^version *= *"\(.*\)".*/\1/p' app.toml | head -1)
# pack <binary> <out dir>: the package with this binary.
pack() {
rm -rf pkg
mkdir -p pkg/bin
cp app.toml icon.png pkg/
install -m755 "$1" pkg/bin/netflex-tv
sf-pack build pkg "$2"
sf-pack verify "$2"
rm -rf pkg
}
if [ "${1:-}" != --arm ]; then
cargo build --release --locked
rm -rf dist
pack "$target/release/netflex-tv" dist
else
t=aarch64-unknown-linux-gnu
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++
export PKG_CONFIG_ALLOW_CROSS=1 PKG_CONFIG_SYSROOT_DIR=/
export PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig:/usr/share/pkgconfig
rustup target list --installed | grep -qx "$t" || rustup target add "$t"
cargo build --release --locked --target "$t"
rm -rf dist-arm
pack "$target/$t/release/netflex-tv" dist-arm
# Fennec OS on ARM looks for <id>-<version>-aarch64.tar.zst (docs/store.md).
mkdir -p dist
mv "dist-arm/$id-$version.tar.zst" "dist/$id-$version-aarch64.tar.zst"
[ -f dist/app.toml ] || mv dist-arm/app.toml dist/
rm -rf dist-arm
fi
ls -l dist