From eafd2830195abafda95c5fb6bb15f6c4d7af3437 Mon Sep 17 00:00:00 2001 From: Samuel <36420837+Samueru-sama@users.noreply.github.com> Date: Fri, 15 Nov 2024 02:39:11 +0000 Subject: [PATCH] fix appimage cd error and use static appimage runtime (#1924) * fix appimage cd error and use static appimage runtime * include `desktop-file-utils` for appimagetool * remove mv of old `AppRun` * revert indentation * don't export `APPIMAGE_EXTRACT_AND_RUN` --- scripts/appimage.sh | 33 +++++++++++++++++---------------- scripts/install-dependencies.sh | 2 +- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/scripts/appimage.sh b/scripts/appimage.sh index 17551a4..fe4d720 100644 --- a/scripts/appimage.sh +++ b/scripts/appimage.sh @@ -85,7 +85,7 @@ fi setup_appimagetool() { if [ ! -e appimagetool ]; then - if ! wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-${ARCH}.AppImage" ; then + if ! wget -O appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-${ARCH}.AppImage" ; then echo "Could not download the appimagetool for the arch '${ARCH}'." exit 1 else @@ -94,17 +94,6 @@ setup_appimagetool() { fi } -download_appimage_apprun() { - if [ ! -e AppRun ]; then - if ! wget -O AppRun "https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-${ARCH}" ; then - echo "Could not download AppRun for the arch '${ARCH}'." - exit 1 - else - chmod 0755 AppRun - fi - fi -} - build_litexl() { if [ -e build ]; then rm -rf build @@ -135,11 +124,24 @@ generate_appimage() { echo "Creating LiteXL.AppDir..." DESTDIR="$(realpath LiteXL.AppDir)" meson install --skip-subprojects -C ${BUILD_DIR} - mv AppRun LiteXL.AppDir/ - # These could be symlinks but it seems they doesn't work with AppimageLauncher + cp resources/icons/lite-xl.svg LiteXL.AppDir/ cp resources/linux/org.lite_xl.lite_xl.desktop LiteXL.AppDir/ + # https://github.com/lite-xl/lite-xl/issues/1912 + mkdir -p ./LiteXL.AppDir/usr/share/../bin + mv ./LiteXL.AppDir/lite-xl ./LiteXL.AppDir/usr/bin + mv ./LiteXL.AppDir/data ./LiteXL.AppDir/usr/share/lite-xl + rm -rf ./LiteXL.AppDir/lib64 ./LiteXL.AppDir/include + + echo "Creating AppRun..." + cat >> LiteXL.AppDir/AppRun <<- 'EOF' + #!/bin/sh + CURRENTDIR="$(dirname "$(readlink -f "$0")")" + exec "$CURRENTDIR/usr/bin/lite-xl" "$@" + EOF + chmod +x LiteXL.AppDir/AppRun + if [[ $ADDONS == true ]]; then addons_download "${BUILD_DIR}" addons_install "${BUILD_DIR}" "LiteXL.AppDir/usr/share/lite-xl" @@ -181,10 +183,9 @@ generate_appimage() { version="${version}-addons" fi - ./appimagetool --appimage-extract-and-run LiteXL.AppDir LiteXL${version}-${ARCH}.AppImage + APPIMAGE_EXTRACT_AND_RUN=1 ./appimagetool LiteXL.AppDir LiteXL${version}-${ARCH}.AppImage } setup_appimagetool -download_appimage_apprun if [[ $RUN_BUILD == true ]]; then build_litexl; fi generate_appimage $1 diff --git a/scripts/install-dependencies.sh b/scripts/install-dependencies.sh index fb593ca..1a5db49 100644 --- a/scripts/install-dependencies.sh +++ b/scripts/install-dependencies.sh @@ -41,7 +41,7 @@ main() { fi if [[ "$OSTYPE" == "linux"* ]]; then - sudo apt-get install -qq libfuse2 ninja-build wayland-protocols libsdl2-dev libfreetype6 + sudo apt-get install -qq libfuse2 ninja-build wayland-protocols libsdl2-dev libfreetype6 desktop-file-utils pip3 install meson elif [[ "$OSTYPE" == "darwin"* ]]; then brew install bash ninja sdl2