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:
+17
-16
@@ -85,7 +85,7 @@ fi
|
|||||||
|
|
||||||
setup_appimagetool() {
|
setup_appimagetool() {
|
||||||
if [ ! -e appimagetool ]; then
|
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}'."
|
echo "Could not download the appimagetool for the arch '${ARCH}'."
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
@@ -94,17 +94,6 @@ setup_appimagetool() {
|
|||||||
fi
|
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() {
|
build_litexl() {
|
||||||
if [ -e build ]; then
|
if [ -e build ]; then
|
||||||
rm -rf build
|
rm -rf build
|
||||||
@@ -135,11 +124,24 @@ generate_appimage() {
|
|||||||
echo "Creating LiteXL.AppDir..."
|
echo "Creating LiteXL.AppDir..."
|
||||||
|
|
||||||
DESTDIR="$(realpath LiteXL.AppDir)" meson install --skip-subprojects -C ${BUILD_DIR}
|
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/icons/lite-xl.svg LiteXL.AppDir/
|
||||||
cp resources/linux/org.lite_xl.lite_xl.desktop 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
|
if [[ $ADDONS == true ]]; then
|
||||||
addons_download "${BUILD_DIR}"
|
addons_download "${BUILD_DIR}"
|
||||||
addons_install "${BUILD_DIR}" "LiteXL.AppDir/usr/share/lite-xl"
|
addons_install "${BUILD_DIR}" "LiteXL.AppDir/usr/share/lite-xl"
|
||||||
@@ -181,10 +183,9 @@ generate_appimage() {
|
|||||||
version="${version}-addons"
|
version="${version}-addons"
|
||||||
fi
|
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
|
setup_appimagetool
|
||||||
download_appimage_apprun
|
|
||||||
if [[ $RUN_BUILD == true ]]; then build_litexl; fi
|
if [[ $RUN_BUILD == true ]]; then build_litexl; fi
|
||||||
generate_appimage $1
|
generate_appimage $1
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ main() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$OSTYPE" == "linux"* ]]; then
|
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
|
pip3 install meson
|
||||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
brew install bash ninja sdl2
|
brew install bash ninja sdl2
|
||||||
|
|||||||
Reference in New Issue
Block a user