Understanding a Build Configuration Example
This chapter uses linglong.yaml from the master branch of the Linyaps repository to explain how a real project organizes package information, sources, build commands, and build dependencies. For line-by-line comparison, the excerpts are pinned to commit 2bd8bf49.
Each section quotes the original configuration unchanged before explaining its fields and commands. Because master changes continuously, follow the upstream file if this page differs from it. See Introduction to the Build Configuration File for complete field definitions.
Header and Format Version
# SPDX-FileCopyrightText: 2025 - 2026 UnionTech Software Technology Co., Ltd.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
version: '1'The first three lines are SPDX copyright and license declarations. version: '1' selects version 1 of the linglong.yaml format; it is not the application version.
Package Information
package:
id: cn.org.linyaps.builder.utils
name: ll-builder-utils
version: 0.0.3.0
kind: app
description: |
Utils for ll-builder| Field | Original value | Description |
|---|---|---|
id | cn.org.linyaps.builder.utils | Unique package identifier in reverse-domain notation |
name | ll-builder-utils | Package name |
version | 0.0.3.0 | Version built by this configuration |
kind | app | Indicates that the package has an executable entry point |
description | Utils for ll-builder | Describes utilities provided for ll-builder |
Although ll-builder-utils is not a desktop application, it provides executable commands and therefore uses kind: app.
Launch Command
command: [/opt/apps/cn.org.linyaps.builder.utils/files/bin/ll-builder-export]command specifies the default package entry point. It launches /opt/apps/cn.org.linyaps.builder.utils/files/bin/ll-builder-export, so that executable must exist in the build result.
/opt/apps/cn.org.linyaps.builder.utils/files is the application's directory in the runtime environment and corresponds to $PREFIX during the build.
Base
base: org.deepin.base/25.2.0The configuration uses org.deepin.base/25.2.0 as its base environment. The Base provides fundamental components required for building and running.
There is no runtime field, meaning that the package needs no additional Runtime. See Runtime Components for Base and Runtime selection.
Sources
sources:
- kind: archive
url: https://github.com/erofs/erofs-utils/archive/refs/tags/v1.8.6.tar.gz
digest: 5b221dc3fd6d151425b30534ede46fb7a90dc233a8659cba0372796b0a066547
name: erofs-utils
- kind: archive
url: https://github.com/libfuse/libfuse/releases/download/fuse-3.17.1/fuse-3.17.1.tar.gz
digest: 2d8ae87a4525fbfa1db5e5eb010ff6f38140627a7004554ed88411c1843d51b2
name: fuse
- kind: archive
url: https://github.com/OpenAtom-Linyaps/linyaps-box/archive/refs/tags/2.1.2.tar.gz
digest: 70c908e3a2397d195d64d606b886c9635b13a461beea70a6cc5317e0bb6e9589
name: linyaps-boxThe configuration declares three archive sources:
name | Version in URL | Build use |
|---|---|---|
erofs-utils | v1.8.6 | Build EROFS- and FUSE-related tools |
fuse | 3.17.1 | Build the static FUSE library |
linyaps-box | 2.1.2 | Build static linyaps-box |
url is the archive address, digest verifies the download, and name determines the source-directory name under /project/linglong/sources.
An extracted archive may still contain a versioned directory. For example, name: fuse is built from /project/linglong/sources/fuse/fuse-3.17.1. When changing a source version, update the URL, digest, and paths used by build together.
Build Process
The build script performs the following operations in dependency order.
Print the Installation Prefix
build: |
echo "$PREFIX"echo "$PREFIX" prints the application's installation prefix so the build log shows where final artifacts should be installed.
Build the Static FUSE Library
# build libfuse static library
cd /project/linglong/sources/fuse/fuse-3.17.1
patch lib/mount.c /project/apps/ll-builder-utils/patch/libfuse.patch
mkdir build || true
cd build
meson setup ../
meson configure --default-library static -D utils=false -D examples=false -D tests=false -D disable-libc-symbol-version=false
ninja && ninja install- Enter the
fuse-3.17.1source directory. - Modify
lib/mount.cwith the project'sapps/ll-builder-utils/patch/libfuse.patch. - Create and enter
build;mkdir build || truecontinues if the directory exists. - Initialize it with
meson setup ../. - Configure static libraries, disable utilities, examples, and tests, and set the libc symbol-version option explicitly.
- Build with
ninjaand install only after a successful build.
This produces the static FUSE library required by later components.
Build the Static erofsfuse Library
# build erofsfuse static library
cd /project/linglong/sources/erofs-utils/erofs-utils-1.8.6
./autogen.sh
./configure -with-libzstd --enable-fuse --enable-static-fuse --with-libdeflate --without-xxhash libdeflate_LIBS=-ldeflate libdeflate_CFLAGS=-ldeflate
make -j$(nproc)
make install- Enter the
erofs-utils-1.8.6source directory. - Run
./autogen.shto generate the Autotools build files. - The original
./configureenables zstd, FUSE, static FUSE, and libdeflate, disables xxHash, and sets libdeflate link and compile arguments explicitly. - Build in parallel with the available CPU cores.
- Install the result for later steps.
Build Static linyaps-box
# build static ll-box
cd /project/linglong/sources/linyaps-box/linyaps-box-2.1.2/
cmake --preset static
cmake --build build-static -j$(nproc)
cmake --install build-static --prefix=$PREFIX- Enter the
linyaps-box-2.1.2source directory. - Configure with the project's
staticCMake preset. - Build
build-staticin parallel. - Install into the current application's
$PREFIX.
Build the Current Linyaps Project
cd /project
cmake -B build-linglong -DENABLE_CPM=false -DENABLE_TESTING=false -DBUILD_LINGLONG_BUILDER_UTILS_IN_BOX=true -DAGGRESSIVE_UAB_SIZE=ON
cmake --build build-linglong -j$(nproc)
cmake --install build-linglong --prefix=$PREFIX
install /usr/local/bin/mkfs.erofs $PREFIX/bin/- Return to the Linyaps source root with
cd /project. - Configure CMake with CPM and tests disabled, Builder Utils enabled inside the container, and
AGGRESSIVE_UAB_SIZE=ON. - Build the current project in parallel.
- Install the result into the current application directory.
- Collect the previously built
mkfs.erofsin the final package'sbindirectory.
ll-builder-export, which is referenced by command, and every other required runtime tool must enter $PREFIX during final installation.
Build Dependencies
buildext:
apt:
build_depends:
[
patch,
meson,
libtool,
pkg-config,
uuid-dev,
libdeflate-dev,
libzstd-dev,
nlohmann-json3-dev,
libyaml-cpp-dev,
liblz4-dev,
liblzma-dev,
libselinux1-dev,
libpcre2-dev,
libelf-dev,
libcap-dev,
libcli11-dev,
libgtest-dev,
libsystemd-dev,
libfmt-dev,
libexpected-dev
]buildext.apt.build_depends declares deb packages installed in the build environment:
patch,meson,libtool, andpkg-configprovide build tools.uuid-dev,libdeflate-dev,libzstd-dev,liblz4-dev, andliblzma-devprovide filesystem- and compression-related development files.nlohmann-json3-dev,libyaml-cpp-dev,libselinux1-dev,libpcre2-dev,libelf-dev,libcap-dev,libcli11-dev,libsystemd-dev,libfmt-dev, andlibexpected-devprovide required development libraries.libgtest-devprovides GoogleTest development files.
These packages are for building and do not automatically become final application content merely because they appear in build_depends. Files distributed with the application must still be installed into $PREFIX by build.
Summary
A source build normally requires build to:
- Enter source directories based on
sources.nameand the extracted archive layout. - Prepare sources by applying patches, generating
configure, or performing other project-specific preparation. - Configure the build with CMake, Meson, Autotools, qmake, or the project's existing build system, setting the installation prefix to
${PREFIX}. - Compile sources, optionally in parallel with
$(nproc). - Install artifacts such as executables, libraries, and resources into
${PREFIX}, not directly into/usrin the build container. - Collect extra files such as tools, desktop files, icons, or resources that the build system did not install automatically.
Standard build and installation procedures can usually be reused:
# CMake
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=${PREFIX}
cmake --build build
cmake --install build
# Meson
meson setup build --prefix=${PREFIX}
meson compile -C build
meson install -C build
# Autotools
./configure --prefix=${PREFIX}
make -j$(nproc)
make installIf source code supports a conventional build system and configurable installation prefix, its existing commands can usually be moved into the build field without rewriting the build system for Linyaps. Add the source declaration, Base and Runtime, build dependencies, and launch command, and ensure that every required runtime file enters ${PREFIX}.