Documents
add-package
add-package
Type
External
Status
Published
Created
Jun 13, 2026
Updated
Jun 13, 2026
Source
View

Adding a Package#

Entry-point workflow for adding any software package to the Dakota image.

When NOT to Use#

  • Removing a package → remove-package.md
  • Updating an existing package's version → update-refs.md
  • Debugging a build failure → debugging.md
  • BST variable/kind reference only → buildstream.md

Agent Quick-Start#

# Create element file manually at elements/bluefin/<name>.bst
# Use an existing element as a template, e.g.:
cp elements/bluefin/glow.bst elements/bluefin/<name>.bst
# Edit to match the new package's source and install paths

There are no scaffold scripts. Copy an existing element of the appropriate kind as a starting point.

Historical path note: new Dakota packages still live under
elements/bluefin/ and are added to elements/bluefin/deps.bst. That path
name is historical only — do not translate package work into dnf, RPM, or
Containerfile-overlay steps.

Choose Element Kind#

Source typeBuildStream kindSub-skill
Pre-built binary/tarballmanual + tar/remote sourcepackaging-binaries.md
Source with Meson buildmeson
Source with Makefilemake
Source with autotoolsautotools
Source with CMakecmake
Rust/Cargo projectmake + cargo2 sourcespackaging-rust.md
Go projectmake or manual + GOPATH/go_modulepackaging-go.md
Zig projectmanual + offline cachepackaging-zig.md
GNOME Shell extensionimport/meson/make + extension layoutpackaging-gnome-extensions.md
Config files onlyimport

Workflow#

  1. Create element at elements/bluefin/<name>.bst (copy a similar existing element as a base)
  2. Add to deps — add bluefin/<name>.bst to depends: in elements/bluefin/deps.bst
  3. Add source alias — if the download domain is new, add an alias to include/aliases.yml
  4. Validate graphjust validate (full graph check)
  5. Build elementjust bst build bluefin/<name>.bst
  6. Full image testjust build or just show-me-the-future

Systemd Service Installation#

Services bundled with a package need three things:

WhatWhereNotes
Service file%{indep-libdir}/systemd/system/Patch /usr/sbin to /usr/bin; remove EnvironmentFile=/etc/default/* lines
Preset file%{indep-libdir}/systemd/system-preset/80-<name>.presetContent: enable <service-name>.service
Binaries%{bindir}Never /usr/sbin — GNOME OS uses merged-usr

Enable services via preset files, never systemctl enable.

install-commands:
  - |
    sed -e 's|/usr/sbin/tailscaled|/usr/bin/tailscaled|g' \
        -e '/^EnvironmentFile=/d' \
        upstream.service > upstream.service.patched
    install -Dm644 -t "%{install-root}%{indep-libdir}/systemd/system" upstream.service.patched
    mv "%{install-root}%{indep-libdir}/systemd/system/upstream.service.patched" \
       "%{install-root}%{indep-libdir}/systemd/system/upstream.service"
  - |
    install -Dm644 /dev/stdin "%{install-root}%{indep-libdir}/systemd/system-preset/80-name.preset" <<'PRESET'
    enable service-name.service
    PRESET

Common Mistakes#

MistakeFix
Missing strip-binaries: ""Required for non-ELF elements — build fails otherwise
Using /usr/sbinAlways /usr/bin — GNOME OS merged-usr
EnvironmentFile=/etc/default/...GNOME OS doesn't use /etc/default/; remove from upstream service files
Variables in source URLsBuildStream doesn't support this; use literal URLs with aliases
Missing %{install-extra}Must be last install-command
Trying to add the package in Containerfile/JustfilePackage and image-content changes belong in .bst elements plus deps.bst
Forgot to add element to deps.bstElement builds but won't be in the image
Wrong dependency stackUse freedesktop-sdk.bst:public-stacks/runtime-minimal.bst for runtime deps

Lessons Learned#

strip-binaries: "" is required for all non-ELF staging directories (2026-06-07)#

BST's default behavior calls strip on every binary in the staging area. If an element installs any file that is not a valid ELF binary (fonts, config files, shell scripts, pre-built tarballs, .so stubs), the build fails at the strip step with an obscure error. Always set strip-binaries: "" in the element's variables: block for:

  • Font elements (.ttf, .otf, .woff2)
  • Config-only elements (kind: import)
  • Pre-built binary elements where upstream provides already-stripped binaries
  • Any element where file -b <binary> returns something other than ELF
variables:
  strip-binaries: ""

BST variables cannot be used in source URL fields (2026-06-07)#

Unlike install commands where %{version} expands correctly, BuildStream does NOT expand variables inside sources[].url: fields. Use include/aliases.yml to define a URL alias, then reference the alias:

# ❌ WRONG — variable expansion does not work in source URLs
sources:
- kind: tar
  url: https://github.com/owner/project/releases/v%{version}.tar.gz

# ✅ CORRECT — use an alias
sources:
- kind: tar
  url: alias:project-releases/v%{version}.tar.gz
  # alias defined in include/aliases.yml as:
  # project-releases: https://github.com/owner/project/releases/

Service preset files must use /usr/lib path, not /etc (2026-06-07)#

Dakota is a GNOME OS-model image. Service preset files installed at /etc/systemd/system-preset/ are ignored at boot. Presets must be at the %{indep-libdir} path:

# ✅ correct
install -Dm644 /dev/stdin "%{install-root}%{indep-libdir}/systemd/system-preset/80-name.preset"

# ❌ wrong — ignored at boot
install -Dm644 /dev/stdin "%{install-root}%{sysconfdir}/systemd/system-preset/80-name.preset"