Files
VoxVera/packaging/build_appimage.sh
T

63 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
echo "Warning: AppImage packaging is experimental and is not yet validated for reliable background hidden-service hosting."
# Ensure we are in project root
cd "$(dirname "$0")/.."
ARCH=$(uname -m)
BINARY=${1:-"voxvera/resources/bin/voxvera-linux-$ARCH"}
OUTPUT="voxvera/resources/bin/VoxVera-$ARCH.AppImage"
if [ ! -f "$BINARY" ]; then
echo "Binary not found: $BINARY. Building it first..."
bash scripts/build_binaries.sh
fi
if [ ! -f "$BINARY" ]; then
echo "Binary still not found after build: $BINARY." >&2
exit 1
fi
APPDIR=build/AppDir
rm -rf "$APPDIR"
mkdir -p "$APPDIR/usr/bin"
cp "$BINARY" "$APPDIR/usr/bin/voxvera"
chmod +x "$APPDIR/usr/bin/voxvera"
# AppRun symlink (Crucial for AppImage to launch)
ln -sf usr/bin/voxvera "$APPDIR/AppRun"
chmod +x "$APPDIR/AppRun"
# Desktop file
cat > "$APPDIR/voxvera.desktop" <<EOD
[Desktop Entry]
Type=Application
Name=VoxVera
Exec=voxvera
Icon=voxvera
Categories=Utility;
Terminal=true
EOD
# Use a generic icon since we don't have one
# (AppImageTool requires an icon file to exist)
# We will copy a qrcode as a placeholder if nothing else exists
cp site/qrcode-content.png "$APPDIR/voxvera.png"
# Download appimagetool
echo "Downloading appimagetool..."
wget -q https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage -O appimagetool
chmod +x appimagetool
# Run appimagetool
echo "Running appimagetool..."
export ARCH
mkdir -p voxvera/resources/bin
rm -f "$OUTPUT"
./appimagetool --appimage-extract-and-run "$APPDIR" "$OUTPUT"
rm appimagetool
echo "AppImage created at $OUTPUT"