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也將下載運行時。希望大多數應用程序都可以共享幾個運行時,因此安裝快速又簡單。