- Change app ID from io.github.outlay to com.outlay.app across all files - Add AppStream metainfo with full feature description, 16 screenshots, and v0.1.0 release - Update desktop file with expanded metadata (StartupNotify, SingleMainWindow) - Add summary and description fields to GSchema keys - Move toast overlay outside ScrolledWindow so notifications stay visible in viewport - Embed tray icon as ARGB pixmap data for reliable system tray display - Register hicolor icon theme path for taskbar icon on Wayland - Remove unused icon variants (old naming, web favicons, SVG, ICO, shadow) - Add screenshots to data/screenshots/ - Update build script with metainfo and screenshot bundling
119 lines
4.3 KiB
Bash
Executable File
119 lines
4.3 KiB
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
|
|
|
|
cd "$PROJECT_DIR"
|
|
|
|
echo "==> Building release binary..."
|
|
cargo build --release -p outlay-gtk
|
|
|
|
echo "==> Creating AppDir structure..."
|
|
rm -rf AppDir
|
|
mkdir -p AppDir/usr/bin
|
|
mkdir -p AppDir/usr/share/applications
|
|
mkdir -p AppDir/usr/share/glib-2.0/schemas
|
|
mkdir -p AppDir/usr/share/fonts/truetype/liberation
|
|
|
|
# Copy binary
|
|
cp target/release/outlay-gtk AppDir/usr/bin/
|
|
|
|
# Copy desktop file
|
|
cp outlay-gtk/data/com.outlay.app.desktop AppDir/
|
|
cp outlay-gtk/data/com.outlay.app.desktop AppDir/usr/share/applications/
|
|
|
|
# Copy app icons (all hicolor sizes)
|
|
for size_dir in outlay-gtk/data/icons/hicolor/*/apps; do
|
|
size=$(basename "$(dirname "$size_dir")")
|
|
mkdir -p "AppDir/usr/share/icons/hicolor/$size/apps"
|
|
cp "$size_dir"/com.outlay.app.* "AppDir/usr/share/icons/hicolor/$size/apps/" 2>/dev/null || true
|
|
done
|
|
|
|
# Copy Tabler action icons
|
|
mkdir -p AppDir/usr/share/icons/hicolor/scalable/actions
|
|
cp outlay-gtk/data/icons/hicolor/scalable/actions/outlay-*.svg AppDir/usr/share/icons/hicolor/scalable/actions/
|
|
cp outlay-gtk/data/icons/hicolor/scalable/actions/tabler-*.svg AppDir/usr/share/icons/hicolor/scalable/actions/
|
|
|
|
# Copy metainfo and screenshots
|
|
mkdir -p AppDir/usr/share/metainfo
|
|
cp outlay-gtk/data/com.outlay.app.metainfo.xml AppDir/usr/share/metainfo/
|
|
mkdir -p AppDir/usr/share/screenshots
|
|
cp data/screenshots/*.png AppDir/usr/share/screenshots/
|
|
|
|
# Copy GSettings schema
|
|
cp outlay-gtk/data/com.outlay.app.gschema.xml AppDir/usr/share/glib-2.0/schemas/
|
|
glib-compile-schemas AppDir/usr/share/glib-2.0/schemas/
|
|
|
|
# Bundle Liberation Sans fonts (needed for PDF report generation)
|
|
FONT_DIR="/usr/share/fonts/truetype/liberation"
|
|
if [ -d "$FONT_DIR" ]; then
|
|
cp "$FONT_DIR"/LiberationSans-*.ttf AppDir/usr/share/fonts/truetype/liberation/
|
|
echo "==> Bundled Liberation Sans fonts"
|
|
fi
|
|
|
|
# Bundle JetBrains Mono fonts (needed for amount display)
|
|
mkdir -p AppDir/usr/share/fonts
|
|
cp outlay-gtk/data/fonts/*.ttf AppDir/usr/share/fonts/
|
|
echo "==> Bundled JetBrains Mono fonts"
|
|
|
|
# Bundle tesseract OCR (needed for receipt amount detection)
|
|
TESSERACT_BIN="$(command -v tesseract 2>/dev/null || true)"
|
|
if [ -n "$TESSERACT_BIN" ]; then
|
|
cp "$TESSERACT_BIN" AppDir/usr/bin/tesseract
|
|
# Bundle tessdata (English trained data)
|
|
mkdir -p AppDir/usr/bin/tessdata
|
|
TESSDATA_DIR=""
|
|
for candidate in /usr/share/tesseract-ocr/5/tessdata /usr/share/tesseract-ocr/4.00/tessdata /usr/share/tessdata /usr/local/share/tessdata; do
|
|
if [ -f "$candidate/eng.traineddata" ]; then
|
|
TESSDATA_DIR="$candidate"
|
|
break
|
|
fi
|
|
done
|
|
if [ -n "$TESSDATA_DIR" ]; then
|
|
cp "$TESSDATA_DIR/eng.traineddata" AppDir/usr/bin/tessdata/
|
|
echo "==> Bundled tesseract + eng.traineddata"
|
|
else
|
|
echo "==> WARNING: tesseract found but eng.traineddata not found - OCR may not work"
|
|
fi
|
|
# Bundle tesseract's shared library dependencies
|
|
for lib in $(ldd "$TESSERACT_BIN" 2>/dev/null | grep -oP '/\S+\.so\S*' | grep -v '^/lib'); do
|
|
if [ -f "$lib" ]; then
|
|
mkdir -p AppDir/usr/lib
|
|
cp -n "$lib" AppDir/usr/lib/ 2>/dev/null || true
|
|
fi
|
|
done
|
|
else
|
|
echo "==> WARNING: tesseract not found - OCR will not be available in AppImage"
|
|
echo " Install with: sudo apt install tesseract-ocr"
|
|
fi
|
|
|
|
# Download linuxdeploy if not present
|
|
LINUXDEPLOY="linuxdeploy-x86_64.AppImage"
|
|
if [ ! -f "$LINUXDEPLOY" ]; then
|
|
echo "==> Downloading linuxdeploy..."
|
|
wget -q "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/$LINUXDEPLOY"
|
|
chmod +x "$LINUXDEPLOY"
|
|
fi
|
|
|
|
# Download GTK plugin if not present
|
|
GTK_PLUGIN="linuxdeploy-plugin-gtk.sh"
|
|
if [ ! -f "$GTK_PLUGIN" ]; then
|
|
echo "==> Downloading linuxdeploy GTK plugin..."
|
|
wget -q "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/$GTK_PLUGIN"
|
|
chmod +x "$GTK_PLUGIN"
|
|
fi
|
|
|
|
echo "==> Building AppImage..."
|
|
export DEPLOY_GTK_VERSION=4
|
|
|
|
./"$LINUXDEPLOY" \
|
|
--appdir AppDir \
|
|
--plugin gtk \
|
|
--output appimage \
|
|
--desktop-file AppDir/com.outlay.app.desktop \
|
|
--icon-file AppDir/usr/share/icons/hicolor/256x256/apps/com.outlay.app.png
|
|
|
|
echo "==> Done! AppImage created."
|
|
ls -lh Outlay-*.AppImage 2>/dev/null || echo "Note: Output filename may vary."
|