Add flatpak script

This commit is contained in:
Bart van Strien 2016-12-03 13:57:47 +01:00
parent 1ad885890b
commit 101e52ad66
5 changed files with 80 additions and 0 deletions

View file

@ -4,3 +4,6 @@
^appimage/love-prepared/
^appimage/.*\.AppImage$
^appimage/AppRun$
^flatpak/repo/
^flatpak/files/
^flatpak/export/

View file

@ -28,6 +28,15 @@ driver issue, possibly related to Arch Linux. Let me know if it works for you!
[AppImageKit][], though you can build them yourself if you want to. And hey,
this actually seems to work, too!
## flatpak ##
`flatpak` is used to build [flatpak][] "packages". It requires the flatpak
command line tool. Of course flatpak has some kind of repo system, so you can't
easily distribute a flatpak file. Useful.
NOTE: Once again driver issues (blame nvidia) prevent me from testing this
myself. If you get it working, let me know!
[snap]: http://snapcraft.io/
[AppImage]: http://appimage.org/
[AppImageKit]: https://github.com/probonopd/AppImageKit
[flatpak]: http://flatpak.org/

46
flatpak/build.sh Executable file
View file

@ -0,0 +1,46 @@
#!/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
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
tar xf ../tarball/love-${VERSION}-amd64.tar.gz -C files --strip-components=1
cd files
# Add our small wrapper script (yay, more wrappers)
mkdir -p bin
cp ../wrapper bin/wrapper
# Add our desktop file
sed -e 's/%BINPREFIX%love/wrapper/' -e 's/%ICONPREFIX%/org.love2d./' love.desktop.in > ../export/org.love2d.love.desktop
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}
flatpak build-bundle repo love-${VERSION}-x86_64.flatpak org.love2d.love

18
flatpak/metadata Normal file
View file

@ -0,0 +1,18 @@
[Application]
name=org.love2d.love
runtime=org.freedesktop.Platform/x86_64/1.4
sdk=org.freedesktop.Sdk/x86_64/1.4
command=wrapper
[Context]
shared=network;
sockets=x11;pulseaudio;session-bus;
filesystem=xdg-data;
device=dri;
[Session Bus Policy]
org.freedesktop.ScreenSaver=talk
[Extension org.freedesktop.Platform.GL]
version=1.2
directory=lib/GL

4
flatpak/wrapper Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
export LD_LIBRARY_PATH=/app/lib/GL
exec /app/love "$@"