diff options
| -rw-r--r-- | .github/workflows/release.yml | 34 | ||||
| -rwxr-xr-x | src-tauri/scripts/fix-appimage.sh | 32 | ||||
| -rw-r--r-- | src-tauri/tauri.conf.json | 7 |
3 files changed, 72 insertions, 1 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2c73602..f043155 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -124,6 +124,14 @@ jobs: workspaces: "./src-tauri -> target" shared-key: ${{ matrix.target }} + - name: Setup appimagetool (Linux) + if: startsWith(matrix.platform, 'ubuntu') + run: | + ARCH=$(uname -m) + wget -q "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-${ARCH}.AppImage" + chmod +x "appimagetool-${ARCH}.AppImage" + sudo mv "appimagetool-${ARCH}.AppImage" /usr/local/bin/appimagetool + - name: Build Tauri App uses: tauri-apps/tauri-action@v0 env: @@ -131,3 +139,29 @@ jobs: with: releaseId: ${{ needs.promote-release.outputs.release_id }} args: ${{ matrix.args }} + + - name: Fix AppImage for Wayland (Linux) + if: startsWith(matrix.platform, 'ubuntu') + run: | + # Locate the generated AppImage + APPIMAGE=$(find bundle -name "*.AppImage" -type f | head -1) + echo "Found AppImage: $APPIMAGE" + + if [ -n "$APPIMAGE" ]; then + # backup original AppImage + cp "$APPIMAGE" "${APPIMAGE}.backup" + + # extract AppImage + "$APPIMAGE" --appimage-extract + + # Fix GTK hook, remove forced X11 + if [ -f squashfs-root/apprun-hooks/linuxdeploy-plugin-gtk.sh ]; then + sed -i 's/^export GDK_BACKEND=x11.*$/# export GDK_BACKEND=x11 # Disabled for Wayland compatibility/' squashfs-root/apprun-hooks/linuxdeploy-plugin-gtk.sh + echo "Successfully patched GTK hook for Wayland compatibility" + fi + + # Repack AppImage + appimagetool squashfs-root "$APPIMAGE" + rm -rf squashfs-root + fi + working-directory: src-tauri/target/release diff --git a/src-tauri/scripts/fix-appimage.sh b/src-tauri/scripts/fix-appimage.sh new file mode 100755 index 0000000..6bb375b --- /dev/null +++ b/src-tauri/scripts/fix-appimage.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# fix AppImage for Wayland compatibility +# This script modifies the AppImage bundle created by Tauri to ensure compatibility with Wayland +# It specifically targets the GTK backend settings to avoid forcing X11 + +set -e + +echo "Fixing AppImage for Wayland compatibility..." + +# Tauri sets the APPIMAGE_BUNDLE_PATH environment variable during the build process +APPDIR_PATH="${APPIMAGE_BUNDLE_PATH:-}" + +if [ -z "$APPDIR_PATH" ]; then + echo "No AppImage bundle path found, skipping fix" + exit 0 +fi + +# Check for the presence of the GTK hook file +if [ -d "$APPDIR_PATH/apprun-hooks" ]; then + HOOK_FILE="$APPDIR_PATH/apprun-hooks/linuxdeploy-plugin-gtk.sh" + + if [ -f "$HOOK_FILE" ]; then + echo "Found GTK hook file, patching..." + + # Comment out the line that forces GDK_BACKEND to x11 + sed -i 's/^export GDK_BACKEND=x11.*$/# export GDK_BACKEND=x11 # Disabled for Wayland compatibility/' "$HOOK_FILE" + + echo "Successfully patched $HOOK_FILE" + fi +fi + +echo "AppImage Wayland fix completed!" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 8706614..beba8d3 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -33,6 +33,11 @@ "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico" - ] + ], + "linux": { + "appimage": { + "bundleMediaFramework": false + } + } } }
\ No newline at end of file |