pygame flatpak test
1.0.0
flatpak包装
Flatpak是Linux(开发人员文档)的沙盒应用程序包装系统。 Pygame是制作游戏的框架。
我专注于将flatpak-builder与JSON清单一起使用,而不是我去年开始的Python工具。必须以这种方式构建在Flathub上托管的应用程序。
感兴趣的主要文件是:
org.pygame.baseapp.jsonorg.pygame.baseapp-py35.jsonorg.pygame.aliens.json这是为Pygame游戏制作FlatPak包装的实验工具。使用它:
您将需要安装flatpak> = 0.8的Linux系统,例如Fedora 25或Ubuntu 17.10。
使用pip install pygame_fpak安装。即使您的游戏使用Python 2,该工具也需要Python 3运行。
创建一个pygame-fpak.toml配置文件,因此:
# At the moment, you can specify "3.6", "3.4" or "2.7".
# 3.6 produces a somewhat bigger app to download.
python = " 3.6 "
# User-visible name
name = " Solarwolf "
# Identifier based on a reverse domain name you control. E.g. if your
# project is on Github, you could use io.github.username.reponame
appid = " org.pygame.solarwolf "
# Files/directories needed to run the game - relative paths from where
# the config file lives.
files = [
" solarwolf "
]
# The function to start your game. This will be called like:
# from solarwolf.cli import main; main()
entry-point = " solarwolf.cli:main "
# Icons in different sizes. Icons should be square, sizes are pixels
# along one side of a square. 32, 48 and 64 are common.
[ icons ]
64 = " dist/solarwolf.png "运行python3 -m pygame_fpak pygame-fpak.toml 。
此存储库中的其他代码为上述工具构建了基本应用程序。构建和安装它们:
# Slow, but only needed once:
make install-runtime
# Build the base applications and install them:
make install-baseapp-py36.done
make install-baseapp-py34.done
make install-baseapp-py27.done基本应用程序有三种变体:
-py36包括Python 3.6 AS /app/bin/python3 。这是大约30个MIB,安装时140个MIB。默认情况下,外星人示例是基于此构建的。-py34使用Python 3.4,该3.4由Freedesktop.org运行时提供。这使其更小 - 下载约7个MIB,安装了40个MIB-但您无法使用代码中最新的Python功能。py27使用Python 2.7。它的大小与Python 3.4基本应用程序相似。Flatpak应用程序使用运行时,一捆通用库和可执行文件。如果您的应用程序是第一个使用给定运行时安装的用户,则Flatpak也将下载运行时。希望大多数应用程序都可以共享几个运行时,因此安装快速又简单。