Blame doc/flatpak-builder.xml

rpm-build c487f7
 
rpm-build c487f7
rpm-build c487f7
    "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
rpm-build c487f7
rpm-build c487f7
<refentry id="flatpak-builder">
rpm-build c487f7
rpm-build c487f7
    <refentryinfo>
rpm-build c487f7
        <title>flatpak builder</title>
rpm-build c487f7
        <productname>flatpak</productname>
rpm-build c487f7
rpm-build c487f7
        <authorgroup>
rpm-build c487f7
            <author>
rpm-build c487f7
                <contrib>Developer</contrib>
rpm-build c487f7
                <firstname>Alexander</firstname>
rpm-build c487f7
                <surname>Larsson</surname>
rpm-build c487f7
                <email>alexl@redhat.com</email>
rpm-build c487f7
            </author>
rpm-build c487f7
        </authorgroup>
rpm-build c487f7
    </refentryinfo>
rpm-build c487f7
rpm-build c487f7
    <refmeta>
rpm-build c487f7
        <refentrytitle>flatpak-builder</refentrytitle>
rpm-build c487f7
        <manvolnum>1</manvolnum>
rpm-build c487f7
    </refmeta>
rpm-build c487f7
rpm-build c487f7
    <refnamediv>
rpm-build c487f7
        <refname>flatpak-builder</refname>
rpm-build c487f7
        <refpurpose>Help build application dependencies</refpurpose>
rpm-build c487f7
    </refnamediv>
rpm-build c487f7
rpm-build c487f7
    <refsynopsisdiv>
rpm-build c487f7
            <cmdsynopsis>
rpm-build c487f7
                <command>flatpak-builder</command>
rpm-build c487f7
                <arg choice="opt" rep="repeat">OPTION</arg>
rpm-build c487f7
                <arg choice="plain">DIRECTORY</arg>
rpm-build c487f7
                <arg choice="plain">MANIFEST</arg>
rpm-build c487f7
            </cmdsynopsis>
rpm-build c487f7
            <cmdsynopsis>
rpm-build c487f7
                <command>flatpak-builder</command>
rpm-build c487f7
                <arg choice="plain">--run</arg>
rpm-build c487f7
                <arg choice="opt" rep="repeat">OPTION</arg>
rpm-build c487f7
                <arg choice="plain">DIRECTORY</arg>
rpm-build c487f7
                <arg choice="plain">MANIFEST</arg>
rpm-build c487f7
                <arg choice="plain">COMMAND</arg>
rpm-build c487f7
            </cmdsynopsis>
rpm-build c487f7
            <cmdsynopsis>
rpm-build c487f7
                <command>flatpak-builder</command>
rpm-build c487f7
                <arg choice="plain">--show-deps</arg>
rpm-build c487f7
                <arg choice="opt" rep="repeat">OPTION</arg>
rpm-build c487f7
                <arg choice="plain">MANIFEST</arg>
rpm-build c487f7
            </cmdsynopsis>
rpm-build c487f7
            <cmdsynopsis>
rpm-build c487f7
                <command>flatpak-builder</command>
rpm-build c487f7
                <arg choice="plain">--show-manifest</arg>
rpm-build c487f7
                <arg choice="opt" rep="repeat">OPTION</arg>
rpm-build c487f7
                <arg choice="plain">MANIFEST</arg>
rpm-build c487f7
            </cmdsynopsis>
rpm-build c487f7
    </refsynopsisdiv>
rpm-build c487f7
rpm-build c487f7
    <refsect1>
rpm-build c487f7
        <title>Description</title>
rpm-build c487f7
rpm-build c487f7
        <para>
rpm-build c487f7
            <command>flatpak-builder</command> is a wrapper around the <command>flatpak build</command> command
rpm-build c487f7
            that automates the building of applications and their dependencies. It is one option you can use
rpm-build c487f7
            to build applications.
rpm-build c487f7
        </para>
rpm-build c487f7
        <para>
rpm-build c487f7
            The goal of <command>flatpak-builder</command> is to push as much knowledge about how to build modules to
