Building the Flatpak Yourself¶
For Advanced Users Only
This is for advanced users who are comfortable going through the build process themselves, such as those who want to build on top of the changes I have made. For regular users, please install using the Installation Section.
Prerequisites¶
-
A linux operating system (can of course use a VM via VMWare, virtual box, WSL2, etc.)
-
The following packages (install instructions separated by Linux distribution below):
-
gpg
-
curl
-
flatpak
-
flatpak-builder
sudo apt update && sudo apt install -y gnupg curl flatpak flatpak-builder
sudo yum update && sudo yum install -y gnupg curl flatpak flatpak-builder
sudo pacman -Syy && sudo pacman -S gnupg curl flatpak flatpak-builder
Note
Steam OS is a read-only filesystem so you will need to temporarily disable this to install flatpak-builder. Additionally, keep in mind that your installed packages may get wiped during a system update and need to be reinstalled following this process again in the future.
-
Disable read-only mode
sudo steamos-readonly disable
-
Init keyring
sudo pacman-key --init
-
Populate keyring with Arch Linux keys
sudo pacman-key --populate archlinux
-
Populate keyring with Holo keys
sudo pacman-key --populate holo
-
Install dependencies
sudo pacman -Syy && sudo pacman -S flatpak-builder
-
Re-enable read-only mode
sudo steamos-readonly enable
-
-
Flathub, the default flatpak repository
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Building the Flatpak¶
Get Flatpak Dependencies¶
-
Install the necessary flatpak runtime, associated sdk, and base app.
flatpak install -y flathub org.kde.Platform//6.8 flathub org.kde.Sdk//6.8
-
Create a directory for your build files and switch into it
mkdir -p ~/build-chiaki-ng-flatpak && cd ~/build-chiaki-ng-flatpak
-
Get the flatpak manifest file for
chiaki-ng
curl -Lo chiaki-ng.yaml https://raw.githubusercontent.com/streetpea/chiaki-ng/main/scripts/flatpak/chiaki4deck.yaml
-
Get the patch files
-
0001-Vulkan-Don-t-try-to-reuse-old-swapchain.patch
curl -LO https://raw.githubusercontent.com/streetpea/chiaki-ng/main/scripts/flatpak/0001-Vulkan-Don-t-try-to-reuse-old-swapchain.patch
-
0001-vulkan-ignore-frames-without-hw-context.patch
curl -LO https://raw.githubusercontent.com/streetpea/chiaki-ng/main/scripts/flatpak/0001-vulkan-ignore-frames-without-hw-context.patch
-
Create gpg
Key for Signing your Builds and Repositories¶
-
Create the gpg key pair
gpg --quick-gen-key chiaki-ng-diy
-
Export public key (private key stays on your machine in your gpg directory) [~/.gnupg by default].
gpg --export chiaki-ng-diy > chiaki-ng-diy.gpg
Create Flatpak¶
-
Build the flatpak for
chiaki-ng
flatpak-builder --repo=chiaki-ng-diy --force-clean build chiaki-ng.yaml --gpg-sign chiaki-ng-diy
How long will this take?
This build process is compiling first the dependencies and then Chiaki itself with the updates included in
chiaki-ng
. This will take a long while (read: 15+ minutes depending on the resources of the build system itself) the first time it runs. However, since flatpak caches builds, if you make changes to just thechiaki-ng
repo code and then run a new build, it will import the dependencies from cache and only start building from scratch when it detects the first change in the stack. This results in subsequent builds going much faster than the first build you make. -
Update static deltas (makes upgrading require less downloaded data for end-users)
flatpak build-update-repo chiaki-ng-diy --generate-static-deltas --gpg-sign=chiaki-ng-diy
Adding your Own Remote and Installing from It¶
-
Add the repository you built as a local remote repository
flatpak --user remote-add --gpg-import chiaki-ng-diy.gpg chiaki-ng-diy ~/build-chiaki-ng-flatpak/chiaki-ng-diy
-
Install your self-built
chiaki-ng
flatpak from your new remoteflatpak --user install chiaki-ng-diy io.github.streetpea.Chiaki4deck