300.1. syncthingtray-2.1.7
Status, folders, devices and control of a local Syncthing from the panel tray (Qt 6)
| Version | 2.1.7, release 1 |
| Shelf | transfer — File transfer, synchronisation, backup and BitTorrent |
| Phase | 44_apps (Applications), 388 of 422 in build order |
| Licence | GPL-2.0-or-later |
| Homepage | https://martchus.github.io/syncthingtray/ |
| Build time | 18.3 SBU |
| Installed size | 4.6 MiB in 135 files |
| Recipe | ports/core/transfer/syncthingtray/kpkgbuild |
About
Syncthing Tray shows the state of a local Syncthing in the panel tray: which folders and devices are in sync, what is transferring, and the recent changes, and it can pause, rescan and restart Syncthing. It is a Qt 6 Widgets program built on Martchus’s cpp-utilities, qtutilities and qtforkawesome. The port also installs syncthingctl, the command-line client the desktop entry’s “Rescan all folders” action runs.
Sources
syncthingtray-2.1.7.tar.gz(6.5 MiB)
sha2569448768fb490a4a625d410c3b4b709256b60dc608c6180bd9b4fcbc57cd473ec
upstream: https://github.com/Martchus/syncthingtray/archive/refs/tags/v2.1.7.tar.gz
archive copy: sources-4/transfer--syncthingtray-2.1.7.tar.gz
Dependencies
Depends on: cmake, ninja, pkgconf, cpp-utilities, qtutilities, qtforkawesome, qt6-qtbase, qt6-qtsvg, qt6-qttools, qt6-qtdeclarative, qt6-qtwayland, extra-cmake-modules, libplasma, kconfig, kio, syncthing, librsvg, hicolor-icon-theme.
Required by: no port names it.
Patches
build.sh applies these; kpkg applies nothing by itself.
plasmoid-no-quick-gui.patch guards the one use of the Qt Quick interface in the Plasmoid’s showIgnorePatterns() with the same SYNCTHINGWIDGETS_GUI_QTQUICK_MODE_DESKTOP check as every other use in the applet, so the Plasmoid compiles with -D QUICK_GUI=OFF and opens the Widgets ignore-patterns dialog. It is to be offered upstream.
plasmoid-no-quick-gui.patch— plasmoid: build showIgnorePatterns without the Qt Quick GUIm_quickUI exists only when the Qt Quick GUI's desktop mode is built (SYNCTHINGWIDGETS_GUI_QTQUICK_MODE_DESKTOP), and every other use of it in the applet is guarded by that macro. SyncthingApplet::showIgnorePatterns() used it unguarded, so the Plasmoid failed to compile with QUICK_GUI=OFF.
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 syncthingtray'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/transfer/syncthingtray.
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/transfer/syncthingtray
echo '9448768fb490a4a625d410c3b4b709256b60dc608c6180bd9b4fcbc57cd473ec syncthingtray-2.1.7.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/syncthingtray
SRC=$SRC_ROOT/syncthingtray-2.1.7
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf syncthingtray-2.1.7.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:
patch -p1 -i "$PORT_SRC/plasmoid-no-quick-gui.patch"
cmake -S . -B build -G Ninja \
-D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_INSTALL_LIBDIR=lib \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_SHARED_LIBS=ON \
-D BUILD_TESTING=OFF \
-D QT_PACKAGE_PREFIX=Qt6 \
-D KF_PACKAGE_PREFIX=KF6 \
-D WEBVIEW_PROVIDER=none \
-D JS_PROVIDER=qml \
-D WIDGETS_GUI=ON \
-D QUICK_GUI=OFF \
-D NO_LIBSYNCTHING=ON \
-D NO_PLASMOID=OFF \
-D NO_FILE_ITEM_ACTION_PLUGIN=OFF \
-D SETUP_TOOLS=OFF \
-D SYSTEMD_SUPPORT=OFF \
-D USE_BOOST_PROCESS=OFF \
-D DBUS_BASED_POWER_MONITORING=ON \
-D NO_DOXYGEN=ON \
-D NO_SPHINX=ON \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
for s in 48 64 128; do
install -d "$PKG/usr/share/icons/hicolor/${s}x$s/apps"
rsvg-convert -w $s -h $s tray/resources/icons/hicolor/scalable/apps/syncthingtray.svg \
-o "$PKG/usr/share/icons/hicolor/${s}x$s/apps/syncthingtray.png"
done
install -Dm644 tray/resources/icons/hicolor/256x256/apps/syncthingtray.png \
"$PKG/usr/share/icons/hicolor/256x256/apps/syncthingtray.png"
cat > "$PKG/usr/share/applications/syncthingtray.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Syncthing Tray
GenericName=Syncthing Status
Comment=Status and control of the local Syncthing from the panel tray
Exec=syncthingtray
Icon=syncthingtray
Terminal=false
StartupWMClass=syncthingtray
Categories=Network;FileTransfer;
Keywords=syncthing;sync;folder;device;share;
Actions=ShowSyncthing;RescanAll;
[Desktop Action ShowSyncthing]
Name=Open the Syncthing web UI
Exec=syncthingtray qt-widgets-gui --webui
[Desktop Action RescanAll]
Name=Rescan all folders
Exec=syncthingctl rescan-all
DESKTOP
chmod 644 "$PKG/usr/share/applications/syncthingtray.desktop"
The switches, and why each is set:
-D BUILD_SHARED_LIBS=ON— build the project’s own libraries (connector, model, widgets) as shared libraries.-D QT_PACKAGE_PREFIX=Qt6— and-D KF_PACKAGE_PREFIX=KF6: the Qt and KDE Frameworks major version to build against; upstream’s defaults areQt5andKF5.-D WEBVIEW_PROVIDER=none— no built-in web view. Upstream’sautowould embed Syncthing’s web interface through QtWebEngine; withnonethe web interface opens in the browser, and qt6-qtwebengine is not linked.-D JS_PROVIDER=qml— the JavaScript engine behindsyncthingctl edit --scriptand--js-lines, which run a script over Syncthing’s configuration instead of opening an editor, taken from Qt QML (qt6-qtdeclarative). This is upstream’s default.-D WIDGETS_GUI=ON— the Qt Widgets interface, with-D QUICK_GUI=OFFleaving out the experimental Qt Quick one; both are upstream’s desktop defaults.-D NO_LIBSYNCTHING=ON— do not build Syncthing itself into the program as a library; the tray talks to the separatesyncthingthe Syncthing port installs. Upstream’s default on the desktop.-D NO_PLASMOID=OFF— and-D NO_FILE_ITEM_ACTION_PLUGIN=OFF: build the Plasma panel widget and the Dolphin context-menu plugin, both upstream’s defaults on Linux, named so neither drops out. The widget links libplasma and kconfig and shows the same folders, devices and transfers as the tray icon; the first-run wizard recommends it on Plasma, and it is added from the panel’s widget list. The context-menu plugin is a KIO file-item-action plugin over kio, which Dolphin loads to offer rescanning and opening a folder Syncthing shares.-D SETUP_TOOLS=OFF— no setup tools: the updater that checks for a newer Syncthing Tray release, downloads and verifies it and restarts into it, with its settings page and tray notice. This is upstream’s default, and its description of the option says it likely makes sense to disable when distributing through a package manager; here kpkg installs and updates the program.-D SYSTEMD_SUPPORT=OFF— no control of a Syncthing systemd unit. KDOS has no systemd (see No systemd), so there is no unit to control.-D USE_BOOST_PROCESS=OFF— launch Syncthing through Qt’sQProcessinstead of Boost.Process, which upstream enables by default.-D DBUS_BASED_POWER_MONITORING=ON— battery and power-saver monitoring over D-Bus, in upstream’s words. On by default upstream on Linux.-D NO_DOXYGEN=ON— and-D NO_SPHINX=ON: no API documentation with Doxygen or Sphinx.
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/syncthingtray, 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 syncthingtray-2.1.7-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/syncthingtray, and runs the triggers its paths call for.
Contents
Installed programs: syncthingctl, syncthingtray.
Installed libraries: libsyncthingconnector.so, libsyncthingmodel.so, libsyncthingwidgets.so.
Installed directories: /usr/include/syncthingconnector, /usr/include/syncthingmodel, /usr/include/syncthingwidgets, /usr/share/licenses/syncthingtray, /usr/share/plasma/plasmoids/martchus.syncthingplasmoid, /usr/share/syncthingconnector, /usr/share/syncthingfileitemaction, /usr/share/syncthingmodel, /usr/share/syncthingplasmoid, /usr/share/syncthingtray, /usr/share/syncthingwidgets.
Short descriptions
syncthingconnector.pc |
Connection backend of Syncthing Tray |
syncthingfileitemaction.pc |
KIO file item action for Syncthing |
syncthingmodel.pc |
Data models of Syncthing Tray |
syncthingplasmoid.pc |
Plasmoid to interact with Syncthing |
syncthingwidgets.pc |
Tray application for Syncthing |
Notes
Upstream installs the logo as SVG only. The recipe rasterises it to 48, 64 and 128 pixel PNGs and installs the 256-pixel PNG the source carries under tray/resources/icons. Upstream’s desktop entry has no StartupWMClass; the recipe writes its own, naming the window’s app id, syncthingtray, the program’s name.