From fc3165e616b973e9c89ba3392df77cd0fde059bc Mon Sep 17 00:00:00 2001 From: Baptiste Augrain Date: Fri, 23 Jul 2021 09:29:48 +0200 Subject: [PATCH] Fixing python in AppImage - overwrite AppRun to remove the env variables `PYTHONHOME` and `PYTHONPATH` - update building script to it can be build manually in docker --- VSCodium-AppImage-Recipe.yml | 12 ++++++++++++ create_appimage.sh | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/VSCodium-AppImage-Recipe.yml b/VSCodium-AppImage-Recipe.yml index 99cd94f40b1..54519800fba 100644 --- a/VSCodium-AppImage-Recipe.yml +++ b/VSCodium-AppImage-Recipe.yml @@ -30,3 +30,15 @@ script: - /usr/bin/convert vscodium.png -resize 48x48 usr/share/icons/hicolor/48x48/apps/vscodium.png - /usr/bin/convert vscodium.png -resize 32x32 usr/share/icons/hicolor/32x32/apps/vscodium.png - ( cd usr/bin/ ; ln -s ../share/codium/codium . ) + - cat > AppRun <<\EOF + - #!/bin/sh + - HERE="$(dirname "$(readlink -f "${0}")")" + - export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}" + - export LD_LIBRARY_PATH="${HERE}"/usr/lib/:"${HERE}"/usr/lib/i386-linux-gnu/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/usr/lib32/:"${HERE}"/usr/lib64/:"${HERE}"/lib/:"${HERE}"/lib/i386-linux-gnu/:"${HERE}"/lib/x86_64-linux-gnu/:"${HERE}"/lib32/:"${HERE}"/lib64/:"${LD_LIBRARY_PATH}" + - export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}" + - export PERLLIB="${HERE}"/usr/share/perl5/:"${HERE}"/usr/lib/perl5/:"${PERLLIB}" + - export GSETTINGS_SCHEMA_DIR="${HERE}"/usr/share/glib-2.0/schemas/:"${GSETTINGS_SCHEMA_DIR}" + - export QT_PLUGIN_PATH="${HERE}"/usr/lib/qt4/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib32/qt4/plugins/:"${HERE}"/usr/lib64/qt4/plugins/:"${HERE}"/usr/lib/qt5/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib32/qt5/plugins/:"${HERE}"/usr/lib64/qt5/plugins/:"${QT_PLUGIN_PATH}" + - EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g') + - exec ${EXEC} "$@" + - EOF diff --git a/create_appimage.sh b/create_appimage.sh index 5a85a5f1f2b..84dc9e37801 100755 --- a/create_appimage.sh +++ b/create_appimage.sh @@ -10,9 +10,13 @@ if [[ "$VSCODE_ARCH" == "x64" ]]; then chmod +x ./pkg2appimage-*.AppImage ./pkg2appimage-*.AppImage --appimage-extract && mv ./squashfs-root ./pkg2appimage.AppDir - + + # add update's url sed -i 's/generate_type2_appimage/generate_type2_appimage -u "gh-releases-zsync|VSCodium|vscodium|latest|*.AppImage.zsync"/' pkg2appimage.AppDir/AppRun + # remove check so build in docker can succeed + sed -i 's/grep docker/# grep docker/' pkg2appimage.AppDir/usr/share/pkg2appimage/functions.sh + bash -ex pkg2appimage.AppDir/AppRun VSCodium-AppImage-Recipe.yml fi