From 64194172c1dc3f5d3eafe170780d9c4dfe27d6f2 Mon Sep 17 00:00:00 2001 From: Martijn de Boer Date: Sat, 29 Oct 2022 16:19:51 +0200 Subject: [PATCH] linux appdir & appimage build --- tools/build.sh | 37 ++++++++++++++++++++++++++++++------- tools/vision.desktop | 10 ++++++++++ 2 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 tools/vision.desktop diff --git a/tools/build.sh b/tools/build.sh index 7f5e296..0938b07 100644 --- a/tools/build.sh +++ b/tools/build.sh @@ -1,10 +1,11 @@ #!/usr/bin/env bash # Slightly based on love-exporter at https://github.com/dmoa/love-export/blob/master/main.sh -VISION_COMMIT=`git ls-remote https://git.biggetje.net/martijn/vision.git | grep "refs/heads/main" | cut -f 1 | head -c 8` LOVE_VERSION=11.4 LOVE_WIN64=https://github.com/love2d/love/releases/download/$LOVE_VERSION/love-$LOVE_VERSION-win64.zip LOVE_MACOS=https://github.com/love2d/love/releases/download/$LOVE_VERSION/love-$LOVE_VERSION-macos.zip +LOVE_LINUX=https://github.com/love2d/love/releases/download/$LOVE_VERSION/love-$LOVE_VERSION-x86_64.AppImage +APPIMAGETOOL=https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage build() { echo "Building release" @@ -32,7 +33,14 @@ downloadlove() { rm love-$LOVE_VERSION-macos.zip cd .. - # todo appimage + mkdir linux + cd linux + curl -L -O $LOVE_LINUX + curl -L -O $APPIMAGETOOL + ./appimagetool-x86_64.AppImage --appimage-extract + mv squashfs-root appimage + ./love-$LOVE_VERSION-x86_64.AppImage --appimage-extract + cd .. cd .. } @@ -40,26 +48,40 @@ downloadlove() { makelove() { cd build/game echo "Generating love file" - zip -9 -r ../../release/vision-$VISION_COMMIT.love . + zip -9 -r ../../release/vision.love . cd ../.. } makewin64() { echo "Generating Win64 build" - cat "build/win/love.exe" "release/vision-$VISION_COMMIT.love" > "build/win/vision.exe" + cat "build/win/love.exe" "release/vision.love" > "build/win/vision.exe" rm "build/win/love.exe" cd build/win - zip -9 -r ../../release/vision-$VISION_COMMIT-win64.zip . + zip -9 -r ../../release/vision-win64.zip . cd ../.. } makemac() { echo "Generating MacOS build" - cp "release/vision-$VISION_COMMIT.love" "build/mac/love.app/Contents/Resources" + cp "release/vision.love" "build/mac/love.app/Contents/Resources" mv "build/mac/love.app" "build/mac/vision.app" cd build/mac cp -f "../../tools/macos-info.plist" "vision.app/Contents/Info.plist" - zip -9 -r ../../release/vision-$VISION_COMMIT-macos.zip . + zip -9 -r ../../release/vision-macos.zip . + cd ../.. +} + +makelinux() { + cd "build/linux/" + cat "squashfs-root/bin/love" "../../release/vision.love" > "squashfs-root/bin/vision" + chmod +x "squashfs-root/bin/vision" + cp -f "../../tools/vision.desktop" "squashfs-root/vision.desktop" + rm "squashfs-root/love.desktop" + cd "squashfs-root" + tar zcvf ../../../release/vision-linux-appdir.tar.gz * + cd .. + ./appimage/AppRun squashfs-root ../../release/vision-linux.AppImage + cd ../.. } @@ -73,3 +95,4 @@ downloadlove makelove makewin64 makemac +makelinux \ No newline at end of file diff --git a/tools/vision.desktop b/tools/vision.desktop new file mode 100644 index 0000000..402a818 --- /dev/null +++ b/tools/vision.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Vision +Comment=The unquestionably awesome 2D game engine +MimeType=application/x-love-game; +Exec=vision %f +Type=Application +Categories=Game +Terminal=false +Icon=love +NoDisplay=true