FLATPAK-BUILD-INIT(1)

πŸ’– FLATPAK-BUILD-INIT πŸ’–

okay bestie, we're doing a flatpak man page, this one's flatpak build-init from section 1 of the flatpak manual, and it's literally the "start a build dir from scratch" button. let's go πŸŽ€


✨ NAME ✨

flatpak-build-init β€” initializes a build directory. that's it, that's the whole job, and she does it flawlessly πŸ’…


🌸 SYNOPSIS 🌸

flatpak build-init [OPTION...] DIRECTORY APPNAME SDK RUNTIME [BRANCH]

πŸ¦‹ DESCRIPTION πŸ¦‹

So. It initializes a separate build directory. Let's break down the args, bestie, because they all matter:

  • DIRECTORY β€” the name of the directory. that's where the magic happens.
  • APPNAME β€” the application id of the app that will be built.
  • SDK and RUNTIME β€” these specify the sdk and runtime that the application should be built against and run in. (yes, both, you need both, no skipping πŸ™ˆ)
  • BRANCH β€” specifies the version of sdk and runtime. optional but iconic.

It initializes a directory as a build directory which can be used as the target directory of flatpak build. It creates a metadata inside the given directory. Additionally, empty files and var subdirectories are created. little baby build dir, all set up πŸ₯Ί

⚠️ and listen: it is an error to run build-init on a directory that has already been initialized as a build directory. she will NOT be doing a redo. she said no. (unless you pass --update, keep reading bestie, we get there πŸ‘€)

πŸ’… OPTIONS πŸ’…

The following options are understood β€” aka the whole menu, and we are NOT skimming, we're reading every single one like the good students we are πŸ“šβœ¨

  • -h, --help β€” Show help options and exit. the classic escape hatch 🫢
  • --arch=ARCH β€” The architecture to use. Wanna know what's even available on your machine? Check flatpak --supported-arches for architectures supported by the host. slay, know your options.
  • -v, --var=RUNTIME β€” Initialize var from the named runtime.
  • -w, --writable-sdk β€” Initialize /usr with a copy of the sdk, which is writable during flatpak build. This can be used if you need to install build tools in /usr during the build. Heads up tho: this is stored in the usr subdirectory of the app dir, but will not be part of the final app. it's giving "backstage pass, not the album" πŸ’€
  • --tag=TAG β€” Add a tag to the metadata file. This option can be used multiple times. stack 'em, bestie πŸ”₯
  • --sdk-extension=EXTENSION β€” When using --writable-sdk, in addition to the sdk, also install the specified extension. This option can be used multiple times. yes, again, as many as you want.
  • --extension=NAME=VARIABLE[=VALUE] β€” Add extension point info. note the =VALUE part is optional, iykyk πŸ‘‘
  • --sdk-dir β€” Specify a custom subdirectory to use instead of usr for --writable-sdk.
  • --update β€” Re-initialize the sdk and var, don't fail if already initialized. THIS is the one that rescues you from the "already initialized" error up there. she's forgiving after all πŸ˜­πŸ’–
  • --base=APP β€” Initialize the application with files from another specified application. building on someone else's shoulders, main character energy.
  • --base-version=VERSION β€” Specify the version to use for --base. If not specified, will default to "master". (yes, "master", quoted and everything, that's the default, we don't make the rules ✨)
  • --base-extension=EXTENSION β€” When using --base, also install the specified extension from the app. This option can be used multiple times. group chat rules: multiples allowed.
  • --type=TYPE β€” This can be used to build different types of things. The default is "app" which is a regular app, but "runtime" creates a runtime based on an existing runtime, and "extension" creates an extension for an app or runtime. three vibes, one flag 🌈
  • --extension-tag=EXTENSION_TAG β€” If building an extension, the tag to use when searching for the mount point of the extension.
  • --verbose β€” Print debug information during command processing. nosy (affectionate) πŸ“
  • --ostree-verbose β€” Print OSTree debug information during command processing. even nosier, and honestly? respect πŸ’œ

πŸ”₯ EXAMPLES πŸ”₯

here's the whole thing in action, copy-paste it, live your truth:

$ flatpak build-init /build/my-app org.example.myapp org.gnome.Sdk org.gnome.Platform 3.36

see how DIRECTORY APPNAME SDK RUNTIME BRANCH line up? 3.36 is the branch, being iconic at the end πŸ’«


🧚 SEE ALSO 🧚

the whole friend group fr fr, go read them next 🫢


and that's a wrap!! this page came to you from flatpak, part of the FLATPAK BUILD-INIT(1) manual β€” go initialize something cute, and remember: no cap, read the options, --update exists, periodt πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from