Linux packaging: Debian package, AppImage script, release workflow
- CPack DEB configuration (cmake/Packaging.cmake): dependencies from dpkg-shlibdeps, udisks2 recommended, strip. - AppStream metadata, installed with the desktop file and the icons; tools/release.sh adds each release to it. - tools/appimage.sh: AppImage of the GTK interface and openpu-cli with linuxdeploy and its GTK plugin (x86_64 and aarch64). - Release workflow: .deb, AppImage and openpu-cli tarball for x86_64 and arm64, attached to the release of a vX.Y.Z tag, or kept as artifacts on a manual run. tools/release.sh edits the release when the workflow created it first. - The GTK interface finds its translations next to the executable (../share/locale), for relocatable installs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WDASLCiN764v685boRVYar
This commit is contained in:
1 parent
bbc3bb3896
commit
ce7316af29
11 files changed
+261
-8
No files matched your search
Executable
+42
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: MIT
|
||||
# Builds OpenPU-<version>-<arch>.AppImage (GTK interface + openpu-cli) with linuxdeploy and its GTK
|
||||
# plugin, in the current directory. Runs on x86_64 and aarch64; no FUSE needed.
|
||||
#
|
||||
# usage: tools/appimage.sh [build-dir]
|
||||
# The linuxdeploy tools are downloaded once into $OPENPU_APPIMAGE_TOOLS (default ~/.cache/openpu-appimage).
|
||||
set -eu
|
||||
|
||||
SRC=$(cd "$(dirname "$0")/.." && pwd)
|
||||
BUILD=${1:-$SRC/../build-openpu/appimage}
|
||||
OUT=$(pwd)
|
||||
ARCH=$(uname -m)
|
||||
TOOLS=${OPENPU_APPIMAGE_TOOLS:-$HOME/.cache/openpu-appimage}
|
||||
LINUXDEPLOY=$TOOLS/linuxdeploy-$ARCH.AppImage
|
||||
GTK_PLUGIN=$TOOLS/linuxdeploy-plugin-gtk.sh
|
||||
|
||||
mkdir -p "$TOOLS"
|
||||
fetch() { # url file
|
||||
[ -s "$2" ] || { curl -fsSL -o "$2.part" "$1" && mv "$2.part" "$2"; }
|
||||
chmod +x "$2"
|
||||
}
|
||||
fetch "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-$ARCH.AppImage" "$LINUXDEPLOY"
|
||||
fetch "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh" "$GTK_PLUGIN"
|
||||
|
||||
cmake -S "$SRC" -B "$BUILD" -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DOPENPU_UI_GTK=ON -DOPENPU_BUILD_TESTS=OFF
|
||||
cmake --build "$BUILD"
|
||||
APPDIR=$BUILD/AppDir
|
||||
rm -rf "$APPDIR"
|
||||
DESTDIR=$APPDIR cmake --install "$BUILD" --strip
|
||||
|
||||
VERSION=$("$APPDIR/usr/bin/openpu-cli" --version | awk '{print $2}')
|
||||
ID=io.github.openpu.OpenPU
|
||||
cd "$OUT"
|
||||
# linuxdeploy finds its plugins next to itself or in PATH.
|
||||
PATH=$TOOLS:$PATH APPIMAGE_EXTRACT_AND_RUN=1 DEPLOY_GTK_VERSION=4 LINUXDEPLOY_OUTPUT_VERSION=$VERSION \
|
||||
"$LINUXDEPLOY" --appdir "$APPDIR" --plugin gtk --output appimage \
|
||||
--executable "$APPDIR/usr/bin/openpu" --executable "$APPDIR/usr/bin/openpu-cli" \
|
||||
--desktop-file "$APPDIR/usr/share/applications/$ID.desktop" \
|
||||
--icon-file "$APPDIR/usr/share/icons/hicolor/256x256/apps/$ID.png"
|
||||
ls -l "$OUT"/OpenPU-*.AppImage
|
||||
Reference in new issue
Block a user