Develop an App with a Flatpak Manifest
This workflow is used for developing or testing changes to an app with a Flatpak manifest using flatpak-builder.
One-time setup
Create a local user-level remote named “flathub-apps-built-locally” to hold your built-from-source Flatpak apps:
flatpak remote-add --user --if-not-exists flathub-apps-built-locally https://flathub.org/repo/flathub.flatpakrepo
Create a folder to hold source code. This is skippable if it already exists:
mkdir -p ~/kde/src/
Use
Go into the folder where you store source code:
cd ~/kde/src/
Check out the source code of the app you’d like to build. For example, KDE’s Filelight disk space analyzer app:
git clone git@invent.kde.org:utilities/filelight.git
Go into the newly-checked-out git repo for the app:
cd ~/kde/src/filelight
Now make changes, check out a branch to test, etc.
Then build a Flatpak version of the app:
flatpak-builder build --user --install-deps-from=flathub-apps-built-locally --force-clean --ccache --install .flatpak-manifest.json
At this point, flatpak-builder has created a Flatpak repo named filelight-origin and exported the freshly built Filelight Flatpak to this repo.
Now run it:
org.kde.filelight
More information
- https://docs.flatpak.org/en/latest/getting-started.html
- https://develop.kde.org/docs/packaging/flatpak/packaging/
Article contributed by Nate Graham under the CC-BY-4.0 license.