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
draco-1.5.7.tar.gz(57.7 MiB)
sha256bf6b105b79223eab2b86795363dfe5e5356050006a96521477973aba8f036fe1
upstream: https://github.com/google/draco/archive/refs/tags/1.5.7.tar.gz
archive copy: sources-1/3d--draco-1.5.7.tar.gz
Dependencies
Required by (4): blender, opencascade, pdal, qgis.
Patches
build.sh applies these; kpkg applies nothing by itself.
0001-Fix-removal-of-build-dir-prefix-from-include-path.patch— Fix removal of build dir prefix from include path0002-Install-proper-CMake-targets.patch— Install proper CMake targets0004-Set-DRACO_LIBRARIES-for-backwards-compatibility.patch— Set DRACO_LIBRARIES for backwards compatibility
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:
-D BUILD_SHARED_LIBS=ON— add the sharedlibdraco.soto the build. On Linux draco always builds the staticlibdraco.a, and both are installed; with this switch the exporteddraco::dracotarget, which consumers link, is the shared library.-D DRACO_TRANSCODER_SUPPORTED=OFF— leave out the transcoder, which reads and writes glTF scenes. It needs thetinygltf,eigenandfilesystemsubmodules underthird_party/, and the release archive carries them as empty directories. Off is upstream’s default.-D DRACO_MESH_COMPRESSION=ON— mesh compression, andDRACO_POINT_CLOUD_COMPRESSIONpoint cloud compression, both upstream’s defaults, named.-D DRACO_JS_GLUE=OFF— the JavaScript glue targets, which exist only in an Emscripten build. Upstream’s default is on; on a native build it changes nothing.-D DRACO_TESTS=OFF— withDRACO_WASM,DRACO_UNITY_PLUGIN,DRACO_MAYA_PLUGINandDRACO_ANIMATION_ENCODING, the parts of the tree this build leaves out: the test suite (whosegoogletestsubmodule is empty too), the WebAssembly decoder, the plugin libraries for Unity and Maya, and animation encoding. Each is off by upstream’s default.
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.