rpm-build c487f7
            the individual upstream projects. It does this by assuming that the modules adhere to the Build API specified
rpm-build c487f7
            at https://github.com/cgwalters/build-api. This essentially  means that it follows the <command>./configure
rpm-build c487f7
            && make && make install</command> scheme with an optional autogen script. If the upstream
rpm-build c487f7
            does not adhere to the API you can make it do so by adding patches and extra files.
rpm-build c487f7
        </para>
rpm-build c487f7
        <para>
rpm-build c487f7
            An invocation of <command>flatpak-builder</command> proceeds in these stages, each being specified
rpm-build c487f7
            in detail in json format in <arg choice="plain">MANIFEST</arg>:
rpm-build c487f7
            <itemizedlist mark='bullet'>
rpm-build c487f7
                <listitem>
rpm-build c487f7
                    <para>Download all sources</para>
rpm-build c487f7
                </listitem>
rpm-build c487f7
                <listitem>
rpm-build c487f7
                    <para>Initialize the application directory with <command>flatpak build-init</command></para>
rpm-build c487f7
                </listitem>
rpm-build c487f7
                <listitem>
rpm-build c487f7
                    <para>Build and install each module with <command>flatpak build</command></para>
rpm-build c487f7
                </listitem>
rpm-build c487f7
                <listitem>
rpm-build c487f7
                    <para>Clean up the final build tree by removing unwanted files and e.g. stripping binaries</para>
rpm-build c487f7
                </listitem>
rpm-build c487f7
                <listitem>
rpm-build c487f7
                    <para>Finish the application directory with <command>flatpak build-finish</command></para>
rpm-build c487f7
                </listitem>
rpm-build c487f7
            </itemizedlist>
rpm-build c487f7
rpm-build c487f7
            After this you will end up with a build of the application in <arg choice="plain">DIRECTORY</arg>, which you can
rpm-build c487f7
            export to a repository with the <command>flatpak build-export</command> command. If you use the <option>--repo</option>
rpm-build c487f7
            option, flatpak-builder will do the export for you at the end of the build process. When flatpak-builder does the
rpm-build c487f7
            export, it also stores the manifest that was used for the build in /app/manifest.json. The manifest is 'resolved',
rpm-build c487f7
            i.e. git branch names are replaced by the actual commit IDs that were used in the build.
rpm-build c487f7
        </para>
rpm-build c487f7
        <para>
rpm-build c487f7
            At each of the above steps flatpak caches the result, and if you build the same file again, it will start
rpm-build c487f7
            at the first step where something changes. For instance the first version controlled source that had
rpm-build c487f7
            new commits added, or the first module where some changes to the <arg choice="plain">MANIFEST</arg> file caused
rpm-build c487f7
            the build environment to change. This makes flatpak-builder very efficient for incremental builds.
rpm-build c487f7
        </para>
rpm-build c487f7
        <para>
rpm-build c487f7
            When building a flatpak to be published to the internet,
rpm-build c487f7
            <option>--collection-id=COLLECTION-ID</option> should be specified
rpm-build c487f7
            as a globally unique reverse DNS value to identify the collection of
rpm-build c487f7
            flatpaks this will be added to. Setting a globally unique collection
rpm-build c487f7
            ID allows the apps in the repository to be shared over peer to peer
rpm-build c487f7
            systems without needing further configuration.
rpm-build c487f7
        </para>
rpm-build c487f7
    </refsect1>
rpm-build c487f7
rpm-build c487f7
    <refsect1>
rpm-build c487f7
        <title>Manifest</title>
rpm-build c487f7
rpm-build c487f7
        <para>The manifest file is a json or yaml file whose format is described in detail in its own manual page.</para>
rpm-build c487f7
    </refsect1>
rpm-build c487f7
rpm-build c487f7
    <refsect1>
rpm-build c487f7
        <title>Options</title>
rpm-build c487f7
rpm-build c487f7
        <para>The following options are understood:</para>
rpm-build c487f7
rpm-build c487f7
        <variablelist>
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>-h</option></term>
rpm-build c487f7
                <term><option>--help</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Show help options and exit.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>-v</option></term>
