Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

448. Canonical build shapes

Almost every build.sh in the tree is one of a handful of shapes, one per build system, changed only where the project needs it. This appendix is for anyone reading a recipe or writing a new one: it shows each shape, from autotools to a port that only copies files, and says what kpkg and the phase environment have already done before a recipe’s first line runs. Each section links to the part of Writing ports that explains the shape in full, and the flag glossary explains the switches one by one.

What every shape can count on

A build.sh is sourced by bash under set -e, with the unpacked source as its working directory. kpkg sets these shell variables first, among others; they are not exported, so a program the script starts does not see them:

$name, $version, $release
The recipe’s own values, and every helper the recipe defines.
$SRC
The unpacked first source, with the archive’s top directory stripped, and the working directory.
$SRC_ROOT
The port’s work directory, /var/cache/kpkg/work/<name>, one level above $SRC. A second tarball is unpacked here, unstripped.
$PKG
The empty staging tree. Every shape installs into it, through DESTDIR=$PKG, --root=$PKG, INSTALL_ROOT=$PKG or an explicit path, and never into /.
$PORT_SRC
The port directory, where patches, vendor bundles and any other file the recipe carries are found: /ports/core/<shelf>/<name> in the chroot, or /kdos/src/<area>/<name> for a port of KDOS’s own.

Anatomy of a kpkg install shows the short script kpkg hands bash to set them, and the full list is in build.sh.

The rest comes from the phase. From 20_selfhost on, every phase’s phase.env sources script/env/chroot.env, and that file sources script/env/common.env in turn. Between them they export the compiler (CC=gcc, CXX=g++ from 30_foundation on), the release flags, the job count (MAKEFLAGS=-j$KDOS_JOBS, CMAKE_BUILD_PARALLEL_LEVEL, CARGO_BUILD_JOBS), the reproducibility settings and the defaults for the build systems that read no CFLAGS. This is the whole of chroot.env:

# Shared by the chroot phases, 20_selfhost onwards: they run inside build/fs,
# with the environment script/chroot/exec.sh cleared, and build with the
# system's own native compiler. A phase that differs unsets or overrides a
# line after sourcing this; it does not copy the file.
#
# CHROOT=1 is not set here. The orchestrator reads it from each phase.env's
# own text to pick the execution wrapper, and follows no `source`: set only in
# this file, it would run every chroot phase on the host.

export PKG_CONFIG_PATH="/usr/local/share/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/share/pkgconfig:/usr/lib/pkgconfig:/usr/lib64/pkgconfig"${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}

# THE COMPILER IS NAMED, NOT DISCOVERED. autoconf's AC_PROG_CC walks a
# preference list, and some of them put clang FIRST — potrace's does. clang is
# a port, so the moment it is installed those recipes silently change
# toolchain, and the failure is `C compiler cannot create executables` from a
# configure that had a working gcc in $PATH the whole time. A distro that
# builds itself cannot have its toolchain depend on which ports are installed.
export CC=gcc
export CXX=g++

