Commit af0b1c5e authored by Andrew Hayzen's avatar Andrew Hayzen

Add Flatpak json, appstream, desktop and icon

parent 380f906d
.app-dir
.flatpak-builder
.repo
# Pre-requisites
Install `flatpak`
```
sudo apt install flatpak
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
```
# Developing
Use the Godot editor to develop the application.
```
flatpak install flathub org.godotengine.Godot
```
# Flatpak
Building the flatpak requires the `flatpak-builder` freedesktop SDK, simply run the following commands.
```
sudo apt install flatpak-builder
flatpak install flathub org.freedesktop.Sdk//1.6
```
## Building
Simply run the following command, this will create a build in `.app-dir`
```
./build.sh
```
## Running
After building the app, use the following command to test the app launches.
```
./run.sh
```
## Updating repo
Use the following command to build a repo in `.repo`, then follow the instructions to install the flatpak.
```
./update_repo.sh
```
#!/bin/bash
flatpak-builder --ccache --force-clean .app-dir com.ahayzen.volleyball2d.json
<?xml version="1.0" encoding="utf-8"?>
<component type="desktop-application">
<id>com.ahayzen.volleyball2d</id>
<name>Volleyball 2D</name>
<summary>A basic 2d volleyball game using semi-circular characters, inspired by 'Slime Volleyball'</summary>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0+</project_license>
<developer_name>Andrew Hayzen</developer_name>
<url type="homepage">http://ahayzen.com/volleyball2d</url>
<url type="bugtracker">https://gitlab.com/ahayzen/volleyball2d/issues</url>
<description>
<p>A basic 2d volleyball game using semi-circular characters, inspired by 'Slime Volleyball' - it is written using Godot Engine.</p>
<p>The game has the follow modes</p>
<ul>
<li>First to five</li>
<li>Highest score (within two minutes)</li>
<li>Survival (highest score without losing a round)</li>
</ul>
</description>
<icon type="remote" height="256" width="256">https://gitlab.com/ahayzen/volleyball2d/raw/master/com.ahayzen.volleyball2d.png</icon>
<!--
<screenshots>
<screenshot>
<image type="source">http://path/to/screenshot.jpg</image>
</screenshot>
</screenshots>
-->
<releases>
<release version="0.5" date="2017-08-26">
<description>
<p>Initial working port to Godot Engine</p>
</description>
</release>
</releases>
<content_rating type="oars-1.1">
<content_attribute id="violence-cartoon">none</content_attribute>
<content_attribute id="violence-fantasy">none</content_attribute>
<content_attribute id="violence-realistic">none</content_attribute>
<content_attribute id="violence-bloodshed">none</content_attribute>
<content_attribute id="violence-sexual">none</content_attribute>
<content_attribute id="violence-desecration">none</content_attribute>
<content_attribute id="violence-slavery">none</content_attribute>
<content_attribute id="violence-worship">none</content_attribute>
<content_attribute id="drugs-alcohol">none</content_attribute>
<content_attribute id="drugs-narcotics">none</content_attribute>
<content_attribute id="drugs-tobacco">none</content_attribute>
<content_attribute id="sex-nudity">none</content_attribute>
<content_attribute id="sex-themes">none</content_attribute>
<content_attribute id="sex-homosexuality">none</content_attribute>
<content_attribute id="sex-prostitution">none</content_attribute>
<content_attribute id="sex-adultery">none</content_attribute>
<content_attribute id="sex-appearance">none</content_attribute>
<content_attribute id="language-profanity">none</content_attribute>
<content_attribute id="language-humor">none</content_attribute>
<content_attribute id="language-discrimination">none</content_attribute>
<content_attribute id="social-chat">none</content_attribute>
<content_attribute id="social-info">none</content_attribute>
<content_attribute id="social-audio">none</content_attribute>
<content_attribute id="social-location">none</content_attribute>
<content_attribute id="social-contacts">none</content_attribute>
<content_attribute id="money-purchasing">none</content_attribute>
<content_attribute id="money-gambling">none</content_attribute>
</content_rating>
</component>
[Desktop Entry]
Name=Volleyball 2D
Exec=com.ahayzen.volleyball2d
Icon=com.ahayzen.volleyball2d
StartupWMClass=Volleyball 2D
Terminal=false
Type=Application
Categories=Game;SportsGame;
Keywords=Volleyball;Ball;2D;Game;
{
"app-id": "com.ahayzen.volleyball2d",
"runtime": "org.freedesktop.Platform",
"runtime-version": "1.6",
"sdk": "org.freedesktop.Sdk",
"command": "com.ahayzen.volleyball2d",
"tags": [],
"finish-args": [
/* X11 + XShm access + GPU acceleration */
"--share=ipc",
"--socket=x11",
"--device=dri",
/* Sound access */
"--socket=pulseaudio"
],
"build-options" : {
"cflags": "-O2 -g",
"cxxflags": "-O2 -g",
"env": {
"V": "1"
}
},
"cleanup": [ "/include", "*.a", "*.la", "/lib/pkgconfig" ],
"modules": [
{
"name": "scons",
"buildsystem": "simple",
"cleanup": [ "*" ],
"sources": [
{
"type": "archive",
"url": "http://downloads.sourceforge.net/project/scons/scons/2.5.1/scons-2.5.1.tar.gz",
"sha256": "0b25218ae7b46a967db42f2a53721645b3d42874a65f9552ad16ce26d30f51f2"
}
],
"build-commands": [ "python setup.py install --prefix=/app" ]
},
{
"name": "glu",
"sources": [
{
"type": "archive",
"url": "https://mesa.freedesktop.org/archive/glu/glu-9.0.0.tar.bz2",
"sha256": "1f7ad0d379a722fcbd303aa5650c6d7d5544fde83196b42a73d1193568a4df12"
}
],
"cleanup": [ "/include", "/lib/*.a", "/lib/*.la", "/lib/pkgconfig" ]
},
{
"name": "godot-tools",
"buildsystem": "simple",
"sources": [
{
"type": "archive",
"url": "https://github.com/godotengine/godot/archive/2.1.4-stable.tar.gz",
"sha256": "07cf3b01367d5ea53805f144bc60711bd79efb53f1f88d57d6a706e6944de8d7"
}
],
"build-commands": [
"scons platform=x11 unix_global_settings_path=/app use_llvm=yes CCFLAGS=-I/app/include verbose=yes builtin_freetype=no builtin_libmpcdec=yes builtin_libogg=no builtin_libpng=no builtin_libtheora=no builtin_libvorbis=no builtin_libwebp=no builtin_openssl=no builtin_opus=yes builtin_speex=yes builtin_squish=yes builtin_zlib=no pulseaudio=yes udev=no prefix=/app -j `nproc` target=release_debug tools=yes",
"install -D -m755 bin/godot.x11.opt.tools.*.llvm /app/bin/godot-bin"
]
},
{
"name": "volleyball2d",
"buildsystem": "simple",
"sources": [
{
"type": "git",
"url": "https://gitlab.com/ahayzen/volleyball2d.git"
}
],
"build-commands": [
/* use source instead of export for now */
"cp -R . /app/volleyball2d-src"
]
},
{
"name": "integration",
"buildsystem": "simple",
"sources": [
{
"type": "file",
"path": "com.ahayzen.volleyball2d.desktop"
},
{
"type": "file",
"path": "com.ahayzen.volleyball2d.png"
},
{
"type": "file",
"path": "com.ahayzen.volleyball2d.appdata.xml"
},
{
"type": "script",
"dest-filename": "com.ahayzen.volleyball2d.sh",
"commands": [
"export APPDATA=$XDG_DATA_HOME",
"cd /app/volleyball2d-src",
"/app/bin/godot-bin $@"
]
}
],
"build-commands": [
"install -Dm644 com.ahayzen.volleyball2d.desktop /app/share/applications/com.ahayzen.volleyball2d.desktop",
"install -Dm644 com.ahayzen.volleyball2d.png /app/share/icons/hicolor/64x64/apps/com.ahayzen.volleyball2d.png",
"install -Dm644 com.ahayzen.volleyball2d.appdata.xml /app/share/appdata/com.ahayzen.volleyball2d.appdata.xml",
"install -Dm755 com.ahayzen.volleyball2d.sh /app/bin/com.ahayzen.volleyball2d"
]
}
]
}
#!/bin/bash
flatpak-builder --run .app-dir com.ahayzen.volleyball2d.json /app/bin/com.ahayzen.volleyball2d
#!/bin/bash
flatpak-builder --repo=.repo --ccache --force-clean .app-dir com.ahayzen.volleyball2d.json
echo "
# Please add the repository and install the flatpak
flatpak --user remote-add --no-gpg-verify volleyball2d-local-nightly $PWD/.repo
flatpak --user install volleyball2d-local-nightly com.ahayzen.volleyball2d
# If already installed simply run
flatpak update
# Run the app
flatpak run com.ahayzen.volleyball2d
"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment