diff --git a/docs/flatpak-builder-docs.html b/docs/flatpak-builder-docs.html index eaa1c05f..1f04b565 100644 --- a/docs/flatpak-builder-docs.html +++ b/docs/flatpak-builder-docs.html @@ -1,9 +1,9 @@ -
+
The command reference is generated from the flatpak-builder repo; see https://github.com/flatpak/flatpak-builder/tree/master/doc
Flatpak-builder is a tool to build flatpak applications. -
Table of Contents
Table of Contents
flatpak-builder — Help build application dependencies
flatpak-builder
[OPTION...] DIRECTORY MANIFEST
flatpak-builder
--run [OPTION...] DIRECTORY MANIFEST COMMAND
flatpak-builder
--show-deps [OPTION...] MANIFEST
flatpak-builder
--show-manifest [OPTION...] MANIFEST
+
Table of Contents
Table of Contents
flatpak-builder — Help build application dependencies
flatpak-builder
[OPTION...] DIRECTORY MANIFEST
flatpak-builder
--run [OPTION...] DIRECTORY MANIFEST COMMAND
flatpak-builder
--show-deps [OPTION...] MANIFEST
flatpak-builder
--show-manifest [OPTION...] MANIFEST
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. @@ -35,7 +35,7 @@ flatpaks this will be added to. Setting a globally unique collection ID allows the apps in the repository to be shared over peer to peer systems without needing further configuration. -
The manifest file is a json or yaml file whose format is described in detail in its own manual page.
The following options are understood:
-h
, --help
+
The manifest file is a json or yaml file whose format is described in detail in its own manual page.
The following options are understood:
-h
, --help
Show help options and exit.
-v
, --verbose
Print debug information during command processing. @@ -188,10 +188,13 @@ If the json is unchanged since the last build of this filename, then do nothing, and return exit code 42.
--mirror-screenshots-url=URL
- Mirror any screenshots in the appstream and rewrite the appstream xml - as if they were on the specified URL. The resulting files will - be stored in the "screenshots" subdirectory in the app directory - and needs to be copied to the specified URL for the appdata to work. + Mirror any media in the appstream and rewrite the media URLs + in the appstream xml to the specified URL. The resulting files + will be stored in the "screenshots" subdirectory in the app directory + for versions earlier than 1.3.4 and "files/share/app-info/media" + subdirectory for newer versions. Since version 1.4.5 this + will also create a screenshot ref in the exported OSTree + repo for each architecture containing the mirrored media.
--extra-sources=SOURCE-DIR
When downloading sources (archives, files, git, bzr, svn), look in this directory for pre-existing copies and use them instead of downloading. @@ -205,6 +208,10 @@ The branch to use with --from-git.
--no-shallow-clone
Don't use shallow clones when mirroring git repos. +
--override-source-date-epoch
+ Set this timestamp as SOURCE_DATE_EPOCH to perform the + build, instead of the last modification time of the manifest. + This is available since 1.3.1.
--add-tag=TAG
Add this tag to the tags list of the manifest before building.
--remove-tag=TAG
@@ -227,7 +234,7 @@
/etc/flatpak/installations.d/
. Using
--installation=default is equivalent to using
--system .
-
flatpak-builder caches sources and partial build results in the state directory (defaulting to the .flatpak-builder subdirectory of the current directory). If you use @@ -235,7 +242,7 @@ each module are also stored here.
It is safe to remove the state directory. This will force a full build the next time you build. -
Table of Contents
Table of Contents
flatpak-manifest — Information for building an application
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. -
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. -
+
These are the properties that are accepted:
id
or app-id
(string)A string defining the application id.
Note, "app-id" is deprecated and preserved only for backwards compatibility.
branch
(string)The branch to use when exporting @@ -373,7 +380,7 @@ useful as the upstream license is typically only about the application itself, whereas the bundled app can contain other licenses - too.
copy-icon
(boolean)If rename-icon is set, keep a copy of the old icon file.
desktop-file-name-prefix
(string)This string will be prefixed to the Name key in the main application desktop file.
desktop-file-name-suffix
(string)This string will be suffixed to the Name key in the main application desktop file.
+ too.
copy-icon
(boolean)If rename-icon is set, keep a copy of the old icon file.
desktop-file-name-prefix
(string)This string will be prefixed to the Name key in the main application desktop file.
desktop-file-name-suffix
(string)This string will be suffixed to the Name key in the main application desktop file.
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.
@@ -389,7 +396,7 @@ needed).
env
(object)This is a dictionary defining environment variables to be set during the build. Elements in this override the properties that set the environment, like cflags and ldflags. Keys with a null value unset the corresponding variable.
secret-env
(array of strings)This is a array defining which host environment variables is transfered to build-commands or post-install environment.
build-args
(array of strings)This is an array containing extra options to pass to flatpak build.
test-args
(array of strings)Similar to build-args but affects the tests, not the normal build.
config-opts
(array of strings)This is an array containing extra options passed to the build system during configuration.
secret-opts
(array of strings)This is an array of options that will be passed to configure, meant to be used to pass secrets through host environment variables. Put the option with an environment variables and will be resolved beforehand. '-DSECRET_ID=$CI_SECRET'
make-args
(array of strings)An array of extra arguments that will be passed to make
make-install-args
(array of strings)An array of extra arguments that will be passed to make install
strip
(boolean)If this is true (the default is false) then all ELF files will be stripped after install.
no-debuginfo
(boolean)By default (if strip is not true) flatpak-builder extracts all debug info in ELF files to a separate files - and puts this in an extension. If you want to disable this, set no-debuginfo to true.
no-debuginfo-compression
(boolean)By default when extracting debuginfo we compress the debug sections. If you want to disable this, set no-debuginfo-compression to true.
arch
(object)This is a dictionary defining for each arch a separate build options object that override the main one.
+ and puts this in an extension. If you want to disable this, set no-debuginfo to true.
no-debuginfo-compression
(boolean)By default when extracting debuginfo we compress the debug sections. If you want to disable this, set no-debuginfo-compression to true.
arch
(object)This is a dictionary defining for each arch a separate build options object that override the main one.
Extension define extension points in the app/runtime that can be implemented by extensions, supplying extra files which are available during runtime..
@@ -411,11 +418,11 @@ add-ld-path, download-if, enable-if, autoprune-unless, merge-dirs, subdirectory-suffix, locale-subset, version, versions. See the flatpak metadata documentation for more information on these. -
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. + Modules can be nested, in order to turn related modules on and off with a single key. Module scopes are always isolated, so nested modules do not inherit attributes from parent modules.
These are the properties that are accepted:
name
(string)The name of the module, used in e.g. build logs. The name is also used for constructing filenames and commandline arguments, therefore using spaces or '/' in this string is a bad idea.
disabled
(boolean)If true, skip this module
sources
(array of objects or strings)An array of objects defining @@ -424,7 +431,7 @@ as the name of a separate json or yaml file that contains sources. See below for details.
secret-env
(array of strings)An array defining which host environment variables is transfered to build-commands or post-install environment.
config-opts
(array of strings)An array of options that will be passed to configure
secret-opts
(array of strings)An array of options that will be passed to configure, meant to be used to pass secrets through host environment variables. Put the option - with an environment variables and will be resolved beforehand. '-DSECRET_ID=$CI_SECRET'
make-args
(array of strings)An array of arguments that will be passed to make
make-install-args
(array of strings)An array of arguments that will be passed to make install
rm-configure
(boolean)If true, remove the configure script before starting build
no-autogen
(boolean)Ignore the existence of an autogen script
no-parallel-make
(boolean)Don't call make with arguments to build in parallel
install-rule
(string)Name of the rule passed to make for the install phase, default is install
no-make-install
(boolean)Don't run the make install (or equivalent) stage
no-python-timestamp-fix
(boolean)Don't fix up the *.py[oc] header timestamps for ostree use.
cmake
(boolean)Use cmake instead of configure (deprecated: use buildsystem instead)
buildsystem
(string)Build system to use: autotools, cmake, cmake-ninja, meson, simple, qmake
builddir
(boolean)Use a build directory that is separate from the source directory
subdir
(string)Build inside this subdirectory of the extracted sources
build-options
(object)A build options object that can override global options
build-commands
(array of strings)An array of commands to run during build (between make and make install if those are used). + with an environment variables and will be resolved beforehand. '-DSECRET_ID=$CI_SECRET'
make-args
(array of strings)An array of arguments that will be passed to make
make-install-args
(array of strings)An array of arguments that will be passed to make install
rm-configure
(boolean)If true, remove the configure script before starting build
no-autogen
(boolean)Ignore the existence of an autogen script
no-parallel-make
(boolean)Don't call make with arguments to build in parallel
install-rule
(string)Name of the rule passed to make for the install phase, default is install
no-make-install
(boolean)Don't run the make install (or equivalent) stage
no-python-timestamp-fix
(boolean)Don't fix up the *.py[oc] header timestamps for ostree use.
cmake
(boolean)Use cmake instead of configure (deprecated: use buildsystem instead)
buildsystem
(string)Build system to use: autotools, cmake, cmake-ninja, meson, simple, qmake
builddir
(boolean)Use a build directory that is separate from the source directory
subdir
(string)Build inside this subdirectory of the extracted sources
build-options
(object)A build options object that can override global options. Note that this is not inherited by nested modules.
build-commands
(array of strings)An array of commands to run during build (between make and make install if those are used).
This is primarily useful when using the "simple" buildsystem.
Each command is run in /bin/sh -c
, so it can use standard POSIX shell syntax such as piping output.
If any individual entry in the array fails, then the whole build process will fail,
@@ -438,30 +445,30 @@
are hard-links to the cached files, so you're not allowed to modify them in-place.
If you list a file in this then the hardlink will be broken and you can modify it.
This is a workaround, ideally installing files should replace files, not modify
- existing ones.
only-arches
(array of strings)If non-empty, only build the module on the arches listed.
skip-arches
(array of strings)Don't build on any of the arches listed.
cleanup-platform
(array of strings)Extra files to clean up in the platform.
run-tests
(boolean)If true this will run the tests after installing.
test-rule
(string)The target to build when running the tests. Defaults to "check" for make and "test" for ninja. Set to empty to disable.
test-commands
(array of strings)Array of commands to run during the tests.
modules
(array of objects or strings)An array of objects specifying nested modules to be built before this one. - String members in the array are interpreted as names of a separate json or yaml file that contains a module.
+ existing ones.
only-arches
(array of strings)If non-empty, only build the module on the arches listed.
skip-arches
(array of strings)Don't build on any of the arches listed.
cleanup-platform
(array of strings)Extra files to clean up in the platform.
run-tests
(boolean)If true this will run the tests after installing.
test-rule
(string)The target to build when running the tests. Defaults to "check" for make and "test" for ninja. Set to empty to disable.
test-commands
(array of strings)Array of commands to run during the tests.
license-files
(array of strings)Array of paths to LICENSE files of the module.
modules
(array of objects or strings)An array of objects specifying nested modules to be built before this one. + String members in the array are interpreted as names of a separate json or yaml file that contains a module.
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. -
only-arches
(array of strings)If non-empty, only build the module on the arches listed.
skip-arches
(array of strings)Don't build on any of the arches listed.
dest
(string)Directory inside the source dir where this source will be extracted.
type
"archive"
path
(string)The path of the archive
url
(string)The URL of a remote archive that will be downloaded. This overrides path if both are specified.
mirror-urls
(array of strings)A list of alternative urls that are used if the main url fails.
referer
(string)Sets the HTTP "Referer" header when downloading the archive.
disable-http-decompression
(boolean)Disables decompression of downloads over HTTP for misconfigured servers.
git-init
(boolean)Whether to initialise the repository as a git repository.
archive-type
(string)+
only-arches
(array of strings)If non-empty, only build the module on the arches listed.
skip-arches
(array of strings)Don't build on any of the arches listed.
dest
(string)Directory inside the source dir where this source will be extracted.
type
"archive"
path
(string)The path of the archive
url
(string)The URL of a remote archive that will be downloaded. This overrides path if both are specified.
mirror-urls
(array of strings)A list of alternative urls that are used if the main url fails.
referer
(string)Sets the HTTP "Referer" header when downloading the archive.
disable-http-decompression
(boolean)Disables decompression of downloads over HTTP for misconfigured servers.
git-init
(boolean)Whether to initialise the repository as a git repository.
archive-type
(string)The type of archive if it cannot be guessed from the path. Possible values are "rpm", "tar", "tar-gzip", "tar-compress", "tar-bzip2", "tar-lzip", "tar-lzma", "tar-lzop", "tar-xz", "tar-zst", "zip" and "7z". -
md5
(string)The md5 checksum of the file, verified after download
Note that md5 is no longer considered a safe checksum, we recommend you use at least sha256.
sha1
(string)The sha1 checksum of the file, verified after download
Note that sha1 is no longer considered a safe checksum, we recommend you use at least sha256.
sha256
(string)The sha256 checksum of the file, verified after download
sha512
(string)The sha512 checksum of the file, verified after download
strip-components
(integer)The number of initial pathname components to strip during extraction. Defaults to 1.
dest-filename
(string)Filename to for the downloaded file, defaults to the basename of url.
type
"git"
path
(string)The path to a local checkout of the git repository. Due to how git-clone works, this will be much faster than specifying a URL of file:///...
url
(string)URL of the git repository. This overrides path if both are specified. When using git via SSH, the correct syntax is ssh://user@domain/path/to/repo.git.
branch
(string)The branch to use from the git repository. As of 1.2.3 this will try to auto-detect the upstream default branch. Previously this defaulted to master
.
tag
(string)The tag to use from the git repository
commit
(string)The commit to use from the git repository. If branch is also specified, then it is verified that the branch/tag is at this specific commit. This is - a readable way to document that you're using a particular tag, but verify that it does not change.
disable-fsckobjects
(boolean)Don't use transfer.fsckObjects=1 to mirror git repository. This may be needed for some (broken) repositories.
disable-shallow-clone
(boolean)Don't optimize by making a shallow clone when downloading the git repo.
disable-submodules
(boolean)Don't checkout the git submodules when cloning the repository.
type
"bzr"
url
(string)URL of the bzr repository
revision
(string)A specific revision to use in the branch
type
"svn"
url
(string)URL of the svn repository, including branch/tag part
revision
(string)A specific revision number to use
type
"dir"
path
(string)The path of a local directory whose content will be copied into the source dir. Note that directory sources don't currently support caching, so they will be rebuilt each time.
skip
(array of strings)Source files to ignore in the directory.
type
"file"
path
(string)The path of a local file that will be copied into the source dir
url
(string)The URL of a remote file that will be downloaded and copied into the source dir. This overrides path if both are specified.
mirror-urls
(array of strings)A list of alternative urls that are used if the main url fails.
referer
(string)Sets the HTTP "Referer" header when downloading the file.
disable-http-decompression
(boolean)Disables decompression of downloads over HTTP for misconfigured servers.
md5
(string)The md5 checksum of the file, verified after download. This is optional for local files.
Note that md5 is no longer considered a safe checksum, we recommend you use at least sha256.
sha1
(string)The sha1 checksum of the file, verified after download. This is optional for local files.
Note that sha1 is no longer considered a safe checksum, we recommend you use at least sha256.
sha256
(string)The sha256 checksum of the file, verified after download. This is optional for local files.
sha512
(string)The sha512 checksum of the file, verified after download. This is optional for local files.
dest-filename
(string)Filename to use inside the source dir, default to the basename of path.
+
md5
(string)The md5 checksum of the file, verified after download
Note that md5 is no longer considered a safe checksum, we recommend you use at least sha256.
sha1
(string)The sha1 checksum of the file, verified after download
Note that sha1 is no longer considered a safe checksum, we recommend you use at least sha256.
sha256
(string)The sha256 checksum of the file, verified after download
sha512
(string)The sha512 checksum of the file, verified after download
strip-components
(integer)The number of initial pathname components to strip during extraction. Defaults to 1.
dest-filename
(string)Filename to for the downloaded file, defaults to the basename of url.
type
"git"
path
(string)The path to a local checkout of the git repository. Due to how git-clone works, this will be much faster than specifying a URL of file:///...
url
(string)URL of the git repository. This overrides path if both are specified. When using git via SSH, the correct syntax is ssh://user@domain/path/to/repo.git.
branch
(string)The branch to use from the git repository. As of 1.2.3 this will try to auto-detect the upstream default branch. Previously this defaulted to master
.
tag
(string)The tag to use from the git repository
commit
(string)The commit to use from the git repository. If branch is also specified, then it is verified that the branch/tag is at this specific commit. This is + a readable way to document that you're using a particular tag, but verify that it does not change.
disable-fsckobjects
(boolean)Don't use transfer.fsckObjects=1 to mirror git repository. This may be needed for some (broken) repositories.
disable-shallow-clone
(boolean)Don't optimize by making a shallow clone when downloading the git repo.
disable-submodules
(boolean)Don't checkout the git submodules when cloning the repository.
type
"bzr"
url
(string)URL of the bzr repository
revision
(string)A specific revision to use in the branch
type
"svn"
url
(string)URL of the svn repository, including branch/tag part
revision
(string)A specific revision number to use
type
"dir"
path
(string)The path of a local directory whose content will be copied into the source dir. Note that directory sources don't currently support caching, so they will be rebuilt each time.
skip
(array of strings)Source files to ignore in the directory.
type
"file"
path
(string)The path of a local file that will be copied into the source dir
url
(string)The URL of a remote file that will be downloaded and copied into the source dir. This overrides path if both are specified.
mirror-urls
(array of strings)A list of alternative urls that are used if the main url fails.
referer
(string)Sets the HTTP "Referer" header when downloading the file.
disable-http-decompression
(boolean)Disables decompression of downloads over HTTP for misconfigured servers.
md5
(string)The md5 checksum of the file, verified after download. This is optional for local files.
Note that md5 is no longer considered a safe checksum, we recommend you use at least sha256.
sha1
(string)The sha1 checksum of the file, verified after download. This is optional for local files.
Note that sha1 is no longer considered a safe checksum, we recommend you use at least sha256.
sha256
(string)The sha256 checksum of the file, verified after download. This is optional for local files.
sha512
(string)The sha512 checksum of the file, verified after download. This is optional for local files.
dest-filename
(string)Filename to use inside the source dir, default to the basename of path.
This is a way to create a shell (/bin/sh) script from an inline set of commands. -
type
"script"
commands
(array of strings)An array of shell commands that will be put in a shellscript file
dest-filename
(string)Filename to use inside the source dir, default to autogen.sh.
+
type
"script"
commands
(array of strings)An array of shell commands that will be put in a shellscript file
dest-filename
(string)Filename to use inside the source dir, default to autogen.sh.
This is a way to create a file with given contents. -
type
"inline"
dest-filename
(string)Filename to use inside the source dir.
contents
(string)Text data that will be put in the file.
base64
(boolean)Whether content is base64-encoded.
+
type
"inline"
dest-filename
(string)Filename to use inside the source dir.
contents
(string)Text data that will be put in the file.
base64
(boolean)Whether content is base64-encoded.
This is a way to create/modify the sources by running shell commands. -
type
"shell"
commands
(array of strings)An array of shell commands that will be run during source extraction
type
"patch"
path
(string)The path of a patch file that will be applied in the source dir
paths
(array of strings)An list of paths to a patch files that will be applied in the source dir, in order
strip-components
(integer)The value of the -p argument to patch, defaults to 1.
use-git
(boolean)Whether to use "git apply" rather than "patch" to apply the patch, required when the patch file contains binary diffs.
use-git-am
(boolean)Whether to use "git am" rather than "patch" to apply the patch, required when the patch file contains binary diffs. You cannot use this at the same time as use-git
.
options
(array of strings)Extra options to pass to the patch command.
type
"extra-data"
filename
(string)The name to use for the downloaded extra data
url
(string)The url to the extra data.
sha256
(string)The sha256 of the extra data.
size
(number)The size of the extra data in bytes.
installed-size
(string)The extra installed size this adds to the app (optional).
+
type
"shell"
commands
(array of strings)An array of shell commands that will be run during source extraction
type
"patch"
path
(string)The path of a patch file that will be applied in the source dir
paths
(array of strings)An list of paths to a patch files that will be applied in the source dir, in order
strip-components
(integer)The value of the -p argument to patch, defaults to 1.
use-git
(boolean)Whether to use "git apply" rather than "patch" to apply the patch, required when the patch file contains binary diffs.
use-git-am
(boolean)Whether to use "git am" rather than "patch" to apply the patch, required when the patch file contains binary diffs. You cannot use this at the same time as use-git
.
options
(array of strings)Extra options to pass to the patch command.
type
"extra-data"
filename
(string)The name to use for the downloaded extra data
url
(string)The url to the extra data.
sha256
(string)The sha256 of the extra data.
size
(number)The size of the extra data in bytes.
installed-size
(string)The extra installed size this adds to the app (optional).
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
).
-
+
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.
@@ -476,13 +483,13 @@
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. -
The environment can be modified in several ways in the manifest, but the default values are: -
The id of the application currently building.
The architecture currently building.
The path to where the current build should install into. This is /app
for application builds.
The number of jobs that flatpak-builder would normally use for make -j. Defaults to ncpus unless the module disabled parallel make.
The path to the build directory of the module currently building. This is normally /run/build/$MODULE
.
/app/bin:/usr/bin
/app/lib
/app/lib/pkgconfig:/app/share/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
/app/share/aclocal
/app/include
/app/include
-L/app/lib
en_US.utf8
+
The id of the application currently building.
The architecture currently building.
The path to where the current build should install into. This is /app
for application builds.
The number of jobs that flatpak-builder would normally use for make -j. Defaults to ncpus unless the module disabled parallel make.
The path to the build directory of the module currently building. This is normally /run/build/$MODULE
.
/app/bin:/usr/bin
/app/lib
/app/lib/pkgconfig:/app/share/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
/app/share/aclocal
/app/include
/app/include
-L/app/lib
en_US.utf8
Builds have the --allow=devel and --allow=multiarch permissions that regular flatpak runs don't have by default. This 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. -