# THE RELEASE FLAGS every port builds with; a recipe adds to them and never
# replaces them. The policy, and what is ruled out, is in decisions.md.
# - -O2 is the level. A recipe raises a hot port to -O3 with
#   ${CFLAGS/-O2/-O3}; CMake's Release -O3 comes after these and wins, meson's
#   -O3 comes before them and loses.
# - -fno-semantic-interposition. Under -fPIC, GCC may not inline or clone an
#   exported function into its callers, because a preloaded library could
#   replace it; with it, it may. Only a call within one translation unit is
#   affected: an LD_PRELOAD still replaces any function called from another
#   file, and exported data is still read through the GOT.
# - -fstack-clash-protection probes each large stack allocation page by page,
#   so it cannot step over the guard page.
# - -Wl,-O1,--sort-common: smaller hash tables and common symbols sorted by
#   alignment, at no cost.
# - --as-needed records a DT_NEEDED only for a library the object uses. A
#   port that names a library before the objects that use it, or needs a
#   library only for its constructor, adds -Wl,--no-as-needed.
# - -z,now makes the GOT read-only after load. It also stops musl deferring
#   an unresolved symbol in a library opened with RTLD_LAZY, so a plugin that
#   takes symbols from a library loaded after it adds -Wl,-z,lazy.
# - -z,pack-relative-relocs writes relative relocations as DT_RELR, which
#   musl's loader reads from 1.2.4 and binutils writes from 2.38. A C library
#   older than that cannot load what this tree links.
# - -D_FORTIFY_SOURCE=2 with -isystem /usr/include/fortify: musl's own headers
#   ignore the macro, and the fortify-headers port (first in 20_selfhost)
#   puts checking wrappers for memcpy, read, snprintf and the rest in
#   /usr/include/fortify, which #include_next the real headers. A call that
#   would write past an object whose size the compiler knows traps (SIGILL)
#   at run time instead of writing. Only an optimised build is checked; at -O0 the headers pass
#   straight through. A port built before 20_selfhost installs the headers,
#   or one whose recipe drops the include directory, is built unchecked.
# - -D_GLIBCXX_ASSERTIONS turns on libstdc++'s bounds and precondition checks
#   (vector::operator[], string::front, an empty optional); a failed one
#   aborts the program with the assertion's text.
# The FORTRAN flags are the same set less the C-only ones; without them a
# configure falls back to "-g -O2" and records it (R's Makeconf, cfitsio).
export CFLAGS="-O2 -pipe -std=gnu11 -fPIC -fno-semantic-interposition -fstack-clash-protection -D_FORTIFY_SOURCE=2 -isystem /usr/include/fortify"
export CXXFLAGS="-O2 -pipe -fPIC -fno-semantic-interposition -fstack-clash-protection -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS -isystem /usr/include/fortify"
export FFLAGS="-O2 -pipe -fPIC -fno-semantic-interposition -fstack-clash-protection"
export FCFLAGS="$FFLAGS"
export LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,now,-z,pack-relative-relocs"

source "${BASH_SOURCE[0]%/*}/common.env"

# Defaults for the build systems that do not read CFLAGS, set after
# common.env so the Go lines carry its -ffile-prefix-map and --build-id:
# - CMAKE_BUILD_TYPE is the type of a CMake project whose recipe names none
#   (CMake 3.22 and later read it). Without it such a build takes CFLAGS alone
#   and keeps assert() on.
# - CARGO_PROFILE_RELEASE_DEBUG=0 overrides a crate whose own release profile
#   turns debug information on; with debug off, cargo also strips the
#   standard library's. No global RUSTFLAGS: it replaces a project's own
#   .cargo/config flags, and rust's and firefox's builds depend on those.
# - GOFLAGS: -trimpath takes the build paths out of the binary,
#   -buildvcs=false stops go stamping the binary with VCS state, and
#   -buildmode=pie links every executable position-independent (ET_DYN), so
#   it loads at a random address like the C programs; with CGO_ENABLED=0 Go
#   links it itself and names musl's loader as the interpreter. A recipe that
#   sets GOFLAGS itself keeps all three in it; a -buildmode on the go command
#   line (c-shared, c-archive) overrides the one here.
# - CGO_*FLAGS: without them cgo compiles C with Go's own "-O2 -g", with
#   neither the prefix map nor the hardening above. GOAMD64 stays unset: v1.
export CMAKE_BUILD_TYPE=Release
export CARGO_PROFILE_RELEASE_DEBUG=0
export GOFLAGS="-trimpath -buildvcs=false -buildmode=pie"
export CGO_CFLAGS="$CFLAGS" CGO_CXXFLAGS="$CXXFLAGS" CGO_LDFLAGS="$LDFLAGS"

# NINJA TAKES KDOS_JOBS through script/bin/ninja, which is put first on PATH
# here: it adds -j"$KDOS_JOBS" to any ninja call that names no job count, or
# under a jobserver (KDOS_JOBSERVER, common.env) hands ninja the FIFO instead,
# and runs /usr/bin/ninja. script/bin/meson, beside it, adds
# --wrap-mode=nodownload to every meson setup that chooses no wrap mode, and
# answers as a missing command until the meson port is installed. The
# directory is resolved to an absolute path because
# a phase.env is sourced by a relative one and kpkg runs build.sh from the
# source directory. It goes on only once /usr/bin/ninja exists (30_foundation
# installs it): before that, a wrapper on PATH would answer `command -v ninja`
# for a ninja that is not there, and meson or a recipe's own probe would pick
# a generator that cannot run. Each step sources this afresh, so every step
# after ninja's install has it. The host phases source host.env and never
# see it.
if [ -x /usr/bin/ninja ]; then
    _kdos_bin=$(cd "${BASH_SOURCE[0]%/*}/../bin" && pwd -P) &&
        export PATH="$_kdos_bin:$PATH"
    unset _kdos_bin
