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

273.1. avogadrolibs-2.0.0

Avogadro libraries — molecular data, file formats, OpenGL rendering and Qt widgets for chemistry programs

Version 2.0.0, release 2
Shelf bioscience — Bioinformatics, chemistry and medical informatics or imaging
Phase 43_toolkits (Toolkits), 74 of 344 in build order
Licence BSD-3-Clause
Homepage https://two.avogadro.cc/
Build time 11.8 SBU
Installed size 65.6 MiB in 3137 files
Recipe ports/core/bioscience/avogadrolibs/kpkgbuild

About

Avogadro libraries are the core of the Avogadro 2 molecular editor: molecule and crystal data structures, readers and writers for the chemistry file formats, an OpenGL renderer and the Qt 6 widgets and plugins that build, view and analyse a structure. In KDOS they are there for kalzium, whose molecule viewer is built on them. The editor application itself, Avogadro 2, is a separate project and is not a port.

Sources

Dependencies

Depends on: cmake, ninja, eigen, glew, libglvnd, mesa, qt6-qtbase, qt6-qtsvg, nlohmann-json, pugixml, tomlplusplus, python3.

Required by (1): kalzium.

Optional, off in KDOS

These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.

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/43_toolkits/phase.env && kpkg install avogadrolibs'

What kpkg does

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

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/bioscience/avogadrolibs
echo '08adefeb8122cf018587fc12872ed470bbf92b72fb73f0af1861ab58031cadfd  avogadrolibs-2.0.0.tar.gz' | sha256sum -c -
echo 'bb7377f254932ccd4156035eabfc5b1ed9f551359b520ed86b51064a114a1d99  avogadro-molecules-2.0.0.tar.gz' | sha256sum -c -
echo '2747a70fab3d5f32ead0622229189fc74732aa0eadf4ea60b80f75368fb0b442  avogadro-crystals-2.0.0.tar.gz' | sha256sum -c -
echo 'e9a4ba1dd1b357bef94188dbf8fb7f60219dba7854b69be767e28a4fb1938ce9  avogadro-fragments-2.0.0.tar.gz' | sha256sum -c -
echo 'f672906bcb1201ec593d159e4a1d17a65a0b157a1fc435e2813b9d060552db17  avogadro-generators-2.0.0.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/avogadrolibs
SRC=$SRC_ROOT/avogadrolibs-2.0.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf avogadrolibs-2.0.0.tar.gz -C "$SRC" --strip-components=1
tar --no-same-permissions --warning=no-unknown-keyword -xf avogadro-molecules-2.0.0.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf avogadro-crystals-2.0.0.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf avogadro-fragments-2.0.0.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf avogadro-generators-2.0.0.tar.gz -C "$SRC_ROOT"

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:

for d in molecules crystals fragments avogenerators; do
	mv "$SRC_ROOT/$d-$version" "$SRC_ROOT/$d"
done
cmake -S . -B build -G Ninja \
	-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_INSTALL_LIBDIR=lib \
	-DBUILD_SHARED_LIBS=ON \
	-DENABLE_TESTING=OFF \
	-DBUILD_DOCUMENTATION=OFF \
	-DENABLE_RPATH=OFF \
	-DCMAKE_SKIP_INSTALL_RPATH=ON \
	-DUSE_QT=ON \
	-DQT_VERSION=6 \
	-DUSE_OPENGL=ON \
	-DUSE_HDF5=OFF \
	-DUSE_MMTF=OFF \
	-DUSE_PYTHON=OFF \
	-DUSE_SPGLIB=OFF \
	-DUSE_LIBMSYM=OFF \
	-DUSE_PLOTTER=OFF \
	-DUSE_LIBARCHIVE=OFF \
	-DBUILD_GPL_PLUGINS=OFF \
	-DUSE_EXTERNAL_NLOHMANN=ON \
	-DUSE_EXTERNAL_PUGIXML=ON \
	-DUSE_EXTERNAL_TOMLPLUSPLUS=ON \
	-DPython3_EXECUTABLE=/usr/bin/python3 \
	-DOpenGL_GL_PREFERENCE=GLVND
cmake --build build
DESTDIR=$PKG cmake --install build
test -e "$PKG/usr/lib/avogadro2/plugins/avogenerators/pyproject.toml"

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/avogadrolibs, 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 avogadrolibs-2.0.0-2.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/avogadrolibs, and runs the triggers its paths call for.

Contents

Installed libraries: libAvogadroCalc.so, libAvogadroCore.so, libAvogadroIO.so, libAvogadroMoleQueue.so, libAvogadroQtGui.so, libAvogadroQtOpenGL.so, libAvogadroQtPlugins.so, libAvogadroQuantumIO.so, libAvogadroRendering.so.

Installed directories: /usr/include/avogadro, /usr/lib/avogadro2, /usr/lib/cmake/avogadrolibs, /usr/share/avogadro2, /usr/share/doc/AvogadroLibs, /usr/share/licenses/avogadrolibs.

Notes

The data that the fragment-insertion, peptide-insertion, template-tool and input-generator plugins install comes from four more tarballs in source, all tagged with the library’s version. The build looks for each as a sibling directory of the source tree named exactly molecules, crystals, fragments and avogenerators, and the first three are otherwise cloned from GitHub at build time, which has no network and fails. The archives unpack with the version in the name, so build.sh first moves each to the name the build expects. A missing avogenerators is only reported and skipped, so the test -e line after the install stops the build unless the generators’ pyproject.toml is in the package.