mirror of
https://git.citron-emu.org/citron/emulator
synced 2026-02-01 15:23:32 +00:00
57 lines
1.5 KiB
Bash
57 lines
1.5 KiB
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
# Build AppImage script for Citron
|
|
# Usage: ./build_appimage.sh <build_directory> <output_name> [architecture]
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
|
|
|
|
BUILD_DIR="$1"
|
|
OUTPUT_NAME="$2"
|
|
ARCH="${3:-$(uname -m)}"
|
|
|
|
if [ -z "$BUILD_DIR" ] || [ -z "$OUTPUT_NAME" ]; then
|
|
echo "Usage: $0 <build_directory> <output_name> [architecture]"
|
|
echo "Example: $0 ../build Citron-0.7.0-canary+abc1234 x86_64"
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -d "$BUILD_DIR/bin" ]; then
|
|
echo "Error: Build directory '$BUILD_DIR/bin' not found!"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Building AppImage..."
|
|
echo "Build directory: $BUILD_DIR"
|
|
echo "Output name: $OUTPUT_NAME"
|
|
echo "Architecture: $ARCH"
|
|
|
|
# Change to AppImageBuilder directory
|
|
cd "$PROJECT_ROOT/AppImageBuilder"
|
|
|
|
# Run the build script
|
|
./build.sh "$BUILD_DIR" "$OUTPUT_NAME"
|
|
|
|
# Check if AppImage was created
|
|
if [ -f "$OUTPUT_NAME" ]; then
|
|
echo "✅ AppImage created successfully: $OUTPUT_NAME"
|
|
|
|
# Show file info
|
|
ls -lh "$OUTPUT_NAME"
|
|
|
|
# Create checksum
|
|
sha256sum "$OUTPUT_NAME" > "${OUTPUT_NAME}.sha256"
|
|
echo "📋 Checksum: $(cat "${OUTPUT_NAME}.sha256")"
|
|
|
|
# Move to packages directory if it exists
|
|
if [ -d "$PROJECT_ROOT/packages" ]; then
|
|
mv "$OUTPUT_NAME" "$PROJECT_ROOT/packages/"
|
|
mv "${OUTPUT_NAME}.sha256" "$PROJECT_ROOT/packages/"
|
|
echo "📦 Moved to packages directory"
|
|
fi
|
|
else
|
|
echo "❌ Failed to create AppImage"
|
|
exit 1
|
|
fi
|