Gå till innehåll

Utveckla ett program med ett Flatpak-manifest

Arbetsflödet används för att utveckla eller testa ändringar i ett program med ett Flatpak-manifest med hjälp av flatpak-builder.

One-time setup

Skapa en lokal fjärresurs på användarnivå med namnet "flathub-apps-built-locally" för att lagra Flatpak-program byggda med källkod:

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/

Användning

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.

Kör det nu:

org.kde.filelight

Mer information


Artikel bidragen av med licens CC-BY-4.0.