flatpak-builder
is meant to automate the whole build process, with a single entry-point: the JSON manifest.
Everything else it obtains from Git, Bazaar or tarballs. Note that for these the "url"
property may be a local URL starting with file://
.
(There is indeed no support for Hg. If that's important for you, feel free to request it.)
In addition to that, there are a few more source types (see the flatpak-manifest(5)
manpage), which can be used to modify the extracted sources:
file
which point to a local file to copy somewhere in the extracted sources;
patch
which point to a local patch file to apply to the extracted sources;
script
which creates a script in the extracted sources, from an array of commands;
shell
which modifies the extracted sources by running an array of commands;
Adding a dir
source type might be useful.
However (and I only flatpaked a few apps, and contributed 2 or 3 patches to the code, so I might be completely wrong) care must be taken as this would easily make builds completely unreproducible, which is one thing flatpak-builder
tries very hard to enable.
For example, when using a local file
source, flatpak-builder
will base64-econde the content of that file and use it as a data:text/plain;charset=utf8;base64,<content>
URL for the file which it stores in the manifest included inside the final build.
Something similar might be needed for a dir
source (tar the folder then base64-encode the content of the tar?), otherwise it would be impossible to reproduce the build. I've just been told (after submitting this answer) that this changed in Git master, in favour of a new flatpak-builder --bundle-sources
option. This would probably make it easier to support reproducible builds with a dir
source type.
In any case, feel free to start the conversation around a new dir
source type in the upstream bug tracker. :)