table of contents
- buster 1.0.5-1
- buster-backports 1.0.12-1~bpo10+1
- testing 1.0.12-1
- unstable 1.0.12-1
- experimental 1.0.14-1
| FLATPAK MANIFEST(5) | flatpak manifest | FLATPAK MANIFEST(5) |
NAME¶
flatpak-manifest - Information for building an applicationDESCRIPTION¶
Flatpak uses manifest, or recipe, files in a json or yaml format to describe how an application and its bundled dependencies can be built from sources. The manifest gets used by flatpak-builder.FILE FORMAT¶
The top level of the manifest file describes global attributes of the application, how it can be built, and the list of modules that need to be built.Toplevel properties¶
These are the properties that are accepted:id or app-id (string)
branch (string)
This key overrides both the default-branch key, and the --default-branch commandline option. Unless you need a very specific branchname (like for a runtime or an extension) it is recommended to use the default-branch key instead, because you can then override the default using --default-branch when building for instance a test build.
default-branch (string)
This key can be overriden by the --default-branch commandline option.
collection-id (string)
extension-tag (string)
runtime (string)
runtime-version (string)
sdk (string)
var (string)
metadata (string)
command (string)
Also note that the command is used when the application is run via flatpak run, and does not affect what gets executed when the application is run in other ways, e.g. via the desktop file or D-Bus activation.
build-runtime (boolean)
build-extension (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)
inherit-extensions (array of strings)
inherit-sdk-extensions (array of strings)
tags (array of strings)
build-options (object)
modules (array of objects or strings)
add-extensions (objects)
add-build-extensions (objects)
cleanup (array of strings)
cleanup-commands (array of strings)
cleanup-platform (array of strings)
cleanup-platform-commands (array of strings)
prepare-platform-commands (array of strings)
finish-args (array of strings)
rename-desktop-file (string)
rename-appdata-file (string)
rename-icon (string)
appdata-license (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)
cflags-override (boolean)
cppflags (string)
cppflags-override (boolean)
cxxflags (string)
cxxflags-override (boolean)
ldflags (string)
ldflags-override (boolean)
prefix (string)
libdir (string)
append-path (string)
prepend-path (string)
append-ld-library-path (string)
prepend-ld-library-path (string)
append-pkg-config-path (string)
prepend-pkg-config-path (string)
env (object)
build-args (array of strings)
test-args (array of strings)
config-opts (array of strings)
make-args (array of strings)
make-install-args (array of strings)
strip (boolean)
no-debuginfo (boolean)
no-debuginfo-compression (boolean)
arch (object)
Extension¶
Extension define extension points in the app/runtime that can be implemented by extensions, supplying extra files which are available during runtime..These are the properties that are accepted:
directory (string)
bundle (boolean)
remove-after-build (boolean)
Additionally the standard flatpak extension properies are supported, and put directly into the metadata file: autodelete, no-autodownload, subdirectories, add-ld-path, download-if, enable-if, merge-dirs, subdirectory-suffix, locale-subset, version, versions. See the flatpak metadata documentation for more information on these.
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 or strings)
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)
install-rule (string)
no-make-install (boolean)
no-python-timestamp-fix (boolean)
cmake (boolean)
buildsystem (string)
builddir (boolean)
subdir (string)
build-options (object)
build-commands (array of strings)
post-install (array of strings)
cleanup (array of strings)
ensure-writable (array of strings)
only-arches (array of strings)
skip-arches (array of strings)
cleanup-platform (array of strings)
run-tests (boolean)
test-rule (string)
test-commands (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.Additionally, the sources list can contain a plain string, which is interpreted as the name of a separate json or yaml file that is read and inserted at this point. The file can contain a single source, or an array of sources.
All sources
only-arches (array of strings)
skip-arches (array of strings)
dest (string)
Archive sources (tar, zip)
type
path (string)
url (string)
mirror-urls (array of strings)
git-init (boolean)
md5 (string)
Note that md5 is no longer considered a safe checksum, we recommend you use at least sha256.
sha1 (string)
Note that sha1 is no longer considered a safe checksum, we recommend you use at least sha256.
sha256 (string)
sha512 (string)
strip-components (integer)
dest-filename (string)
Git sources
type
path (string)
url (string)
branch (string)
tag (string)
commit (string)
disable-fsckobjects (boolean)
disable-shallow-clone (boolean)
Bzr sources
type
url (string)
revision (string)
Svn sources
type
url (string)
revision (string)
Directory sources
type
path (string)
skip (array of strings)
File sources
type
path (string)
url (string)
mirror-urls (array of strings)
md5 (string)
Note that md5 is no longer considered a safe checksum, we recommend you use at least sha256.
sha1 (string)
Note that sha1 is no longer considered a safe checksum, we recommend you use at least sha256.
sha256 (string)
sha512 (string)
dest-filename (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)
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)
paths (array of strings)
strip-components (integer)
use-git (boolean)
use-git-am (boolean)
options (array of strings)
Extra data sources
type
filename (string)
url (string)
sha256 (string)
size (number)
installed-size (string)
BUILD ENVIRONMENT¶
When building the application each command is run in a separate sandbox with access to only the things required for it. This section describes the details of the sandbox. Any options here can be overridden globally or per-module with the build-args option (although such manifest will not work if you start flatpak-builder with --sandbox).Filesystem¶
Each module is built in its own build directory, stored in a sub directory called build/$modulename-$count in the state dir (which is typically .flatpak-builder/). Additionally there is a symlink build/$modulename to the latest version. In order to generate reproducible builds this directory is also mounted as /run/build/$modulename in the sandbox (or /run/build-runtime/$modulename when building runtimes). This is used as current working directory for all build ops.The destination directory for installation is accessible for writing at the place it will seen at runtime. In the case of a regular application this will be /app. If building a runtime it will instead be /usr, and when building an extension it will be at the extensionpoint directory somewhere below /app (for app extension) or /usr (for runtime extensions).
Additionally the there will be (as needed, depending on what is building) read-only mounts of the sdk at /usr, sdk extensions below that, and the application at /app. No other filesystem access is available.
Environment¶
The environment can be modified in several ways in the manifest, but the default values are:FLATPAK_ID
FLATPAK_ARCH
FLATPAK_DEST
FLATPAK_BUILDER_N_JOBS
FLATPAK_BUILDER_BUILDDIR
PATH
LD_LIBRARY_PATH
PKG_CONFIG_PATH
ACLOCAL_PATH
C_INCLUDE_PATH
CPLUS_INCLUDE_PATH
LDFLAGS
LC_ALL
Permissions¶
Builds have the --allow=devel and --allow=multiarch permissions that regular flatpak runs don't have by default. This allows limits the syscall filtering that is normally done so development tools like debuggers work. Otherwise the build sandbox is very limited, for example there is no network access.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": "https://gitlab.gnome.org/GNOME/babl.git"
}
]
},
{
"name": "testapp",
"sources": [
{
"type": "bzr",
"url": "lp:testapp"
}
]
}
]
}
SEE ALSO¶
flatpak-builder(1)| flatpak |