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

120.4. draco-1.5.7

Google's compressed geometry and point-cloud format, library and codec tools

Version 1.5.7, release 1
Shelf 3d — 3D modelling, animation, voxel and mesh tools and libraries, and scientific visualisation
Phase 41_system (System), 6 of 1047 in build order
Licence Apache-2.0
Homepage https://google.github.io/draco/
Build time 2.2 SBU
Installed size 8.4 MiB in 215 files
Recipe ports/core/3d/draco/kpkgbuild

About

Draco is Google’s library for compressing 3D meshes and point clouds, with the draco_encoder and draco_decoder commands. A glTF asset may carry its meshes compressed with it, and in this tree blender, opencascade, pdal and qgis link it.

Sources

Dependencies

Depends on: cmake, ninja.

Required by (4): blender, opencascade, pdal, qgis.

Patches

build.sh applies these; kpkg applies nothing by itself.

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/41_system/phase.env && kpkg install draco'

What kpkg does

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

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/3d/draco
echo 'bf6b105b79223eab2b86795363dfe5e5356050006a96521477973aba8f036fe1  draco-1.5.7.tar.gz' | 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/draco
SRC=$SRC_ROOT/draco-1.5.7
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf draco-1.5.7.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:

patch -p1 -i "$PORT_SRC/0001-Fix-removal-of-build-dir-prefix-from-include-path.patch"
patch -p1 -i "$PORT_SRC/0002-Install-proper-CMake-targets.patch"
patch -p1 -i "$PORT_SRC/0004-Set-DRACO_LIBRARIES-for-backwards-compatibility.patch"
cmake -S . -B build -G Ninja \
	-D CMAKE_POLICY_VERSION_MINIMUM=3.5 \
	-D CMAKE_INSTALL_PREFIX=/usr \
	-D CMAKE_INSTALL_LIBDIR=lib \
	-D CMAKE_BUILD_TYPE=Release \
	-D BUILD_SHARED_LIBS=ON \
	-D DRACO_TESTS=OFF \
	-D DRACO_TRANSCODER_SUPPORTED=OFF \
	-D DRACO_MESH_COMPRESSION=ON \
	-D DRACO_POINT_CLOUD_COMPRESSION=ON \
	-D DRACO_JS_GLUE=OFF \
	-D DRACO_WASM=OFF \
	-D DRACO_UNITY_PLUGIN=OFF \
	-D DRACO_MAYA_PLUGIN=OFF \
	-D DRACO_ANIMATION_ENCODING=OFF
cmake --build build
DESTDIR=$PKG cmake --install build

The switches, and why each is set:

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/draco, 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 draco-1.5.7-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/draco, and runs the triggers its paths call for.

Contents

Installed programs: draco_decoder, draco_decoder-1.5.7, draco_encoder, draco_encoder-1.5.7.

Installed libraries: libdraco.a, libdraco.so.

Installed directories: /usr/include/draco, /usr/lib/cmake/draco, /usr/share/licenses/draco.

Short descriptions

draco.pc Draco geometry de(com)pression library.

Notes

The three patches are Debian’s, and each carries its own description. Together they make the installed CMake package usable: the headers go to their real paths under /usr/include/draco, the package configuration goes to /usr/lib/cmake/draco rather than under /usr/share, and it sets DRACO_LIBRARIES as well as the draco::draco target, so a consumer’s find_package(draco) resolves to the shared library whichever of the two it reads.