Utilities to convert various kinds of native binaries into flatpaks.
Project description
flatpaker
Script to mostly automate creating flatpaks from published Ren'Py and Linux builds of RPGMaker MV and MZ. Open to additional support
What is it?
It's a script that automatically handles much of the task of generating a flatpak for pre-built projects, including adding patches or mods. You write a small, simple toml file, fetch the sources, and get a ready to publish flatpak.
It currently does the following automatically:
- Generates an appstream xml file
- Generates a .desktop file
- Extracts an icon from the game source, and installs it
- patches the game to honor
$XDG_DATA_HOMEfor storing game data inside the sandbox (instead of needing$HOMEaccess) - allows local install or publishing to a repo
- allows generating static deltas after building
- sets up the sandbox to allow audio and display, but nothing else
For Ren'Py:
- provides a runtime with up to date renpy and deps, built against the freedesktop Platform libraries. using the shared runtime saves space, as well as ensures that all games can be run with Wayland support.
- strips .rpy files to save space (keeping the rpyc files)
For RPG Maker:
- provides a runtime with a newer nwjs installed, saving disk space
- using this nwjs also gives guaranteed wayland support
- It also allows running MV and MZ games that don't ship Linux builds, using the Windows build
Why?
I like playing Ren'Py and RPG Maker games sometimes. I also don't always trust random pre-compiled binaries from the internet. Flatpak provides a nice, convenient way to sandbox applications. It also makes supporting Steam Deck and Fedora immutable a breeze. But generating flatpaks by hand is a lot of work, especially when most of the process will be exactly the same for every project. The use of up-to-date runtimes saves more disk space and allows for the sandbox to provide even better security by using Wayland instead of X11 (or XWayland).
How do I use it?
- Download the compressed project
- Download any mods or addons (optional)
- Write a toml description
- run
flatpaker --install install-runtimes(which adds the runtimes and sdks) - run
flatpaker --install build *.tomlorflatpaker --export --gpg-sign build *.toml(for local install or for export to a shared repo)
Toml Format
[common]
name = 'Game or VN' # use properly formatted name like "The Cool Adventures of Bob", or "Bob's Quest 7: Lawnmower Confusion"
reverse_url = 'com.example.JDoe' # name will be appended
# "Game" is added automatically
# used freedesktop menu categories. see: https://specifications.freedesktop.org/menu-spec/latest/apas02.html
categories = ['Simulation']
engine = 'renpy8' # Or 'rpgmaker', 'renpy7', 'renpy7-py3'
[appdata]
summary = "A short summary, one sentence or so."
description = """
A longer description.
probably on multiple \
lines
"""
# This is an optional value for the license of the renpy project itself.
# If unset it defaults to LicenseRef-Proprietary.
# if you have specific terms which are not an Open Source license, you can use the form:
# LicenseRef-Proprietary=https://www.example.com/my-license
# See: https://spdx.org/specifications for more information
license = "SPDX identifier"
[appdata.content_rating]
# optional
# Uses OARS specifications. See: https://hughsie.github.io/oars/
# keys should be ids, and the values are must be a rating (as a string):
# none, mild, moderate, or intense
language-profanity = "mild"
[appdata.releases]
# optional
# in the form "date = version"
"2023-01-01" = "1.0.0"
# Optional, alternatively may be passed on teh command line
[[sources.archives]]
# path must be set if this is provided
path = "relative to toml or absolute path"
# Optional, defaults to 1. How many directory levels to remove from this component
strip_comonents = 2
# Optional, will be automatically calculated if not provided, but providing it can speed up building
sha256 = "abcd..."
# Optional, cannot be set from command line
[[sources.patches]]
# path must be set if this is provided
path = "relative to toml or absolute path"
# Optional, defaults to 1. How many directory levels to remove from this component
strip_comonents = 2
# Optional, cannot be set from command line
[[sources.files]]
# path must be set if this is provided
path = "relative to toml or absolute path"
# Optional, if set the file will be installed to this name
# Does not have to be set for .rpy files that go in the game root directory
dest = "where to install"
# Optional, will be automatically calculated if not provided, but providing it can speed up building
sha256 = "abcd..."
Additionally, some games have quirks that make them difficult to package. Some of these quirks can be worked around:
[quirks]
# For Ren'Py only:
# Force the use of the window_gui.png as the icon, instead of extracting from
# the .exe of icns. This is useful for games that have the generic Ren'Py
# icon in the exe, but a custom icon in the tree.
force_window_gui_icon = true
Any quirk starting with x_ or x- is an experimental quirk, and may be
removed at any time. If you find yourself relying on them, please open an issue.
Configuration
Some options can be given on the command line or via a configuration file.
That file must be written to $XDG_CONFIG_HOME/flatpaker/config.toml (if unset
$XDG_CONFIG_HOME defaults to ~/.config).
[common]
# A gpg private key to sign with, overwritten by the --gpg option
gpg-key = "0x123456789"
# The absolute path to a repo to write to. overwritten by the --repo option
repo = "/path/to/a/repo/to/export"
What is required?
- python 3.11 or a modern version of python3 with tomli
- flatpak-builder
Schema
A Json based schema is provided, which can be used with VSCode's EvenBetterToml extension. It may be useful elsewhere.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flatpaker-0.0.8.tar.gz.
File metadata
- Download URL: flatpaker-0.0.8.tar.gz
- Upload date:
- Size: 25.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d874d12c76c50ccebcb64a2df2bdfad2f51e2b00719fea74c9d346d79df00c06
|
|
| MD5 |
e565a235e017b05d114c295ffd4d896f
|
|
| BLAKE2b-256 |
25f05f1efb8c5f8151f7347077e2c98eb52526328077b827d832e44e0e395038
|
File details
Details for the file flatpaker-0.0.8-py3-none-any.whl.
File metadata
- Download URL: flatpaker-0.0.8-py3-none-any.whl
- Upload date:
- Size: 31.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e2cb1e02697f5e235c415308ba9e7bb7be1036298a23f2785078fcc683f6b7c
|
|
| MD5 |
9f7ae89c61cd50bf3db51244f3ed4399
|
|
| BLAKE2b-256 |
011954bb2ce6bf8c1d56e21b8d7f1b8c76a5450de3e1518446389a53d92aa4ab
|