rpm-build c487f7
                <term><option>--verbose</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Print debug information during command processing.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--version</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Print version information and exit.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--arch=ARCH</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Specify the machine architecture to build for. If no architecture is specified, the host architecture will be automatically detected. Only host compatible architectures can be specified.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--default-branch=<replaceable>BRANCH</replaceable></option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Set the default branch to
rpm-build c487f7
                    <replaceable>BRANCH</replaceable>. This is used if
rpm-build c487f7
                    the manifest does not specify a branch. The default
rpm-build c487f7
                    is <literal>master</literal>.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--disable-cache</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Don't look at the existing cache for a previous build, instead always rebuild modules.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--disable-rofiles-fuse</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Disable the use of rofiles-fuse to optimize the cache use via hardlink checkouts.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--disable-download</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                     Don't download any sources. This only works if some version of all sources are downloaded
rpm-build c487f7
                     already. This is useful if you want to guarantee that no network i/o is done. However, the
rpm-build c487f7
                     build will fail if some source is not locally available.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--disable-updates</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                  Download missing sources, but don't update local mirrors of version control repos. This is useful
rpm-build c487f7
                  to rebuild things but without updating git, bzr or svn repositories from the remote repository.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--disable-tests</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Don't run any of the tests.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--run</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                  Run a command in a sandbox based on the build dir. This starts flatpak build, with some extra
rpm-build c487f7
                  arguments to give the same environment as the build, and the same permissions the final app
rpm-build c487f7
                  will have (except filesystem permissions). The command to run must be the last argument passed to
rpm-build c487f7
                  flatpak-builder, after the directory and the manifest.
rpm-build c487f7
                  </para>
rpm-build c487f7
rpm-build c487f7
                  <para>
rpm-build c487f7
                  Only the
rpm-build c487f7
                  <option>--arch=</option><replaceable>ARCH</replaceable>,
rpm-build c487f7
                  <option>--ccache</option> and
rpm-build c487f7
                  <option>--verbose</option> options can be combined
rpm-build c487f7
                  with this option.
rpm-build c487f7
                  </para>
rpm-build c487f7
                </listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--build-shell=MODULENAME</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                  Extract and prepare the sources for the named module, and then start
rpm-build c487f7
                  a shell in a sandbox identical to the one flatpak-builder would use for building the module.
rpm-build c487f7
                  This is useful to debug a module.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--show-deps</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                  List all the (local) files that the manifest depends on.
rpm-build c487f7
                  </para>
rpm-build c487f7
rpm-build c487f7
                  <para>
rpm-build c487f7
                  Only the <option>--verbose</option> option can be combined
rpm-build c487f7
                  with this option.
rpm-build c487f7
                  </para>
rpm-build c487f7
                </listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--show-manifest</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                  Loads the manifest, including any included files and prints it in a canonical json format.
rpm-build c487f7
                  This is useful for tools that want to handle manifest files to avoid having to support both
rpm-build c487f7
                  yaml and json, as well as some non-standard json handling that is supported (for example
rpm-build c487f7
                  comments and multiline strings).
rpm-build c487f7
                  </para>
rpm-build c487f7
rpm-build c487f7
                  <para>
rpm-build c487f7
                  Only the <option>--verbose</option> option can be combined
rpm-build c487f7
                  with this option.
rpm-build c487f7
                  </para>
rpm-build c487f7
                </listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--download-only</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                     Exit successfully after downloading the required sources.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--bundle-sources</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Create an additional runtime with the source code for
rpm-build c487f7
                    this module. It will be named
rpm-build c487f7
                    <replaceable>app-id</replaceable><literal>.Sources</literal>,
rpm-build c487f7
                    for example
rpm-build c487f7
                    <literal>org.gnome.Maps.Sources</literal>.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--build-only</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                     Don't do the cleanup and finish stages, which is useful if you
rpm-build c487f7
                     want to build more things into the app.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--finish-only</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                     Only do the cleanup, finish and export stages, picking up
rpm-build c487f7
                     where a --build-only command left off.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--export-only</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Only do the export stages, picking up the build result from a previous build.
