335.2. kalgebra-26.08.2
KDE graph calculator — expressions, 2D and 3D plots, and a console calculator
| Version | 26.08.2, release 1 |
| Shelf | math — Mathematics applications and libraries: computer algebra, arbitrary precision, solvers, calculators, statistics and plotting apps |
| Phase | 44_apps (Applications), 285 of 422 in build order |
| Licence | GPL-2.0-or-later |
| Homepage | https://apps.kde.org/kalgebra/ |
| Build time | 3.7 SBU |
| Installed size | 1017.3 KiB in 27 files |
| Recipe | ports/core/math/kalgebra/kpkgbuild |
About
KAlgebra is KDE’s graph calculator, built on the analitza maths library: it evaluates expressions and plots functions in 2D and 3D. The port installs three front ends: the desktop window kalgebra, the Kirigami touch interface kalgebramobile, and calgebra, a calculator for the terminal.
Sources
kalgebra-26.08.2.tar.xz(929.9 KiB)
sha256be6c855220291d3b850bf0302f19283081358718896794fb1de18cd56bb66b5d
upstream: https://download.kde.org/stable/release-service/26.08.2/src/kalgebra-26.08.2.tar.xz
archive copy: sources-3/math--kalgebra-26.08.2.tar.xz
Dependencies
Depends on: cmake, ninja, extra-cmake-modules, qt6-qtbase, qt6-qtsvg, qt6-qtdeclarative, qt6-qtwebengine, analitza, ki18n, kcoreaddons, kconfigwidgets, kwidgetsaddons, kio, kxmlgui, kdoctools, kirigami, kirigami-addons, libplasma, readline, ncurses.
Required by (1): kde-gear-education.
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 kalgebra'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/math/kalgebra.
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/kalgebra
echo 'be6c855220291d3b850bf0302f19283081358718896794fb1de18cd56bb66b5d kalgebra-26.08.2.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/kalgebra
SRC=$SRC_ROOT/kalgebra-26.08.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf kalgebra-26.08.2.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:
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 CMAKE_REQUIRE_FIND_PACKAGE_Plasma=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_Qt6WebEngineWidgets=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_Readline=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_Curses=ON \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
test -x "$PKG/usr/bin/kalgebra"
test -x "$PKG/usr/bin/calgebra"
cat > "$PKG/usr/share/applications/org.kde.kalgebra.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=KAlgebra
GenericName=Graph Calculator
Comment=Math expression solver and plotter
TryExec=kalgebra
Exec=kalgebra
Icon=kalgebra
Terminal=false
StartupWMClass=org.kde.kalgebra
X-DocPath=kalgebra/index.html
Categories=Qt;KDE;Education;Math;Science;
Keywords=calculator;graph;plot;math;algebra;function;kalgebra;
DESKTOP
cat > "$PKG/usr/share/applications/org.kde.kalgebramobile.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=KAlgebra (touch)
GenericName=Graph Calculator
Comment=Math expression solver and plotter for touch screens
TryExec=kalgebramobile
Exec=kalgebramobile
Icon=kalgebra
Terminal=false
StartupWMClass=org.kde.kalgebramobile
Categories=Qt;KDE;Education;Math;Science;
Keywords=calculator;graph;plot;math;algebra;touch;kalgebra;
DESKTOP
chmod 644 "$PKG"/usr/share/applications/org.kde.kalgebra*.desktop
The switches, and why each is set:
-D KF_SKIP_PO_PROCESSING=ON— Builds none of the interface translations inpo/; the image is English only (see Size and language policy).-D CMAKE_REQUIRE_FIND_PACKAGE_Plasma=ON— stop the configure if libplasma is missing. Upstream installs the Graph plasmoid underplasmoids/, a desktop and panel widget that plots a function, only when it finds libplasma, and otherwise drops it without an error.-D CMAKE_REQUIRE_FIND_PACKAGE_Qt6WebEngineWidgets=ON— stop the configure if QtWebEngine’s widgets are missing. Upstream builds the desktop window only when KDocTools, Qt6WebEngineWidgets, KConfigWidgets, KWidgetsAddons and KIO are all found, and otherwise drops it without an error.-D CMAKE_REQUIRE_FIND_PACKAGE_Readline=ON— with-D CMAKE_REQUIRE_FIND_PACKAGE_Curses=ON: stop the configure if readline or ncurses is missing, the two librariescalgebraneeds. Upstream treats both as optional and leavescalgebraout without them.
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/kalgebra, 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 kalgebra-26.08.2-1.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/kalgebra, and runs the triggers its paths call for.
Contents
Installed programs: calgebra, kalgebra, kalgebramobile.
Installed directories: /usr/share/doc/HTML/en/kalgebra, /usr/share/licenses/kalgebra, /usr/share/plasma/plasmoids/org.kde.graphsplasmoid.
Notes
The two test -x lines after the install fail the build when kalgebra or calgebra is missing from the package, since a configure that dropped either would otherwise finish without an error.
Both desktop entries are KDOS’s own, written over upstream’s. They add StartupWMClass, matching the Wayland app id org.kde.<program> that KAboutData sets, so the task manager can match each window to its entry. They claim no MIME type: upstream’s claim application/x-kalgebra, which the shared MIME database does not define.