flatpak-build-export - Linux


Overview

flatpak-build-export is a command used to export a Flatpak bundle from a source tarball. It extracts the source tarball, builds the Flatpak bundle, and exports it as a Flatpak repository. This command is particularly useful for creating Flatpak bundles that can be shared with other users or deployed on different systems.

Syntax

flatpak-build-export [options] <source-tarball> <output-dir>

Options/Flags

  • --arch=<architecture>: Specify the target architecture for the Flatpak bundle (default: x86_64).
  • --build-args=<build-argument>: Set build arguments to be passed to the Flatpak manifest.
  • --help: Display help information and exit.
  • --install: Install the built Flatpak bundle into the local system.
  • --log-level=<log-level>: Set the log level for the build process (default: info).
  • --subject: Set the subject name for the generated bundle.
  • --version: Display version information and exit.

Examples

Example 1: Export a Flatpak bundle for a simple application

flatpak-build-export my-app.tar.xz output-dir

Example 2: Export a Flatpak bundle for an application with multiple architectures

flatpak-build-export my-app.tar.xz output-dir \
--arch=x86_64 --arch=aarch64

Example 3: Export and install a Flatpak bundle

flatpak-build-export my-app.tar.xz output-dir --install

Common Issues

  • Missing dependencies: Ensure that the source tarball includes all necessary dependencies for building the Flatpak bundle.
  • Build errors: If the build process fails, check the error logs for detailed information about the cause.
  • Invalid source tarball: Make sure that the source tarball is in a valid Flatpak manifest format.

Integration

flatpak-build-export can be integrated with other commands to automate the build and export process. For example:

tar -cvf my-app.tar -C my-app-src .
flatpak-build-export my-app.tar.xz output-dir
rm my-app.tar.xz

This script creates a tarball of the application source, exports a Flatpak bundle from it, and then deletes the tarball.

Related Commands

  • flatpak-install: Installs a Flatpak bundle.
  • flatpak-update: Updates a Flatpak bundle.
  • flatpak-remove: Removes a Flatpak bundle.