voicegrab/installer/build_linux.sh

41 lines
1.4 KiB
Bash

#!/usr/bin/env bash
# VoiceGrab — Linux build (produces dist/VoiceGrab-<arch> binary; AppImage if linuxdeploy available)
set -euo pipefail
cd "$(dirname "$0")/.."
PY="${PYTHON:-.venv/bin/python}"
[ -x "$PY" ] || { echo "Create the venv first: python3 -m venv .venv && .venv/bin/pip install -r requirements.txt"; exit 1; }
command -v ffmpeg >/dev/null || { echo "ffmpeg not found in PATH (needed to resolve the binary)"; exit 1; }
"$PY" -m pip install pyinstaller
FFMPEG_BIN="$(command -v ffmpeg)"
FFPROBE_BIN="$(command -v ffprobe || true)"
EXTRA=()
if [ -n "${FFPROBE_BIN:-}" ]; then
EXTRA+=(--add-binary "$FFPROBE_BIN:.")
fi
"$PY" -m PyInstaller --noconfirm --onefile --windowed --name VoiceGrab \
--add-binary "$FFMPEG_BIN:." \
"${EXTRA[@]}" \
--add-data "assets/icon.png:assets" \
--icon assets/icon.ico \
voicegrab.py
echo
echo "Binary: dist/VoiceGrab"
echo "Test: ./dist/VoiceGrab"
# Optional: wrap in an AppImage
if command -v linuxdeploy >/dev/null 2>&1; then
echo "Building AppImage with linuxdeploy..."
linuxdeploy --appimage --input dist/ --output appimage
elif command -v appimagetool >/dev/null 2>&1; then
echo "linuxdeploy not found; appimagetool present — build a .dir first, then run:"
echo " appimagetool dist/VoiceGrab-Dir VoiceGrab-x86_64.AppImage"
else
echo "Tip: install linuxdeploy (or appimagetool) to produce an AppImage."
fi