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`
This commit is contained in:
Samuel
2024-11-27 20:53:34 +08:00
committed by takase1121
parent aafd856149
commit eafd283019
2 changed files with 18 additions and 17 deletions
+17 -16
View File
@@ -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
+1 -1
View File
@@ -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