https://agateau.com/tags/flatpak/feedPosts tagged flatpak2022-02-20T00:10:52+01:00Aurélien Gâteaupython-feedgenhttps://agateau.com/2022/packaging-improvements-for-pixelwheelsPixel Wheels is now available on Flathub2022-02-20T00:10:52+01:00<h2>Introduction</h2>
<p>Writing games is a lot of fun, but it's even better when players can find your game, install it and play it.</p>
<p>This means it's part of the job to work on the game packaging and availability.</p>
<p>Pixel Wheels packaging and availability has improved over the years:</p>
<p>In version 0.16.0, Pixel Wheels got an <a href="https://agateau.itch.io/pixelwheels">itch.io page</a>:</p>
<p><img alt="Pixel Wheels in itch.io app" src="https://agateau.com/2022/packaging-improvements-for-pixelwheels/pw-itchio.png"/></p>
<p>Since version 0.19.1, the game no longer requires installing a JRE: it ships as a standalone executable with a bundled, trimmed-down version of the JRE, thanks to <a href="https://github.com/libgdx/packr">Packr</a>.</p>
<p>And now the latest version, 0.22.0, is available on <a href="https://flathub.org/apps/details/com.agateau.PixelWheels">Flathub</a> 🎉!</p>
<p><a href="https://flathub.org/apps/details/com.agateau.PixelWheels"><img alt="Pixel Wheels on Flathub" src="https://agateau.com/2022/packaging-improvements-for-pixelwheels/pw-flathub.png"/></a></p>
<p>This is great because it makes the game easier to discover, and it makes it simpler for players to update to the latest version.</p>
<!-- break -->
<h2>Freedesktop integration</h2>
<p>(Note: with "freedesktop integration" I mean integration in desktop environment like KDE, GNOME, XFCE, LXDE...)</p>
<p>While setting up the Flatpak package, I realized it's not easy to properly "install" Pixel Wheels. By properly installing I mean having the game in your PATH and having an entry for it in your desktop launcher, with a correct icon.</p>
<p>To build the Flatpak package I had to create all the required files for a proper freedesktop installation. For version 0.22.0, these files are in <a href="https://github.com/flathub/com.agateau.PixelWheels">Pixel Wheels Flathub repository</a>, but the Flathub people rightfully recommend upstreaming any changes made, so I copied these files to Pixel Wheels repository. Once they were there I made the zip creation script include them in the Linux zip file, together with an <a href="https://github.com/agateau/pixelwheels/blob/712dca2131d50eb8eb7bcfe2d1e04b8a71f64535/tools/packaging/linux/install.sh"><code>install.sh</code></a> script.</p>
<p>This <code>install.sh</code> scripts does the following:</p>
<ul>
<li>Install the game files and its reduced JRE in <code>$install_dir/lib/pixelwheels</code></li>
<li>Install a <code>pixelwheels</code> symbolic link in <code>$install_dir/bin</code></li>
<li>Install the icons, .desktop file and appstream file in <code>$install_dir/share</code></li>
</ul>
<p>After running this script, the player is able to start the game from their desktop launcher, just like any other application. It's not required though: the game still runs fine when started from the unpacked zip.</p>
<h2>Native packages?</h2>
<p>Flatpak is nice, but having native distribution packages would be great, too, as they tend to be much lighter.</p>
<p>Once I had the necessary files for installation on freedesktop environments, I added another way to install the game: the classic <code>make install</code>. This is interesting for players who build the game themselves, but I hope it also helps with building native packages. If you are a packager and wants to build a package for Pixel Wheels, I would love to hear from you!</p>
<h2>Next packaging and availability improvements?</h2>
<p>Besides native packages, I should probably look into improving the story on Windows and macOS. Especially on Windows, where the .exe does not have an icon and I am pretty sure many users would prefer downloading an installer instead of a .zip file. It's not the most fun work in the world though, so I need to find the motivation to look into that :)</p>
<p>Ideally I would also like to have the game on Steam, but a) it costs $100 per game and b) it looks like a ton of work, so I don't plan to dive into that for now.</p>2022-02-20T00:10:52+01:00