rpm-build c487f7
                    This can be used to split the build and export/signature into two calls
rpm-build c487f7
                    by leaving out --repo in the first call.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--require-changes</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Do nothing, leaving a non-existent <arg choice="plain">DIRECTORY</arg> if nothing changes since
rpm-build c487f7
                    last cached build. If this is not specified, the latest version from the cache will be put
rpm-build c487f7
                    into <arg choice="plain">DIRECTORY</arg>.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--state-dir=PATH</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                  Use this directory for storing state (downloads, build dirs, build cache, etc) rather than
rpm-build c487f7
                  .flatpak-builder. This can be an absolute or relative path, but must be on the
rpm-build c487f7
                  same filesystem as the specified target <arg choice="plain">DIRECTORY</arg>.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--keep-build-dirs</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Don't remove the sources and build after having built and installed each module.
rpm-build c487f7
                    This also creates a symlink to the build directory with a stable name ("build-modulename").
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--delete-build-dirs</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Always remove the sources and build after having built each module, even if the build
rpm-build c487f7
                    failed. The default is to keep failed build directories but remove successful ones.
rpm-build c487f7
                    This is useful in e.g. automatic build systems.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--ccache</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                     Enable use of ccache in the build (needs ccache in the sdk). The default ccache folder can be
rpm-build c487f7
                     overridden by setting the environment variable CCACHE_DIR.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--stop-at=MODULENAME</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                     Stop at the specified module, ignoring it and all the following ones
rpm-build c487f7
                     in both the "download" and "build" phases. This is useful for debugging
rpm-build c487f7
                     and development. For instance, you can build all the dependencies, but
rpm-build c487f7
                     stop at the main application so that you can then do a build from a
rpm-build c487f7
                     pre-existing checkout. Implies --build-only.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--repo=DIR</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    When build is done, run export the result to this repository.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>-s</option></term>
rpm-build c487f7
                <term><option>--subject=SUBJECT</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    One line subject for the commit message.
rpm-build c487f7
                    Used when exporting the build results.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>-b</option></term>
rpm-build c487f7
                <term><option>--body=BODY</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Full description for the commit message.
rpm-build c487f7
                    Used when exporting the build results.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--collection-id=COLLECTION-ID</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Set as the collection ID of the repository. Setting a globally
rpm-build c487f7
                    unique collection ID allows the apps in the repository to be shared over
rpm-build c487f7
                    peer to peer systems without needing further configuration.
rpm-build c487f7
                    If building in an existing repository, the collection ID
rpm-build c487f7
                    must match the existing configured collection ID for that
rpm-build c487f7
                    repository.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--gpg-sign=KEYID</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Sign the commit with this GPG key.
rpm-build c487f7
                    Used when exporting the build results.
rpm-build c487f7
                    This option can be used multiple times.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--gpg-homedir=PATH</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    GPG Homedir to use when looking for keyrings.
rpm-build c487f7
                    Used when exporting the build results.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--jobs=JOBS</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                     Limit the number of parallel jobs during the build.
rpm-build c487f7
                     The default is the number of CPUs on the machine.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--force-clean</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Erase the previous contents of DIRECTORY if it is
rpm-build c487f7
                    not empty.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--sandbox</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Disable the possibility to specify build-args that
rpm-build c487f7
                    are passed to flatpak build. This means the build
rpm-build c487f7
                    process can't break out of its sandbox, and is
rpm-build c487f7
                    useful when building less trusted software.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--allow-missing-runtimes</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Do not immediately fail if the sdk or platform runtimes
rpm-build c487f7
                    are not installed on this system. Attempting to build any
rpm-build c487f7
                    manifest modules will still fail if the sdk is missing, but
rpm-build c487f7
                    may be useful for apps that install files without a sandbox
rpm-build c487f7
                    build.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--rebuild-on-sdk-change</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                  Record the exact version of the sdk in the cache, and rebuild everything
rpm-build c487f7
                  if it changes. This is useful if you're building against an API-unstable
