32 lines
934 B
Bash
Executable File
32 lines
934 B
Bash
Executable File
#!/bin/bash
|
|
# Package Linux build as AppImage
|
|
# Usage: package-linux.sh <build-dir> <qt-dir> <output-dir>
|
|
set -euo pipefail
|
|
|
|
BUILD_DIR="${1:?Usage: package-linux.sh <build-dir> <qt-dir> <output-dir>}"
|
|
QT_DIR="${2:?}"
|
|
OUTPUT_DIR="${3:?}"
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
|
|
APPDIR="${BUILD_DIR}/AppDir"
|
|
|
|
rm -rf "$APPDIR"
|
|
|
|
# linuxdeploy handles AppDir structure, library bundling, and AppRun
|
|
export QMAKE="$QT_DIR/bin/qmake"
|
|
export QML_SOURCES_PATHS="$PROJECT_DIR/src/qml"
|
|
export LD_LIBRARY_PATH="$QT_DIR/lib:${LD_LIBRARY_PATH:-}"
|
|
export OUTPUT="Asteria-x86_64.AppImage"
|
|
|
|
linuxdeploy \
|
|
--appdir "$APPDIR" \
|
|
--executable "$BUILD_DIR/asteria-qt" \
|
|
--desktop-file "$PROJECT_DIR/packaging/asteria-qt.desktop" \
|
|
--icon-file "$PROJECT_DIR/packaging/icons/256x256/asteria-qt.png" \
|
|
--plugin qt \
|
|
--output appimage
|
|
|
|
mkdir -p "$OUTPUT_DIR"
|
|
mv "$OUTPUT" "$OUTPUT_DIR/"
|