fi

# THE COMPILER CACHE, for CMake projects only, through CMake's launcher
# variables: CMake reads CMAKE_<LANG>_COMPILER_LAUNCHER from the environment
# and still records /usr/bin/gcc as the compiler. It stays off until the ccache
# port is installed (30_foundation) and when KDOS_CCACHE=0. The cache lives in
# build/ccache, outside build/fs, and a hit is byte-identical to a compile:
# - NO CCACHE_BASEDIR. It rewrites the absolute paths in the command line to
#   relative ones, so -ffile-prefix-map stops matching them and the paths in
#   the objects, and the package bytes, change.
# - COMPILERCHECK IS A STRING, NEVER mtime. kpkg pins every file's mtime to
#   SOURCE_DATE_EPOCH, so a rebuilt gcc of the same size would look unchanged
#   and serve objects its predecessor compiled. The string is every compiler
#   port's recipe hash, gcc's version and the epoch; any of them moving misses
#   the whole cache.
# - NO MASQUERADE DIRECTORY ON PATH. CMake would record /usr/lib/ccache/gcc as
#   the compiler, and that path is written into shipped CMake and pkg-config
#   files.
# - CCACHE_DISABLE=1 when off, because meson and several projects use ccache
#   whenever they find it, and would fill .cache/ccache under the build's HOME
#   inside build/fs.
if [ "${KDOS_CCACHE:-1}" = 1 ] && [ -x /usr/bin/ccache ]; then
    _cc_check=
    for _cc_port in gcc binutils llvm clang llvm21 clang21; do
        [ -r "/var/lib/kpkg/db/.recipe/$_cc_port" ] || continue
        while IFS= read -r _cc_line || [ -n "$_cc_line" ]; do
            _cc_check+="$_cc_port:$_cc_line;"
        done < "/var/lib/kpkg/db/.recipe/$_cc_port"
    done
    _cc_check+="gcc:$(gcc -dumpfullversion 2>/dev/null);epoch:$SOURCE_DATE_EPOCH"
    export CCACHE_DIR=/kdos/build/ccache
    export CCACHE_MAXSIZE=20G
    export CCACHE_COMPILERCHECK="string:$_cc_check"
    export CMAKE_C_COMPILER_LAUNCHER=ccache
    export CMAKE_CXX_COMPILER_LAUNCHER=ccache
    unset _cc_check _cc_port _cc_line
else
    export CCACHE_DISABLE=1
fi

# Autoconf's C++11 probe assigns a u8"" literal to a const char *, which GCC's
# default of C++20 rejects, so every autoconf configure would add -std=gnu++11
# to CXX and C++17 code (every Qt 6 program) would stop compiling. Set and
# empty, the cache variable records that no option is needed, and the compiler
# keeps its own default.
export ac_cv_prog_cxx_cxx11=

# THE LOCALE IS C.UTF-8, over common.env's C. Qt's tools (moc, rcc,
# qmlcachegen, kconfig_compiler) warn on every run under a locale that is not
# UTF-8, and a Sphinx or Hadrian step that reads non-ASCII text in the
# locale's encoding fails under C. Reproducibility holds: musl collates every
# locale byte by byte and formats dates in C.UTF-8 exactly as in C. GNU grep
# treats bytes that are not UTF-8 as binary data under it, so a recipe that
# greps a Latin-1 file sets LC_ALL=C on that one command.
export LANG=C.UTF-8 LC_ALL=C.UTF-8

# pip runs as root in the chroot, installing into $PKG; without this every
# pip call prints the warning against running pip as root.
export PIP_ROOT_USER_ACTION=ignore

# THE AUTOCONF SITE FILE, script/env/config.site: under --prefix=/usr it puts
# sysconfdir, localstatedir and sharedstatedir at /etc, /var and /var/lib
# unless the recipe names them. Absolute for the same reason as script/bin.
_kdos_env=$(cd "${BASH_SOURCE[0]%/*}" && pwd -P) &&
    export CONFIG_SITE="$_kdos_env/config.site"