rpm-build c487f7
                  runtime, like a nightly build.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--skip-if-unchanged</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                  If the json is unchanged since the last build of this filename, then
rpm-build c487f7
                  do nothing, and return exit code 42.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--mirror-screenshots-url=URL</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                  Mirror any screenshots in the appstream and rewrite the appstream xml
rpm-build c487f7
                  as if they were on the specified URL. The resulting files will
rpm-build c487f7
                  be stored in the "screenshots" subdirectory in the app directory
rpm-build c487f7
                  and needs to be copied to the specified URL for the appdata to work.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--extra-sources=SOURCE-DIR</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                  When downloading sources (archives, files, git, bzr, svn), look in this
rpm-build c487f7
                  directory for pre-existing copies and use them instead of downloading.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--extra-sources-url=URL</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                  When downloading sources (archives, files, git, bzr, svn), look at this url
rpm-build c487f7
                  for mirrored downloads before downloading from the original url.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--from-git=GIT</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                  Look for the manifest in the given git repository. If this option is
rpm-build c487f7
                  given, MANIFEST is interpreted as a relative path inside the repository.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--from-git-branch=BRANCH</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                  The branch to use with --from-git.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--no-shallow-clone</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                  Don't use shallow clones when mirroring git repos.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--add-tag=TAG</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                  Add this tag to the tags list of the manifest before building.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--remove-tag=TAG</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                  Remove this tag to the tags list of the manifest before building. The remove
rpm-build c487f7
                  happen before processing the --add-tag option, so if both are specified, then
rpm-build c487f7
                  --app-tag wins.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--install-deps-from=REMOTE</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Install/update build required dependencies from the specified remote.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--install-deps-only</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Stop after downloading dependencies.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--install</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    When the build is finished, install the result locally.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--user</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Install the dependencies in a per-user installation.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--system</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Install the dependencies in the default system-wide installation.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
            <varlistentry>
rpm-build c487f7
                <term><option>--installation=NAME</option></term>
rpm-build c487f7
rpm-build c487f7
                <listitem><para>
rpm-build c487f7
                    Install the dependencies in a system-wide installation
rpm-build c487f7
                    specified by <arg choice="plain">NAME</arg> among those defined in
rpm-build c487f7
                    <filename>/etc/flatpak/installations.d/</filename>. Using
rpm-build c487f7
                    <arg choice="plain">--installation=default</arg> is equivalent to using
rpm-build c487f7
                    <arg choice="plain">--system</arg>.
rpm-build c487f7
                </para></listitem>
rpm-build c487f7
            </varlistentry>
rpm-build c487f7
rpm-build c487f7
          </variablelist>
rpm-build c487f7
    </refsect1>
rpm-build c487f7
rpm-build c487f7
    <refsect1>
rpm-build c487f7
        <title>Caching</title>
rpm-build c487f7
rpm-build c487f7
        <para>
rpm-build c487f7
            flatpak-builder caches sources and partial build results
rpm-build c487f7
            in the state directory (defaulting to the .flatpak-builder
rpm-build c487f7
            subdirectory of the current directory). If you use
rpm-build c487f7
            <option>--keep-build-dirs</option>, build directories for
rpm-build c487f7
            each module are also stored here.
rpm-build c487f7
        </para>
rpm-build c487f7
rpm-build c487f7
        <para>
rpm-build c487f7
            It is safe to remove the state directory. This will force a full build the next time you build.
rpm-build c487f7
        </para>
rpm-build c487f7
rpm-build c487f7
    </refsect1>
rpm-build c487f7
rpm-build c487f7
    <refsect1>
rpm-build c487f7
        <title>Examples</title>
rpm-build c487f7
rpm-build c487f7
        <para>
rpm-build c487f7
            <command>$ flatpak-builder my-app-dir manifest.json</command>
rpm-build c487f7
        </para>
rpm-build c487f7
rpm-build c487f7
        <para>
rpm-build c487f7
            Example manifest file:
rpm-build c487f7
        </para>
