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

335.5. labplot-2.12.1

Data visualisation and analysis: plots, fits, FFT, spreadsheets and live data

Version 2.12.1, release 2
Shelf math — Mathematics applications and libraries: computer algebra, arbitrary precision, solvers, calculators, statistics and plotting apps
Phase 44_apps (Applications), 288 of 422 in build order
Licence GPL-2.0-or-later AND GPL-3.0-or-later
Homepage https://labplot.org/
Build time 14.2 SBU
Installed size 37.3 MiB in 326 files
Recipe ports/core/math/labplot/kpkgbuild

About

LabPlot is KDE’s program for plotting and analysing scientific data: spreadsheets and matrices, 2D plots, curve fitting, Fourier transforms and filters, and live data read from files, sockets, a serial port or MQTT. It imports a long list of file formats and embeds cantor worksheets, so a computer-algebra or R session can sit beside the plots.

Sources

Dependencies

Depends on: cmake, ninja, extra-cmake-modules, bison, qt6-qtbase, qt6-qtsvg, qt6-qtserialport, karchive, kcompletion, kconfig, kconfigwidgets, kcoreaddons, kcrash, ki18n, kiconthemes, kio, ktextwidgets, kwidgetsaddons, kxmlgui, knewstuff, kdoctools, kservice, kparts, purpose, syntax-highlighting, gsl, poppler, fftw, hdf5, netcdf-c, cfitsio, discount, eigen, zlib, lz4, zstd, cantor, libcerf, matio, liborcus, libixion, qt6-qtmqtt.

Required by: no port names it.

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/44_apps/phase.env && kpkg install labplot'

What kpkg does

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

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/math/labplot
echo 'e28155bfddf40e5b6f7c4791313556d1e48138044f216f210d515b9f6d6c106a  labplot-2.12.1.tar.xz' | 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/labplot
SRC=$SRC_ROOT/labplot-2.12.1
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf labplot-2.12.1.tar.xz -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/musl-execinfo.patch"
patch -p1 -i "$PORT_SRC/elapsed-timer-include.patch"

export CFLAGS="$CFLAGS -D_GNU_SOURCE"

cmake -S . -B build -G Ninja \
	-D CMAKE_INSTALL_PREFIX=/usr \
	-D KDE_INSTALL_LIBDIR=lib \
	-D CMAKE_BUILD_TYPE=Release \
	-D KDE_INSTALL_USE_QT_SYS_PATHS=ON \
	-D BUILD_TESTING=OFF \
	-D KF_SKIP_PO_PROCESSING=ON \
	-D ENABLE_TESTS=OFF \
	-D ENABLE_SDK=OFF \
	-D ENABLE_REPRODUCIBLE=ON \
	-D ENABLE_CANTOR=ON \
	-D ENABLE_FFTW=ON \
	-D ENABLE_HDF5=ON \
	-D ENABLE_NETCDF=ON \
	-D ENABLE_FITS=ON \
	-D ENABLE_LIBCERF=ON \
	-D ENABLE_LIBORIGIN=ON \
	-D ENABLE_ROOT=ON \
	-D ENABLE_READSTAT=OFF \
	-D ENABLE_MATIO=ON \
	-D ENABLE_MQTT=ON \
	-D ENABLE_QTSERIALPORT=ON \
	-D ENABLE_QTSVG=ON \
	-D ENABLE_DISCOUNT=ON \
	-D ENABLE_XLSX=ON \
	-D ENABLE_MCAP=ON \
	-D LOCAL_MCAP_DOWNLOAD=OFF \
	-D ENABLE_ORCUS=ON \
	-D ENABLE_VECTOR_BLF=OFF \
	-D ENABLE_EIGEN3=ON \
	-D LOCAL_QT_ADVANCED_DOCK_DOWNLOAD=OFF \
	-D LOCAL_QT_ADVANCED_DOCK_COPY=ON \
	-D QT_FIND_PRIVATE_MODULES=ON \
	-D EIGEN3_FOUND=ON \
	-D EIGEN3_INCLUDE_DIR="$(pkg-config --variable=prefix eigen3)/include/eigen3" \
	-D EIGEN3_VERSION_STRING="$(pkg-config --modversion eigen3)" \
	-D CMAKE_DISABLE_FIND_PACKAGE_KF6UserFeedback=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_FFTW3=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_HDF5=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_CFitsio=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_Poppler=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_Discount=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_Eigen3=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_Qt6SerialPort=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_Qt6Svg=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_KF6DocTools=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_KF6SyntaxHighlighting=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_KF6Purpose=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_LIBCERF=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_Matio=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_Orcus=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_Qt6Mqtt=ON \
	-Wno-dev
grep -q -- -DHAVE_CANTOR_LIBS build/build.ninja
grep -q -- -DHAVE_NETCDF build/build.ninja
cmake --build build
DESTDIR=$PKG cmake --install build
test -x "$PKG/usr/bin/labplot"

cat > "$PKG/usr/share/applications/org.kde.labplot.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=LabPlot
GenericName=Data Plotting and Analysis
Comment=Plot, fit, filter and analyse scientific data
TryExec=labplot
Exec=labplot %f
Icon=labplot
Terminal=false
StartupWMClass=org.kde.labplot
X-DocPath=labplot/index.html
MimeType=application/x-labplot;
Categories=Qt;KDE;Education;Science;Physics;Math;
Keywords=plot;graph;chart;fit;statistics;data;analysis;spreadsheet;labplot;
DESKTOP
chmod 644 "$PKG/usr/share/applications/org.kde.labplot.desktop"
test -e "$PKG"/usr/share/icons/hicolor/48x48/apps/labplot.png

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

Contents

Installed programs: labplot.

Installed directories: /usr/share/doc/HTML/en/labplot, /usr/share/labplot, /usr/share/licenses/labplot.

Short descriptions

labplot an application by KDE for interactive graphing and analysis of scientific data.

Notes

Cantor and NetCDF are checked after the configure, by looking for -DHAVE_CANTOR_LIBS and -DHAVE_NETCDF in build/build.ninja, instead of being required with CMAKE_REQUIRE_FIND_PACKAGE_. Their find modules pass <Name>_FIND_REQUIRED on to a config-package search as a bare argument; a requirement sets it to 1, which that search reads as a version (and netCDF 4 is then incompatible) or rejects (Cantor).

LabPlot’s start-up code sets QT_QPA_PLATFORM=xcb on Linux, over the session’s wayland;xcb, because the Qt Advanced Docking System it docks its panels with misbehaves under Wayland (upstream issue 1067). It always runs as an X11 client on Xwayland.

The desktop entry is KDOS’s own, written over upstream’s. It sets StartupWMClass=org.kde.labplot, which KWin matches against the X11 window’s class, and Icon=labplot, the name of the PNG icons the port installs, and claims only application/x-labplot, the one of upstream’s types that the port’s labplot.xml defines.