unset _kdos_env

# RUST -sys CRATES LINK THE SYSTEM LIBRARY, from 40_lang on: each switch
# makes its crate use the library's pkg-config file instead of compiling the
# copy the crate carries, so the packaged program has a DT_NEEDED on the
# system library and takes its security fixes. A crate whose library is not
# installed, or whose pinned version the system's does not satisfy, fails its
# build script and names the library; the port then lists it in `depends`.
#   LIBGIT2_NO_VENDOR             libgit2-sys, even with vendored-libgit2
#   RUSTONIG_SYSTEM_LIBONIG       onig_sys (oniguruma)
#   LIBSQLITE3_SYS_USE_PKG_CONFIG libsqlite3-sys, even with bundled
#   ZSTD_SYS_USE_PKG_CONFIG       zstd-sys
# Off in 20_selfhost to 31_compilers: oniguruma arrives in 41_system, and
# rust and cargo-c (31_compilers) export LIBGIT2_NO_VENDOR themselves. The
# phase that sourced this file decides: its phase.env's path names it.
case ${BASH_SOURCE[1]-} in
    */phases/[23]?_*/phase.env) ;;
    *) export LIBGIT2_NO_VENDOR=1 RUSTONIG_SYSTEM_LIBONIG=1 \
           LIBSQLITE3_SYS_USE_PKG_CONFIG=1 ZSTD_SYS_USE_PKG_CONFIG=1 ;;
esac

export TERM=dumb

# The manual index is not rebuilt per install inside the build: 70_image's
# 080_whatis.sh writes every mandoc.db from scratch over the finished tree,
# so each install's merge is thrown away. kpkg prints `index skipped: man`
# where it would have run. Every other index still runs on every install.
export KPKG_SKIP_INDEX=man

# The ports every package store key depends on whether or not a recipe names
# them: the toolchain and the base userland every build runs on. A change to
# any one of them misses every stored package.
export KPKG_STORE_BASE="musl fortify-headers gcc binutils make bash coreutils grep which musl-utils sed gawk findutils diffutils patch tar xz gzip bzip2 file pkgconf m4 zlib"

script/env/chroot.env

So no shape below names a compiler, an optimisation level or a job count. A recipe that changes the flags extends them, export CFLAGS="$CFLAGS -Wno-error", and never assigns them outright, which would drop the hardening and the reproducibility flags at once; see The release flags.

After the script returns, kpkg tidies the staging tree the same way for every shape, so no recipe does any of this itself:

  1. It deletes libtool’s .la files, and the shared index files that kpkgadd rebuilds when a package is installed: the info dir, the desktop entries’ mimeinfo.cache and each font directory’s fonts.dir.
  2. It copies the source’s top-level licence files into /usr/share/licenses/<name>/.
  3. It removes the HTML and PDF manuals under /usr/share/doc, and every message catalogue, handbook and manual page in a language other than English.
  4. It takes the symbol table out of any program or library over 32 MiB.
  5. It compiles the Python bytecode.
  6. It runs the package lint, and rolls the package.

The steps are explained in What kpkg does around build.sh.

autotools

A configure script, then make. pv and acl are built with this shape, each with its own switches in place of some of these:

./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --disable-static
make
make DESTDIR=$PKG install

docs/kdos/05-developer/writing-ports.md, lines 846–848

configure takes the exported flags by itself. In the chroot phases it also reads the site file script/env/config.site, which CONFIG_SITE names, and which places sysconfdir, localstatedir and sharedstatedir at /etc, /var and /var/lib under --prefix=/usr. The shape names --sysconfdir=/etc anyway, because a recipe built outside the chroot phases does not read the site file. See autotools.

meson

meson configures into a build directory and ninja builds it:

meson setup build --prefix=/usr --sysconfdir=/etc --libdir=lib \
      --buildtype=release -Dtests=disabled -Ddocs=disabled
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build

docs/kdos/05-developer/writing-ports.md, lines 868–871

