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
labplot-2.12.1.tar.xz(22.8 MiB)
sha256e28155bfddf40e5b6f7c4791313556d1e48138044f216f210d515b9f6d6c106a
upstream: https://download.kde.org/stable/labplot/labplot-2.12.1.tar.xz
archive copy: sources-3/math--labplot-2.12.1.tar.xz
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.
elapsed-timer-include.patch— add#include <QElapsedTimer>toXYFourierFilterCurve.cpp, which uses the class; none of the Qt headers it includes brings it in.musl-execinfo.patch— insrc/backend/lib/trace.h, include<execinfo.h>and defineprint_callstack()only under glibc. musl has no<execinfo.h>, and the function is a debugging aid that nothing in the build calls.
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:
-D_GNU_SOURCE— added toCFLAGS. LabPlot’s numeric library callsexp10, a GNU extension that musl declares only under_GNU_SOURCE. Upstream adds the macro for Clang, Intel and PGI, not for GCC.-D ENABLE_SDK=OFF— do not build or install the SDK, the library and headers for writing programs against LabPlot’s backend.-D ENABLE_TESTS=OFFis LabPlot’s own name for leaving out its tests.-D ENABLE_REPRODUCIBLE=ON— definesREPRODUCIBLE_BUILD, which leaves the compile date and time out of the About dialog, so two builds of the recipe produce the same binary.-D ENABLE_CANTOR=ON— this switch and the otherENABLE_switches setON(FFTW, HDF5, NetCDF, FITS, libcerf, liborigin, ROOT, Matio, MQTT, QtSerialPort, QtSvg, Discount, XLSX, MCAP, Orcus, Eigen3) name each optional feature. Each is upstream’s default, and none of them makes a missing library an error; theCMAKE_REQUIRE_FIND_PACKAGE_switches below do that. The Origin, MCAP and XLSX readers are compiled from the copies of liborigin, the MCAP headers and QXlsx undersrc/3rdparty.-D ENABLE_READSTAT=OFF— no ReadStat importer (SAS, Stata and SPSS files). ReadStat is not a port, and without a system copy upstream downloads and builds its own during the build.-D ENABLE_VECTOR_BLF=OFF— no reader for Vector’s BLF bus logs. With the switch on, upstream looks for theVector_BLFanddbclibraries throughpkg-config, and neither is a port.-D LOCAL_MCAP_DOWNLOAD=OFF— use the MCAP library included in the source rather than a download. It is upstream’s default.-D LOCAL_QT_ADVANCED_DOCK_DOWNLOAD=OFF— with-D LOCAL_QT_ADVANCED_DOCK_COPY=ON: build the Qt Advanced Docking System, which the main window requires, from the copy undersrc/3rdparty/Qt-Advanced-Docking-Systemrather than fetching it from git. The library is not a port of its own.-D QT_FIND_PRIVATE_MODULES=ON— findingQt6GuiloadsQt6GuiPrivateas well. The docking framework and the XLSX reader are built against Qt’s private API, and without the target the configure stops.-D EIGEN3_FOUND=ON— withEIGEN3_INCLUDE_DIRandEIGEN3_VERSION_STRING, read fromeigen3.pc. eigen’s CMake package defines theEigen3::Eigentarget but none of the three variables LabPlot reads, so they are given by hand; the requirement onEigen3below still stops the configure when the library is missing.-D CMAKE_DISABLE_FIND_PACKAGE_KF6UserFeedback=ON— never look for KUserFeedback, so no usage statistics can be collected.-D CMAKE_REQUIRE_FIND_PACKAGE_FFTW3=ON— this switch and the otherCMAKE_REQUIRE_FIND_PACKAGE_switches (HDF5, CFitsio, Poppler, Discount, Eigen3, Qt6SerialPort, Qt6Svg, KF6DocTools, KF6SyntaxHighlighting, KF6Purpose, LIBCERF, Matio, Orcus, Qt6Mqtt) stop the configure when that library is missing, where upstream would build without the feature it backs. Poppler’s Qt 6 library renders LaTeX labels, and Discount renders Markdown notes.
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.