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

65.2. scons-4.11.1

Python-based build tool (gpsd builds with it)

Version 4.11.1, release 1
Shelf buildtools — Build systems and build helpers
Phase 40_lang (Languages), 2 of 186 in build order
Licence MIT
Homepage https://scons.org/
Build time 0.3 SBU
Installed size 22.2 MiB in 1785 files
Recipe ports/core/buildtools/scons/kpkgbuild

About

SCons is a build tool written in Python: a project describes its build in an SConstruct file, which is a Python script. KDOS carries it because gpsd has no other build system; goxel builds with it too.

Why it is in KDOS

The comment above it in script/phases/40_lang/packages.d/buildtools.txt:

gpsd has no Makefile and no meson.build — scons IS its build system, so this is the price of a GPS daemon rather than a preference between build tools.

Sources

Dependencies

Depends on: python3, python3-setuptools, python3-pip.

Required by (2): goxel, gpsd.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/40_lang/phase.env && kpkg install scons'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/buildtools/scons.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/buildtools/scons
echo '4210d1a80a62e986029208117991b6347ccaaaab37b67463a3ff31ee065dc487  scons-4.11.1.tar.gz' | sha256sum -c -
echo '326ea5eff35b1572037e05f5900d8bd3d1654d1c30f8ea6b571bb752488fb6e3  scons-vendor-4.11.1.tar.xz' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/scons
SRC=$SRC_ROOT/scons-4.11.1
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf scons-4.11.1.tar.gz -C "$SRC" --strip-components=1

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

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 .
install -Dm644 scons.1 scons-time.1 sconsign.1 -t "$PKG/usr/share/man/man1"

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/scons, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf scons-4.11.1-1.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/scons, and runs the triggers its paths call for.

Contents

Installed programs: scons, scons-configure-cache, sconsign.

Installed directories: /usr/lib/python3.14/site-packages/SCons, /usr/lib/python3.14/site-packages/scons-4.11.1.dist-info, /usr/share/licenses/scons.

Short descriptions

scons a software construction tool
sconsign print SCons signature file information

Notes

The install runs with pip’s build isolation on, which is unusual among the tree’s Python ports. The vendor bundle holds one distribution, the setuptools sdist, and pip builds that into its temporary build environment from vendor (--no-index --find-links=vendor) before it builds SCons. Nothing from the bundle is installed into the package.

The three manual pages, scons.1, scons-time.1 and sconsign.1, are already rendered at the top of the source distribution and are copied as they are; pip does not install them.