335.4. rkward-0.8.3
KDE front end to R: data editor, plots, dialogs and R Markdown
| Version | 0.8.3, release 1 |
| Shelf | math — Mathematics applications and libraries: computer algebra, arbitrary precision, solvers, calculators, statistics and plotting apps |
| Phase | 44_apps (Applications), 287 of 422 in build order |
| Licence | GPL-2.0-or-later |
| Homepage | https://rkward.kde.org/ |
| Build time | 3.6 SBU |
| Installed size | 7.5 MiB in 560 files |
| Recipe | ports/core/math/rkward/kpkgbuild |
About
RKWard is a KDE front end to the R statistics language: a console, a script editor, a spreadsheet-like data editor, menu-driven dialogs for common analyses, and an output window for results, plots and R Markdown previews. R itself runs in a separate backend process, rkward.rbackend, which the window talks to.
Sources
rkward-0.8.3.tar.gz(7.7 MiB)
sha25640d2a6b6ddc77cb226ccd97037350235ca12d3a422f31b1f9ae3c01be427f5e5
upstream: https://download.kde.org/stable/rkward/0.8.3/rkward-0.8.3.tar.gz
archive copy: sources-3/math--rkward-0.8.3.tar.gz
Dependencies
Depends on: cmake, ninja, extra-cmake-modules, gettext, R, qt6-qtbase, qt6-qtdeclarative, qt6-qtwebengine, kcoreaddons, kdoctools, ki18n, kxmlgui, ktexteditor, kwidgetsaddons, kparts, kconfig, knotifications, kwindowsystem, karchive, kcrash, breeze-icons, kdsingleapplication.
Required by: no port names it.
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 rkward'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/math/rkward.
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/rkward
echo '40d2a6b6ddc77cb226ccd97037350235ca12d3a422f31b1f9ae3c01be427f5e5 rkward-0.8.3.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/rkward
SRC=$SRC_ROOT/rkward-0.8.3
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf rkward-0.8.3.tar.gz -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 FORCE_WITH_QWEBENGINE=ON \
-D FORCE_WITH_QWEBVIEW=OFF \
-D DLOPEN_RLIB=ON \
-D R_EXECUTABLE=/usr/bin/R \
-D CMAKE_REQUIRE_FIND_PACKAGE_KDSingleApplication-qt6=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_KF6Crash=ON \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
test -x "$PKG/usr/bin/rkward"
test -e "$PKG"/usr/share/rkward/rpackages/rkward.tgz
cat > "$PKG/usr/share/applications/org.kde.rkward.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=RKWard
GenericName=Statistics with R
Comment=Data analysis, plots and reports with the R language
TryExec=rkward
Exec=rkward --autoreuse %F
Icon=rkward
Terminal=false
StartupWMClass=org.kde.rkward
X-DocPath=rkward/index.html
Categories=Qt;KDE;Science;Math;NumericalAnalysis;
MimeType=text/r;application/rdata;text/vnd.kde.rmarkdown;application/vnd.kde.rkward-output;
Keywords=statistics;data;r;regression;analysis;plot;rkward;
DESKTOP
chmod 644 "$PKG/usr/share/applications/org.kde.rkward.desktop"
test -e "$PKG"/usr/share/icons/hicolor/48x48/apps/rkward.png
The switches, and why each is set:
-D FORCE_WITH_QWEBENGINE=ON— build the HTML renderer of the output, help and preview windows on QtWebEngine alone and make Qt6WebEngineWidgets a required package, so a missing QtWebEngine stops the configure at the package check. Without the switch upstream builds whichever of the QtWebEngine and QtWebView renderers it finds, and stops only when it finds neither.-D FORCE_WITH_QWEBVIEW=OFF— no QtWebView renderer; QtWebView is not a port. It is upstream’s default, named.-D DLOPEN_RLIB=ON— the backend openslibR.sowithdlopen()at run time rather than linking it, so it follows the R that is installed. It is upstream’s default, named.-D R_EXECUTABLE=/usr/bin/R— the R the configure runs to findR_HOME, R’s include directory and its library, and the path compiled into RKWard to start R with. Upstream otherwise searches thePATH.-D CMAKE_REQUIRE_FIND_PACKAGE_KDSingleApplication-qt6=ON— stop the configure if kdsingleapplication is missing, where upstream falls back to the copy under3rdparty/and links it statically.-D CMAKE_REQUIRE_FIND_PACKAGE_KF6Crash=ON— make KCrash, an optional component upstream, required, so the crash handler is always linked.
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/rkward, 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 rkward-0.8.3-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/rkward, and runs the triggers its paths call for.
Contents
Installed programs: rkward.
Installed libraries: librkward.rbackend.lib.so.
Installed directories: /usr/share/doc/HTML/en/rkward, /usr/share/doc/HTML/en/rkwardplugins, /usr/share/ktexteditor_snippets, /usr/share/licenses/rkward, /usr/share/rkward.
Short descriptions
rkward |
A KDE frontend to R |
Notes
The build packs RKWard’s own R packages, rkward and rkwardtests, into tarballs under /usr/share/rkward/rpackages. On start RKWard copies them into .rkward_packages under its files directory (~/.rkward unless the settings name another), and the backend installs them with install.packages() into a library of its own there, .rkward_packages/<R version>, whenever loading rkward from it fails or finds a different RKWard version: on first start and after an upgrade. build.sh fails if the rkward.tgz tarball or the rkward program is missing from the package.
The desktop entry is KDOS’s own, written over upstream’s to add StartupWMClass=org.kde.rkward, the Wayland app id KAboutData sets (see kdos appid). Every MIME type it claims is defined by the XML files the port installs.