Three things in it are deliberate. --libdir=lib, because meson picks its default library directory from the machine it runs on: lib64 wherever /usr/lib64 is a real directory, and the package lint refuses a package that installs there. In the chroot /usr/lib64 is a link to lib, so the default is already lib; naming it keeps the result the same in any root. A named buildtype, because meson’s default, debug, builds -g -O0, and testing/preflight.sh fails a meson setup that names none. And every -D option spelt as the project’s meson_options.txt or meson.options spells it, because meson stops at setup on an option it does not know.

The meson and ninja the recipe runs are the tree’s wrappers in script/bin/, which chroot.env puts first on PATH once /usr/bin/ninja is installed: the first adds --wrap-mode=nodownload to a setup that chooses no wrap mode, so a missing subproject fails by name instead of being fetched, and the second adds -j$KDOS_JOBS to a ninja call that names no job count. See meson.

cmake

The reference shape uses make as CMake’s generator:

mkdir build && cd build
cmake .. -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib \
      -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF
make
make DESTDIR=$PKG install

docs/kdos/05-developer/writing-ports.md, lines 932–937

The tree’s commonest form uses Ninja instead, with CMake’s own build and install commands. The KDE Frameworks are built this way, here karchive:

cmake -S . -B build -G Ninja \
	-D CMAKE_INSTALL_PREFIX=/usr \
	-D KDE_INSTALL_LIBDIR=lib \
	-D CMAKE_BUILD_TYPE=Release \
	-D BUILD_TESTING=OFF \
	-D KDE_INSTALL_USE_QT_SYS_PATHS=ON \
	-D KF_SKIP_PO_PROCESSING=ON \
	-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build

ports/core/kf6/karchive/build.sh

-DCMAKE_POLICY_VERSION_MINIMUM=3.5, in the reference form, lets the tree’s CMake configure a project whose cmake_minimum_required is older than CMake still accepts, without a patch. Release appends -O3 -DNDEBUG after the exported flags, so a CMake port builds at -O3 with assertions off. A misspelt option is only a warning in CMake, the opposite of meson, so the log is the check. A KDE project names KDE_INSTALL_LIBDIR=lib, because ECM’s KDEInstallDirs picks lib64 by itself, apart from the tree’s GNUInstallDirs default. See cmake and A graphical application.

cargo

A Rust program builds from its vendor bundle, with no network:

tar xf $PORT_SRC/${name}-vendor-${version}.tar.xz
export CARGO_HOME="$SRC_ROOT/.cargo"
export RUSTFLAGS="-C target-feature=-crt-static"
export LIBCLANG_PATH=/usr/lib
export CARGO_NET_OFFLINE=true
cargo build --release --frozen --offline
install -Dm755 target/release/<program> $PKG/usr/bin/<program>

docs/kdos/05-developer/writing-ports.md, lines 967–973

The bundle, <name>-vendor-<version>.tar.xz, holds every crate the program needs and the cargo configuration that points cargo at them; Sources and the archive says where it comes from. The RUSTFLAGS line is required: without -crt-static, the musl target links statically, and a crate that binds a system library either fails to link or carries a private copy of it. testing/preflight.sh fails a cargo build without it. The program is copied into $PKG by hand, since cargo build installs nothing. See rust.

go

A Go program builds from its module vendor tree, also offline:

tar xf $PORT_SRC/${name}-vendor-${version}.tar.xz
export CGO_ENABLED=0
go build -mod=vendor -ldflags "-s -w" -o <program> ./cmd/<program>
install -Dm755 <program> $PKG/usr/bin/<program>

docs/kdos/05-developer/writing-ports.md, lines 1025–1028

-ldflags "-s -w" is required, because the Go linker otherwise writes DWARF and a symbol table that kpkg does not strip; testing/preflight.sh fails a go build without both. -trimpath, -buildvcs=false and -buildmode=pie come from the exported GOFLAGS, so a recipe that sets GOFLAGS itself extends it. See go.

Python, with pip

A Python package is built and installed by pip in one command. The commonest build.sh in the tree is this single line, here python3-calver’s:

pip3 install --ignore-installed --no-deps --no-index --no-build-isolation --root=$PKG --prefix=/usr .

ports/core/python/python3-calver/build.sh

A package that needs something no port provides carries it in a vendor bundle and points pip at it. python3-jinja2’s bundle holds its build backend, flit_core, and the recipe leaves out --no-build-isolation, so pip installs the backend from the bundle into a temporary environment for the build:

