table of contents
- stretch 0.8.9-0+deb9u3
- testing 1.0.5-1
- stretch-backports 1.0.5-1~bpo9+1
- unstable 1.0.5-1
- experimental 1.0.8-1
FLATPAK-BUILDER(1) | flatpak builder | FLATPAK-BUILDER(1) |
NAME¶
flatpak-builder - Help build application dependenciesSYNOPSIS¶
flatpak-builder [OPTION...] DIRECTORY MANIFEST
flatpak-builder --run [OPTION...] DIRECTORY MANIFEST COMMAND
flatpak-builder --show-deps [OPTION...] MANIFEST
DESCRIPTION¶
flatpak-builder is a wrapper around the flatpak build command that automates the building of applications and their dependencies. It is one option you can use to build applications.The goal of flatpak-builder is to push as much knowledge about how to build modules to the individual upstream projects. It does this by assuming that the modules adhere to the Build API specified at https://github.com/cgwalters/build-api. This essentially means that it follows the ./configure && make && make install scheme with an optional autogen script. If the upstream does not adhere to the API you can make it do so by adding patches and extra files.
An invocation of flatpak-builder proceeds in these stages, each being specified in detail in json format in MANIFEST:
After this you will end up with a build of the application in DIRECTORY, which you can export to a repository with the flatpak build-export command. If you use the --repo option, flatpack-builder will do the export for you at the end of the build process. When flatpak-builder does the export, it also stores the manifest that was used for the build in /app/manifest.json. The manifest is 'resolved', i.e. git branch names are replaced by the actual commit IDs that were used in the build.
At each of the above steps flatpak caches the result, and if you build the same file again, it will start at the first step where something changes. For instance the first version controlled source that had new commits added, or the first module where some changes to the MANIFEST file caused the build environment to change. This makes flatpak-builder very efficient for incremental builds.
MANIFEST FORMAT¶
Toplevel¶
The top level of the json file describes global attributes of the application, how it can be built, and the list of modules that need to be built.These are the properties that are accepted:
id or app-id (string)
branch (string)
runtime (string)
runtime-version (string)
sdk (string)
var (string)
metadata (string)
command (string)
build-runtime (boolean)
separate-locales (boolean)
id-platform (string)
metadata-platform (string)
writable-sdk (boolean)
appstream-compose (boolean)
sdk-extensions (array of strings)
platform-extensions (array of strings)
base (string)
base-version (string)
base-extensions (array of strings)
tags (array of strings)
build-options (object)
modules (array of objects or string)
cleanup (array of strings)
cleanup-commands (array of strings)
cleanup-platform (array of strings)
finish-args (array of strings)
rename-desktop-file (string)
rename-appdata-file (string)
rename-icon (string)
copy-icon (boolean)
desktop-file-name-prefix (string)
desktop-file-name-suffix (string)
Build Options¶
Build options specify the build environment of a module, and can be specified globally as well as per-module. Options can also be specified on a per-architecture basis using the arch property.These are the properties that are accepted:
cflags (string)
cxxflags (string)
prefix (string)
env (object)
build-args (array of strings)
config-opts (array of strings)
strip (boolean)
no-debuginfo (boolean)
arch (object)
Module¶
Each module specifies a source that has to be separately built and installed. It contains the build options and a list of sources to download and extract before building.Modules can be nested, in order to turn related modules on and off with a single key.
These are the properties that are accepted:
name (string)
disabled (boolean)
sources (array of objects)
config-opts (array of strings)
make-args (array of strings)
make-install-args (array of strings)
rm-configure (boolean)
no-autogen (boolean)
no-parallel-make (boolean)
no-python-timestamp-fix (boolean)
cmake (boolean)
buildsystem (string)
builddir (boolean)
subdir (string)
build-options (object)
post-install (array of strings)
cleanup (array of strings)
cleanup-platform (array of strings)
modules (array of objects or strings)
Sources¶
These contain a pointer to the source that will be extracted into the source directory before the build starts. They can be of several types, distinguished by the type property.Archive sources (tar, zip)
type
path (string)
url (string)
sha256 (string)
strip-components (integer)
dest (string)
Git sources
type
path (string)
url (string)
branch (string)
dest (string)
Bzr sources
type
url (string)
revision (string)
dest (string)
File sources
type
path (string)
url (string)
sha256 (string)
dest-filename (string)
dest (string)
Script sources
This is a way to create a shell (/bin/sh) script from an inline set of commands.
type
commands (array of strings)
dest-filename (string)
dest (string)
Shell sources
This is a way to create/modify the sources by running shell commands.
type
commands (array of strings)
Patch sources
type
path (string)
strip-components (integer)
dest (string)
use-git (boolean)
options (array of strings)
OPTIONS¶
The following options are understood:-h, --help
-v, --verbose
--version
--arch=ARCH
--disable-cache
--disable-download
--disable-updates
--run
--show-deps
--download-only
--build-only
--finish-only
--require-changes
--keep-build-dirs
--ccache
--stop-at=MODULENAME
--repo=DIR
-s, --subject=SUBJECT
-b, --body=BODY
--gpg-sign=KEYID
--gpg-homedir=PATH
--jobs=JOBS
--force-clean
--sandbox
--allow-missing-runtimes
CACHING¶
flatpak-builder caches sources and partial build results in the .flatpak-builder subdirectory of the current directory. If you use --keep-build-dirs, build directories for each module are also stored here.It is safe to remove the contents of the .flatpak-builder directory. This will force a full build the next time you build.
EXAMPLES¶
$ flatpak-builder my-app-dir manifest.jsonExample manifest file:
{ "id": "org.test.TestApp", "runtime": "org.freedesktop.Platform", "runtime-version": "1.2", "sdk": "org.freedesktop.Sdk", "command": "test", "clean": [ "/include", "*.la" ], "build-options" : { "cflags": "-O2 -g", "cxxflags": "-O2 -g", "env": { "V": "1" }, "arch": { "x86_64": { "cflags": "-O3 -g", } } }, "modules": [ { "name": "pygobject", "config-opts": [ "--disable-introspection" ], "sources": [ { "type": "archive", "url": "http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.28/pygobject-2.28.6.tar.xz", "sha256": "fb8a1d4f665130a125011659bd347c7339c944232163dbb9a34fd0686577adb8" }, { "type": "patch", "path": "required-pygobject-fix.patch" }, { "type": "file", "path": "pygobject-extra-file", "dest-filename": "extra-file" } ] }, { "name": "babl", "build-options" : { "cxxflags": "-O2 -g -std=c++11" }, "cleanup": [ "/bin" ], "sources": [ { "type": "git", "url": "git://git.gnome.org/babl" } ] }, { "name": "testapp", "sources": [ { "type": "bzr", "url": "lp:testapp" } ] } ] }
SEE ALSO¶
flatpak(1), flatpak-build-init(1), flatpak-build(1), flatpak-build-finish(1), flatpak-build-export(1)flatpak |