How I can build local sources and dependancies with flatpak-builder?
I can build local sources
flatpak build ../dictionary ./configure --prefix=/app
I can extract and build application with dependancies with a .json
flatpak-builder --repo=repo dictionary2 org.gnome.Dictionary.json
But no way to build dependancies and local sources? I don't find sources type like dir or other, only archive, git (no hg?) ...
flatpak-builderis 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 withfile://.(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:filewhich point to a local file to copy somewhere in the extracted sources;patchwhich point to a local patch file to apply to the extracted sources;scriptwhich creates a script in the extracted sources, from an array of commands;shellwhich modifies the extracted sources by running an array of commands;Adding a
dirsource 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-buildertries very hard to enable.For example, when using a localfilesource,flatpak-builderwill base64-econde the content of that file and use it as adata: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
dirsource (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 newflatpak-builder --bundle-sourcesoption. This would probably make it easier to support reproducible builds with adirsource type.In any case, feel free to start the conversation around a new
dirsource type in the upstream bug tracker. :)