mkdir -p vendor
tar -xf $PORT_SRC/$name-vendor-$version.tar.xz --strip-components=1 -C vendor
pip3 install --ignore-installed --no-deps --no-index --find-links=vendor --root=$PKG --prefix=/usr .

ports/core/python-libs/python3-jinja2/build.sh

The other switches keep pip away from the network and from the live root: --no-index stops it consulting the package index, and --find-links=vendor points it at the bundle; --no-deps installs the named distribution alone; --no-build-isolation builds with the backends already installed as ports; and --ignore-installed with --root=$PKG writes into the staging tree without uninstalling the copy the build root holds. kpkg compiles the bytecode afterwards. See The three Python keys and Python, Perl, Haskell, Node and OCaml modules.

qmake

A Qt project that ships a .pro file:

qmake6 CONFIG+=release QMAKE_CFLAGS_RELEASE="$CFLAGS" QMAKE_CXXFLAGS_RELEASE="$CXXFLAGS" \
       QMAKE_LFLAGS_RELEASE="$LDFLAGS" PREFIX=/usr
make
make INSTALL_ROOT=$PKG install

docs/kdos/05-developer/writing-ports.md, lines 1080–1083

qmake reads no flags from the environment, so the three QMAKE_*_RELEASE variables hand it the exported ones, and CONFIG+=release keeps a debug build out. The install goes to INSTALL_ROOT, qmake’s name for the staging directory. See qmake.

Perl modules

A CPAN module with a Makefile.PL is built by ExtUtils::MakeMaker. Most perl-* ports are this script exactly, here perl-authen-sasl’s:

perl Makefile.PL INSTALLDIRS=vendor
make
make DESTDIR=$PKG install
find "$PKG" -name .packlist -delete
find "$PKG" -name perllocal.pod -delete
find "$PKG" -type d -empty -delete

ports/core/perl-cpan/perl-authen-sasl/build.sh

INSTALLDIRS=vendor installs the module into perl’s vendor directories, /usr/share/perl5/vendor_perl and /usr/lib/perl5/vendor_perl, rather than the site_perl ones, which by Perl’s convention are for modules installed locally. The first two find lines remove what MakeMaker writes for a local install: .packlist, the list of files the install wrote, and perllocal.pod, one file every module’s install appends to, which two packages would both claim, and which kpkgadd would refuse as a conflict. The third removes the directories those deletions leave empty. An XS module takes perl’s own recorded compiler settings, so the recipe adds no flags. See Python, Perl, Haskell, Node and OCaml modules.

Plain make

A project with only a makefile:

export CFLAGS="$CFLAGS -Wno-error"
make PREFIX=/usr
make DESTDIR=$PKG PREFIX=/usr install

docs/kdos/05-developer/writing-ports.md, lines 1161–1163

The flags are exported, not passed as make arguments. A variable on the make command line overrides the makefile’s own assignment of it, so passing CFLAGS=... there would discard whatever the makefile itself puts in CFLAGS, its -fPIC or feature defines included. Read the makefile before relying on this: one that assigns CFLAGS outright ignores the environment, and then the variable is passed on the command line after all. See make-only.

Install only

A port whose source needs no build, such as a font, a script or a set of data files, is copied into place with install. font-carlito’s is the whole recipe:

install -dm755 $PKG/usr/share/fonts/carlito
install -m644 Carlito-*.ttf $PKG/usr/share/fonts/carlito/
install -Dm644 LICENSE $PKG/usr/share/licenses/$name/LICENSE

ports/core/fonts/font-carlito/build.sh

install -m sets each file’s mode explicitly, -D creates the directories above the target, and -d creates a directory alone. kpkg would copy a top-level LICENSE by itself; a file build.sh has already put at that place is kept as it is. The font cache this package’s files feed is rebuilt when kpkgadd installs it, so the recipe runs no fc-cache; see Shared indexes.

Other build systems

Zig, Java, SCons, waf, Haskell’s cabal and Node’s npm have shapes of their own in the same chapter of the KDOS book: zig, java, SCons, waf and other build tools and Python, Perl, Haskell, Node and OCaml modules. Whatever the build system, the checks in Every port apply: a release build, every compile line taking the exported flags, and no code tuned to the build machine’s processor.

See also