diff --git a/bin/bundle-appimage.sh b/bin/bundle-appimage.sh index 5120d1b..52bcd6e 100755 --- a/bin/bundle-appimage.sh +++ b/bin/bundle-appimage.sh @@ -23,6 +23,22 @@ export ICON="./ghostty-${GHOSTTY_VERSION}/zig-out/share/icons/hicolor/256x256/ap quick-sharun ./ghostty-${GHOSTTY_VERSION}/zig-out/bin/ghostty cp -rf ./ghostty-${GHOSTTY_VERSION}/zig-out/share/* ./AppDir/share/ + +# zig build substitutes @GHOSTTY@ in dist/linux/app.desktop.in with the absolute build +# prefix, and the copy above drops the generated tree into AppDir verbatim, so the +# embedded entries carry a build path such as +# /__w/ghostty-appimage/ghostty-appimage/ghostty-/zig-out/bin/ghostty. +# Integration tools (AM, GearLever, Soar, AppImageLauncher) rewrite Exec/TryExec when they +# install the entry, so this is not user-visible breakage for them; normalize it anyway so +# the entry shipped inside the image is portable on its own. +for desktop_file in ./AppDir/*.desktop ./AppDir/share/applications/*.desktop; do + [ -f "${desktop_file}" ] || continue + sed -i -E \ + -e 's|^Exec=[^ ]*/|Exec=|' \ + -e 's|^TryExec=.*|TryExec=ghostty|' \ + "${desktop_file}" +done + quick-sharun --make-appimage mkdir -p ./dist