From 915fd6a26ef89ee9e33d4f5ebff62d08b7d9fde8 Mon Sep 17 00:00:00 2001 From: Alexander Griffith Date: Wed, 16 Mar 2022 17:38:45 -0400 Subject: [PATCH] Switched over from using the .tar.gz artifact to the AppData artifact for linux builds for 11.4 compatibility --- .gitignore | 3 +- buildtools/appimage/build.sh | 57 +- buildtools/appimage/love-prepared/.DirIcon | 962 --------------------- buildtools/appimage/wrapper | 4 - makefile | 1 - 5 files changed, 38 insertions(+), 989 deletions(-) delete mode 100644 buildtools/appimage/love-prepared/.DirIcon delete mode 100755 buildtools/appimage/wrapper diff --git a/.gitignore b/.gitignore index ebf30c0..393d4e2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *~ /releases /buildtools/appimage/love-prepared/ -/buildtools/appimage/AppRun-x86_64 +/buildtools/appimage/game-x86_64.AppImage +/buildtools/appimage/love-11.4-x86_64.AppImage /buildtools/appimage/appimagetool-x86_64.AppImage /buildtools/appimage/squashfs-root diff --git a/buildtools/appimage/build.sh b/buildtools/appimage/build.sh index e18339a..fc16c45 100755 --- a/buildtools/appimage/build.sh +++ b/buildtools/appimage/build.sh @@ -13,20 +13,30 @@ fi VERSION="$1" LOVEFILE="$2" -LOVE_TAR_URL=https://github.com/love2d/love/releases/download/${VERSION}/love-${VERSION}-linux-${ARCH}.tar.gz +# eg +# https://github.com/love2d/love/releases/download/11.4/love-11.4-x86_64.AppImage +# https://github.com/love2d/love/releases/download/11.3/love-11.3-x86_64.AppImage +# https://github.com/love2d/love/releases/download/11.2/love-11.2-x86_64.AppImage +# https://github.com/love2d/love/releases/download/11.1/love-11.1-linux-x86_64.AppImage +LOVE_AppImage_URL=https://github.com/love2d/love/releases/download/${VERSION}/love-${VERSION}-${ARCH}.AppImage +if [ $VERSION == "11.1" ] +then + LOVE_AppImage_URL=https://github.com/love2d/love/releases/download/${VERSION}/love-${VERSION}-linux-${ARCH}.AppImage +fi CACHE_DIR=${HOME}/.cache/love-release/love -LOVE_TAR=$CACHE_DIR/love-${VERSION}-${ARCH}.tar.gz +LOVE_AppImage=$CACHE_DIR/love-${VERSION}-${ARCH}.AppImage if ! test -d ${CACHE_DIR}; then mkdir -p ${CACHE_DIR} fi -if ! test -f ${LOVE_TAR}; then - curl -L -C - -o ${LOVE_TAR} ${LOVE_TAR_URL} +if ! test -f ${LOVE_AppImage}; then + curl -L -C - -o ${LOVE_AppImage} ${LOVE_AppImage_URL} + chmod +x ${LOVE_AppImage} fi -if ! test -f ${LOVE_TAR}; then - echo "No tarball found for $VERSION in $LOVE_TAR" +if ! test -f ${LOVE_AppImage}; then + echo "No tarball found for $VERSION in $LOVE_AppImage" exit 1 fi @@ -42,20 +52,16 @@ download_if_needed() { } main() { - download_if_needed appimagetool-${ARCH}.AppImage - download_if_needed AppRun-${ARCH} - + download_if_needed appimagetool-${ARCH}.AppImage # Extract the tarball build into a folder rm -rf love-prepared mkdir -p love-prepared - tar -xf ${LOVE_TAR} -C love-prepared --strip-components=1 - cd love-prepared - + $LOVE_AppImage --appimage-extract 1> /dev/null + mv squashfs-root/* . + rm squashfs-root/.DirIcon + rmdir squashfs-root # Add our small wrapper script (yay, more wrappers), and AppRun - cp ../wrapper usr/bin/wrapper-love - cp ../AppRun-${ARCH} AppRun - local desktopfile="love.desktop" local icon="love" local target="love-${VERSION}" @@ -69,16 +75,23 @@ main() { cp ../../game.svg . fi if test -f ${LOVEFILE}; then + if [ $VERSION == "11.4" ] + then + dir="bin" + else + dir="usr/bin" + fi target="game" - cat usr/bin/love ${LOVEFILE} > usr/bin/love-fused - mv usr/bin/love-fused usr/bin/love - chmod +x usr/bin/love + cat $dir/love ${LOVEFILE} > $dir/love-fused + mv $dir/love-fused $dir/love + chmod +x $dir/love else echo "Love file ${LOVEFILE} not found" fi # Add our desktop file - sed -e 's/%BINARY%/wrapper-love/' -e "s/%ICON%/${icon}/" "${desktopfile}.in" > "$desktopfile" + mv ${desktopfile} ${desktopfile}.in + sed -e "s/%ICON%/${icon}/" "${desktopfile}.in" > "$desktopfile" rm "${desktopfile}.in" # Add a DirIcon @@ -95,9 +108,11 @@ main() { # Now build the final AppImage cd .. + # ./love-prepared/AppRun -n love-prepared "${target}-${ARCH}.AppImage" # Work around missing FUSE/docker - ./appimagetool-${ARCH}.AppImage --appimage-extract - ./squashfs-root/AppRun -n love-prepared "${target}-${ARCH}.AppImage" + ./appimagetool-${ARCH}.AppImage --appimage-extract 1> /dev/null + ./squashfs-root/AppRun -n love-prepared "${target}-${ARCH}.AppImage" 1> /dev/null + rm -rf love-prepared/ } main "$@" diff --git a/buildtools/appimage/love-prepared/.DirIcon b/buildtools/appimage/love-prepared/.DirIcon deleted file mode 100644 index 552ad17..0000000 --- a/buildtools/appimage/love-prepared/.DirIcon +++ /dev/null @@ -1,962 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/buildtools/appimage/wrapper b/buildtools/appimage/wrapper deleted file mode 100755 index 2a634c1..0000000 --- a/buildtools/appimage/wrapper +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -# For some reason this runs from the usr subdirectory -exec ../love "$@" diff --git a/makefile b/makefile index 469b6a8..1dc857e 100644 --- a/makefile +++ b/makefile @@ -5,7 +5,6 @@ ITCH_ACCOUNT=change-me-too URL=https://gitlab.com/alexjgriffith/min-love2d-fennel AUTHOR="Your Name" DESCRIPTION="Minimal setup for trying out Phil Hagelberg's fennel/love game design process." - LIBS := $(wildcard lib/*) LUA := $(wildcard *.lua) SRC := $(wildcard *.fnl)