Add snap builder

This commit is contained in:
Bart van Strien 2016-12-02 15:31:44 +00:00
parent 5d4d8821bb
commit 8eba729ddf
3 changed files with 76 additions and 0 deletions

35
snap/build.sh Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash
set -eo >/dev/null
if [[ $# -lt 1 ]]; then
echo "Usage: $0 <version>"
exit 0
fi
VERSION="$1"
if ! test -f ../tarball/love-${VERSION}-amd64.tar.gz; then
echo "No tarball found for $VERSION"
exit 1
fi
# Extract the tarball build into a folder
rm -rf love-prepared
mkdir love-prepared
tar xf ../tarball/love-${VERSION}-amd64.tar.gz -C love-prepared --strip-components=1
cd love-prepared
# Now add snap stuff
# First, our icon and desktop file
mkdir -p meta/gui
mv love.svg meta/gui/icon.svg
sed -e 's/%BINPREFIX%//' -e '/%ICONPREFIX%/d' love.desktop.in > meta/gui/love.desktop
rm love.desktop.in
# Now the yaml and launcher
sed -e "s/%VERSION%/$VERSION/" ../snap.yaml > meta/snap.yaml
cp ../command-love.wrapper .
# Finally, build it!
mksquashfs . ../love_${VERSION}_amd64.snap -noappend

6
snap/command-love.wrapper Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
export PATH="$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/x86_64-linux-gnu:$SNAP/usr/lib/x86_64-linux-gnu"
export LD_LIBRARY_PATH="$SNAP/usr/lib:$SNAP/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH"
export XDG_DATA_HOME="$SNAP_USER_COMMON"
exec "$SNAP/love" "$@"

35
snap/snap.yaml Normal file
View File

@ -0,0 +1,35 @@
name: love
version: "%VERSION%"
architectures:
- amd64
summary: The unquestionably awesome 2D game engine
description: |
LÖVE was created to be a user-friendly engine in which simple (or
complicated) games could be made without having extensive knowledge
of system or graphics functions and without having to dedicate time
towards developing the same engine features time and time again.
Developed with cross-platform implementation in mind, it utilizes the
latest open source libraries to deliver a similar game experience,
independent of operating system. By relying on the Lua scripting language
for game-specific programming, it allows even the novice game creator to
quickly and efficiently develop an idea into a fully working game.
confinement: devmode
grade: devel
apps:
love:
command: love
plugs:
- network
- network-bind
- opengl
- pulseaudio
- screen-inhibit-control
- x11
parts:
love:
plugin: dump
source: love-prepared/.