Last active
June 27, 2025 22:44
-
-
Save Damglador/9f7c6768d6b2118dc6115aa6bd9d41cd to your computer and use it in GitHub Desktop.
LEGO Isle AppImage builder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
HERE="$(dirname "$(readlink -f "${0}")")" | |
MAIN=$(grep -r "^Exec=.*" "$HERE"/*.desktop | head -n 1 | cut -d "=" -f 2 | cut -d " " -f 1) | |
# MAIN_BIN=$(find "$HERE/usr/bin" -name "$MAIN" | head -n 1) | |
MAIN_BIN="$HERE/usr/bin/isle-config" | |
export PATH="${HERE}/usr/bin/":$PATH # Prefer bundled binaries | |
export QT_QPA_PLATFORMTHEME=xdgdesktopportal # Use XDG filepicker for forward compatability | |
[ -z "$QT_PLUGIN_PATH" ] && export QT_PLUGIN_PATH=/usr/lib/qt6/plugins:/usr/lib64/qt6/plugins # Use system Qt theme, will fallback to the default one if unavailable | |
if [ ! -z $APPIMAGE ]; then | |
BINARY_NAME=$(basename "$ARGV0") | |
if [ -e "$HERE/usr/bin/$BINARY_NAME" ]; then | |
exec "$HERE/usr/bin/$BINARY_NAME" "$@" | |
else | |
exec "${MAIN_BIN}" "$@" | |
fi | |
else | |
exec "${MAIN_BIN}" "$@" | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
export LD_LIBRARY_PATH="build/lib:$LD_LIBRARY_PATH" | |
export QMAKE=/usr/lib/qt6/bin/qmake | |
BUILD_SOURCE=../build | |
APPRUN_SOURCE=AppRun | |
DESKTOP_FILE_SOURCE=isle-portable.desktop | |
cd $(dirname $0) | |
clean(){ | |
rm -rf assets tools build AppDir | |
} | |
download(){ | |
if [ ! -e "$1" ]; then | |
curl -Lo "$1" "$2" | |
fi | |
} | |
prepare(){ | |
mkdir -p tools | |
mkdir -p assets | |
download tools/appimagetool.AppImage https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage | |
chmod u+x tools/appimagetool.AppImage | |
download tools/linuxdeploy.AppImage https://github.com/linuxdeploy/linuxdeploy/releases/latest/download/linuxdeploy-$(uname -m).AppImage | |
chmod u+x tools/linuxdeploy.AppImage | |
download tools/linuxdeploy-plugin-qt.AppImage https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/latest/download/linuxdeploy-plugin-qt-$(uname -m).AppImage | |
chmod u+x tools/linuxdeploy-plugin-qt.AppImage | |
download assets/isle.png https://github.com/isledecomp/isle/blob/master/assets/isle.png?raw=true | |
magick assets/isle.png -resize 256x256 assets/isle.png | |
download assets/isle-config.png https://github.com/isledecomp/isle/blob/master/assets/config.png?raw=true | |
magick assets/isle-config.png -resize 256x256 assets/isle-config.png | |
if [ ! -f "assets/isle-portable.desktop" ]; then | |
cp $DESKTOP_FILE_SOURCE assets/isle-portable.desktop | |
cp $APPRUN_SOURCE assets/AppRun | |
fi | |
if [ ! -d "build" ]; then | |
cp -r $BUILD_SOURCE build | |
fi | |
} | |
compile(){ | |
NO_STRIP=1 tools/linuxdeploy.AppImage \ | |
--plugin qt \ | |
-e build/bin/isle \ | |
-e build/bin/isle-config \ | |
-d assets/isle-portable.desktop \ | |
-i assets/isle.png \ | |
-i assets/isle-config.png \ | |
--custom-apprun=AppRun \ | |
--appdir=AppDir | |
} | |
package(){ | |
tools/appimagetool.AppImage AppDir "LEGO_Island-$(uname -m).AppImage" | |
} | |
stop(){ | |
exit | |
} | |
for func in "$@"; do | |
"$func" | |
done | |
prepare | |
compile | |
package |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Name=LEGO Island | |
GenericName= | |
Comment=LEGO-themed open-world adventure game | |
Name[uk_UA]=LEGO Island | |
GenericName[uk_UA]= | |
Comment[uk_UA]=Тематична LEGO гра з відкритим світом | |
Actions=Settings | |
Categories=Game;AdventureGame;ActionGame;KidsGame; | |
Exec=isle | |
Icon=isle | |
StartupNotify=true | |
StartupWMClass=lego-isle | |
Type=Application | |
[Desktop Action Settings] | |
Exec=isle-config | |
Name=Settings | |
Name[uk_UA]=Налаштування | |
Icon=isle-config |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment