2016-12-03 12:57:47 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -eo >/dev/null
|
|
|
|
|
2017-09-06 16:01:36 +00:00
|
|
|
ARCH="$(uname -m)"
|
|
|
|
|
2016-12-03 12:57:47 +00:00
|
|
|
if [[ $# -lt 1 ]]; then
|
|
|
|
echo "Usage: $0 <version>"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
VERSION="$1"
|
2017-09-06 16:01:36 +00:00
|
|
|
if ! test -f ../tarball/love-${VERSION}-${ARCH}.tar.gz; then
|
2016-12-03 12:57:47 +00:00
|
|
|
echo "No tarball found for $VERSION"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! which flatpak >/dev/null; then
|
|
|
|
echo "Please install flatpak and try again"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Extract the tarball build into a folder
|
|
|
|
rm -rf files
|
|
|
|
mkdir files
|
2017-09-06 16:01:36 +00:00
|
|
|
tar xf ../tarball/love-${VERSION}-${ARCH}.tar.gz -C files --strip-components=1
|
2016-12-03 12:57:47 +00:00
|
|
|
|
|
|
|
cd files
|
|
|
|
|
|
|
|
# Add our small wrapper script (yay, more wrappers)
|
|
|
|
mkdir -p bin
|
|
|
|
cp ../wrapper bin/wrapper
|
|
|
|
|
2017-09-07 13:22:55 +00:00
|
|
|
mkdir -p ../export
|
|
|
|
|
2016-12-03 12:57:47 +00:00
|
|
|
# Add our desktop file
|
2017-09-07 13:22:55 +00:00
|
|
|
sed -e 's/%BINARY%/wrapper/' -e 's/%ICON%/org.love2d.love/' love.desktop.in > ../export/org.love2d.love.desktop
|
2016-12-03 12:57:47 +00:00
|
|
|
rm love.desktop.in
|
|
|
|
|
|
|
|
# "Install" the icon
|
|
|
|
mv love.svg ../export/org.love2d.love.svg
|
|
|
|
|
|
|
|
# Make sure app/lib/GL exists, for the extension mount point
|
|
|
|
mkdir -p lib/GL
|
|
|
|
|
|
|
|
# Now build the final AppImage
|
|
|
|
cd ..
|
|
|
|
#rm -rf repo
|
|
|
|
flatpak build-export repo . ${VERSION}
|
2017-09-06 16:01:36 +00:00
|
|
|
flatpak build-bundle repo love-${VERSION}-${ARCH}.flatpak org.love2d.love $VERSION
|