#!/bin/bash # Build Linux desktop packages (deb + rpm) for JellyTau. # # Produces bundles under src-tauri/target/release/bundle/{deb,rpm}. # Runs on the existing Ubuntu builder image. NOTE: Tauri has no pacman bundle # target — the Arch package is built separately with makepkg (scripts/build-arch.sh # / Dockerfile.arch). `appimage` is also available if you want a portable bundle. # # Usage: # scripts/build-desktop-linux.sh # deb + rpm # BUNDLES="deb,appimage" scripts/build-desktop-linux.sh # subset / add appimage # OUTPUT_DIR=/app/dist scripts/build-desktop-linux.sh # copy bundles out set -euo pipefail cd "$(dirname "$0")/.." BUNDLES="${BUNDLES:-deb,rpm}" echo "🐧 Building JellyTau Linux desktop packages" echo "===========================================" echo "Bundles: $BUNDLES" echo "" bun install --frozen-lockfile 2>/dev/null || bun install bun run build # --bundles overrides tauri.conf.json bundle.targets so this script controls # exactly which Linux formats are produced (never NSIS here). # TRACES: | DR-221 # # 🔴 NO_STRIP=true is required for the AppImage bundle. # # linuxdeploy (which Tauri downloads and runs to build the AppImage) carries its # own `strip`, and that copy is too old to parse the `.relr.dyn` section modern # toolchains emit for RELR relocations. It fails on essentially every bundled # library: # # strip: libzstd.so.1: unknown type [0x13] section `.relr.dyn' # failed to bundle project `failed to run linuxdeploy-x86_64.AppImage` # # Ubuntu 23.10+ links with -z pack-relative-relocs by default, so the CI builder # image hits this exactly as a modern Arch host does. Skipping the strip step is # linuxdeploy's own documented escape hatch; the cost is an unstripped, larger # AppImage (~153 MB for a build that bundles libmpv and its ffmpeg stack). # # Remove this only after confirming a linuxdeploy release that understands RELR. NO_STRIP=true bun run tauri build --bundles "$BUNDLES" BUNDLE_ROOT="src-tauri/target/release/bundle" echo "" echo "✅ Built packages:" find "$BUNDLE_ROOT" -maxdepth 2 -type f \ \( -name '*.deb' -o -name '*.rpm' -o -name '*.AppImage' \) -print if [[ -n "${OUTPUT_DIR:-}" ]]; then mkdir -p "$OUTPUT_DIR" find "$BUNDLE_ROOT" -maxdepth 2 -type f \ \( -name '*.deb' -o -name '*.rpm' -o -name '*.AppImage' \) \ -exec cp -v {} "$OUTPUT_DIR/" \; echo "" echo "📦 Copied bundles to $OUTPUT_DIR" fi # Containerised builds run as root against a bind-mounted tree; hand the # artifacts back to the host user. No-op when not root. See DR-213. "$(dirname "$0")/restore-ownership.sh"