feat(packaging): add AppImage build script, AppDir metadata, and systemd service unit
This commit is contained in:
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build an AppImage packaging blocker-daemon, blocker-ui and assets.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
DIST_DIR="$ROOT_DIR/dist"
|
||||
APPDIR="$DIST_DIR/AppDir"
|
||||
PKG_DIR="$ROOT_DIR/packaging/appimage"
|
||||
|
||||
echo "Building release binaries..."
|
||||
cargo build --release -p blocker-daemon -p blocker-ui
|
||||
|
||||
echo "Preparing AppDir structure..."
|
||||
mkdir -p "$APPDIR"
|
||||
mkdir -p "$APPDIR/usr/bin"
|
||||
mkdir -p "$APPDIR/usr/share/applications"
|
||||
mkdir -p "$APPDIR/usr/share/icons/hicolor/scalable/apps"
|
||||
|
||||
cp "$ROOT_DIR/target/release/blocker-daemon" "$APPDIR/usr/bin/"
|
||||
cp "$ROOT_DIR/target/release/blocker-ui" "$APPDIR/usr/bin/"
|
||||
cp "$PKG_DIR/AppRun" "$APPDIR/AppRun"
|
||||
cp "$PKG_DIR/blocker.desktop" "$APPDIR/blocker.desktop"
|
||||
cp "$PKG_DIR/blocker.desktop" "$APPDIR/usr/share/applications/"
|
||||
cp "$PKG_DIR/blocker.svg" "$APPDIR/blocker.svg"
|
||||
cp "$PKG_DIR/blocker.svg" "$APPDIR/usr/share/icons/hicolor/scalable/apps/"
|
||||
chmod +x "$APPDIR/AppRun"
|
||||
|
||||
OUTPUT_APPIMAGE="$DIST_DIR/Blocker-x86_64.AppImage"
|
||||
rm -f "$OUTPUT_APPIMAGE"
|
||||
|
||||
echo "Creating AppImage with mksquashfs..."
|
||||
mksquashfs "$APPDIR" "$OUTPUT_APPIMAGE" -root-owned -noappend -comp xz
|
||||
|
||||
echo "Built AppImage: $OUTPUT_APPIMAGE"
|
||||
ls -lh "$OUTPUT_APPIMAGE"
|
||||
Reference in New Issue
Block a user