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
avogadrolibs-2.0.0.tar.gz(5.0 MiB)
sha25608adefeb8122cf018587fc12872ed470bbf92b72fb73f0af1861ab58031cadfd
upstream: https://github.com/OpenChemistry/avogadrolibs/archive/refs/tags/2.0.0.tar.gz
archive copy: sources-1/bioscience--avogadrolibs-2.0.0.tar.gzavogadro-molecules-2.0.0.tar.gz(9.5 MiB)
sha256bb7377f254932ccd4156035eabfc5b1ed9f551359b520ed86b51064a114a1d99
upstream: https://github.com/OpenChemistry/molecules/archive/refs/tags/2.0.0.tar.gz
archive copy: sources-1/bioscience--avogadro-molecules-2.0.0.tar.gzavogadro-crystals-2.0.0.tar.gz(20.7 MiB)
sha2562747a70fab3d5f32ead0622229189fc74732aa0eadf4ea60b80f75368fb0b442
upstream: https://github.com/OpenChemistry/crystals/archive/refs/tags/2.0.0.tar.gz
archive copy: sources-1/bioscience--avogadro-crystals-2.0.0.tar.gzavogadro-fragments-2.0.0.tar.gz(1.5 MiB)
sha256e9a4ba1dd1b357bef94188dbf8fb7f60219dba7854b69be767e28a4fb1938ce9
upstream: https://github.com/OpenChemistry/fragments/archive/refs/tags/2.0.0.tar.gz
archive copy: sources-1/bioscience--avogadro-fragments-2.0.0.tar.gzavogadro-generators-2.0.0.tar.gz(62.2 KiB)
sha256f672906bcb1201ec593d159e4a1d17a65a0b157a1fc435e2813b9d060552db17
upstream: https://github.com/OpenChemistry/avogenerators/archive/refs/tags/2.0.0.tar.gz
archive copy: sources-1/bioscience--avogadro-generators-2.0.0.tar.gz
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.
-DUSE_HDF5=OFF, line 28: hdf5 (explained with the switches below)-DUSE_PYTHON=OFF, line 30: python3 (explained with the switches below)-DUSE_LIBARCHIVE=OFF, line 34: libarchive (explained with the switches below)
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:
-DBUILD_SHARED_LIBS=ON— Shared libraries, upstream’s default.-DENABLE_RPATH=OFF,-DCMAKE_SKIP_INSTALL_RPATH=ON— Avogadro’scmake/InstallLocation.cmakesets the install run path to/usr/libwhateverENABLE_RPATHsays, and withENABLE_RPATHon adds the directory of every library it links. Off drops the added directories and the skip drops the run path itself, so the libraries and plugins install with none and the loader finds them in/usr/lib.-DUSE_QT=ON,-DQT_VERSION=6,-DUSE_OPENGL=ON— The Qt 6 widget, GUI and OpenGL rendering libraries and the plugins, on qt6-qtbase, glew and libglvnd.-DOpenGL_GL_PREFERENCE=GLVND— Link OpenGL through libglvnd’slibOpenGLrather than the legacylibGL.-DUSE_HDF5=OFF,-DUSE_MMTF=OFF— HDF5 storage of large data sets, and the MMTF macromolecular format. Both are off in upstream’s default; hdf5 is a port but not independs, and no MMTF library is.-DUSE_PYTHON=OFF— The Python bindings of the library API, off in upstream’s default.-DUSE_SPGLIB=OFF,-DUSE_LIBMSYM=OFF,-DUSE_PLOTTER=OFF— Space groups (spglib), symmetry detection (libmsym) and the spectra, conformer, PDF and XRD plots (JKQTPlotter); none of the three libraries is a port, so those plugins are not built.-DUSE_LIBARCHIVE=OFF— Leave out the plugin package installer, the one plugin that needs libarchive, which downloads plugin packages over the network at run time and unpacks them.-DBUILD_GPL_PLUGINS=OFF— Leave out the code under the GPL (the QTAIM analysis plugin, and the GPL parts of the force-field plugin), so the package stays under the BSD licence inlicense. Off is upstream’s default.-DUSE_EXTERNAL_NLOHMANN=ON,-DUSE_EXTERNAL_PUGIXML=ON,-DUSE_EXTERNAL_TOMLPLUSPLUS=ON— Build against the nlohmann-json, pugixml and tomlplusplus ports instead of the copies in the source tree.-DPython3_EXECUTABLE=/usr/bin/python3— The interpreter path is compiled into the GUI library as the one that runs the script plugins (input generators, charge models, script file formats), so it names the system interpreter rather than whatever CMake finds first.
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.