rpm-build c487f7
<programlisting>
rpm-build c487f7
{
rpm-build c487f7
    "id": "org.test.TestApp",
rpm-build c487f7
    "runtime": "org.freedesktop.Platform",
rpm-build c487f7
    "runtime-version": "1.2",
rpm-build c487f7
    "sdk": "org.freedesktop.Sdk",
rpm-build c487f7
    "command": "test",
rpm-build c487f7
    "cleanup": [ "/include", "*.la" ],
rpm-build c487f7
    "build-options" : {
rpm-build c487f7
        "cflags": "-O2 -g",
rpm-build c487f7
        "cxxflags": "-O2 -g",
rpm-build c487f7
        "env": {
rpm-build c487f7
            "V": "1"
rpm-build c487f7
        },
rpm-build c487f7
        "arch": {
rpm-build c487f7
            "x86_64": {
rpm-build c487f7
                "cflags": "-O3 -g",
rpm-build c487f7
            }
rpm-build c487f7
        }
rpm-build c487f7
    },
rpm-build c487f7
    "modules": [
rpm-build c487f7
        {
rpm-build c487f7
            "name": "pygobject",
rpm-build c487f7
            "config-opts": [ "--disable-introspection" ],
rpm-build c487f7
            "sources": [
rpm-build c487f7
                {
rpm-build c487f7
                    "type": "archive",
rpm-build c487f7
                    "url": "http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.28/pygobject-2.28.6.tar.xz",
rpm-build c487f7
                    "sha256": "fb8a1d4f665130a125011659bd347c7339c944232163dbb9a34fd0686577adb8"
rpm-build c487f7
                },
rpm-build c487f7
                {
rpm-build c487f7
                    "type": "patch",
rpm-build c487f7
                    "path": "required-pygobject-fix.patch"
rpm-build c487f7
                },
rpm-build c487f7
                {
rpm-build c487f7
                    "type": "file",
rpm-build c487f7
                    "path": "pygobject-extra-file",
rpm-build c487f7
                    "dest-filename": "extra-file"
rpm-build c487f7
                }
rpm-build c487f7
            ]
rpm-build c487f7
        },
rpm-build c487f7
        {
rpm-build c487f7
            "name": "babl",
rpm-build c487f7
            "build-options" : { "cxxflags": "-O2 -g -std=c++11" },
rpm-build c487f7
            "cleanup": [ "/bin" ],
rpm-build c487f7
            "sources": [
rpm-build c487f7
                {
rpm-build c487f7
                    "type": "git",
rpm-build c487f7
                    "url": "https://gitlab.gnome.org/GNOME/babl.git"
rpm-build c487f7
                }
rpm-build c487f7
            ]
rpm-build c487f7
        },
rpm-build c487f7
        {
rpm-build c487f7
            "name": "testapp",
rpm-build c487f7
            "sources": [
rpm-build c487f7
                {
rpm-build c487f7
                    "type": "bzr",
rpm-build c487f7
                    "url": "lp:testapp"
rpm-build c487f7
                }
rpm-build c487f7
            ]
rpm-build c487f7
        }
rpm-build c487f7
    ]
rpm-build c487f7
}
rpm-build c487f7
</programlisting>
rpm-build c487f7
rpm-build c487f7
    </refsect1>
rpm-build c487f7
rpm-build c487f7
    <refsect1>
rpm-build c487f7
        <title>See also</title>
rpm-build c487f7
rpm-build c487f7
        <para>
rpm-build c487f7
            <citerefentry><refentrytitle>flatpak</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
rpm-build c487f7
            <citerefentry><refentrytitle>flatpak-manifest</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
rpm-build c487f7
            <citerefentry><refentrytitle>flatpak-build-init</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
rpm-build c487f7
            <citerefentry><refentrytitle>flatpak-build</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
rpm-build c487f7
            <citerefentry><refentrytitle>flatpak-build-finish</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
rpm-build c487f7
            <citerefentry><refentrytitle>flatpak-build-export</refentrytitle><manvolnum>1</manvolnum></citerefentry>
rpm-build c487f7
        </para>
rpm-build c487f7
rpm-build c487f7
    </refsect1>
rpm-build c487f7
rpm-build c487f7
</refentry>