214.1. matplotlib-3.11.2
2D plotting library for Python, Agg backend only
The build-state snapshot was taken from 3.11.2-1; this recipe is 3.11.2-2, so the size, time and contents below describe the earlier build.
3.11.2-2 · PSF-2.0 · 5.2 SBU · 25.4 MiB, 689 files · 42_graphics, 52 of 189 · ports/core/sci-libs/matplotlib
Homepage: https://pypi.org/project/matplotlib/
Why it is in KDOS. The comment above it in script/phases/42_graphics/packages.d/sci-libs.txt:
Agg only — matplotlib's first import otherwise probes for GUI toolkits that must not exist here. A plot is a PNG, and libsixel puts it in a terminal.
Matplotlib draws 2D plots from Python. This port builds the Agg raster backend and the PDF, PS and SVG writers; the interactive GUI backends need toolkit bindings it does not depend on.
Depends on: python3, python3-setuptools, python3-pip, python3-meson-python, python3-pybind11, python3-setuptools-scm, numpy, freetype2, libraqm, harfbuzz, fribidi, qhull, fonttools, python3-packaging, python3-pillow, python3-dateutil, python3-pyparsing, python3-cycler, python3-kiwisolver, python3-contourpy.
Required by (5): astropy, freecad, gnuhealth, python3-cantools, qgis.
Sources: matplotlib-3.11.2.tar.gz (31.1 MiB). Every step kpkg takes applies to this port.
Install: script/chroot/exec.sh bash -c 'source script/phases/42_graphics/phase.env && kpkg install matplotlib'
build.sh:
export SETUPTOOLS_SCM_PRETEND_VERSION=$version
pip3 install --ignore-installed --no-deps --no-index --no-build-isolation --root=$PKG --prefix=/usr . \
--config-settings=setup-args=-Dsystem-freetype=true \
--config-settings=setup-args=-Dsystem-libraqm=true \
--config-settings=setup-args=-Dsystem-qhull=true \
--config-settings=setup-args=-DrcParams-backend=Agg
find "$PKG"/usr/lib/python3*/site-packages/matplotlib "$PKG"/usr/lib/python3*/site-packages/mpl_toolkits -type d -name tests -prune -exec rm -rf {} +
Directories: /usr/lib/python3.14/site-packages/matplotlib, /usr/lib/python3.14/site-packages/matplotlib-3.11.2.dist-info, /usr/lib/python3.14/site-packages/mpl_toolkits, /usr/share/licenses/matplotlib.
runtime = fonttools: saving a figure as PDF or PostScript embeds subset fonts through matplotlib/backends/_backend_pdf_ps.py, which imports fontTools. The import is in a submodule the run-time needs record does not read, and fonttools is a build-only port, so without the word a prebuilt install would leave it out and savefig to a .pdf or .ps would fail while PNG works.