300.3. transmission-4.1.3
BitTorrent daemon with a web UI, command-line tools and a Qt 6 client
| Version | 4.1.3, release 1 |
| Shelf | transfer — File transfer, synchronisation, backup and BitTorrent |
| Phase | 44_apps (Applications), 390 of 422 in build order |
| Licence | GPL-2.0-only OR GPL-3.0-only |
| Homepage | https://transmissionbt.com/ |
| Build time | 28.5 SBU |
| Installed size | 34.7 MiB in 87 files |
| Recipe | ports/core/transfer/transmission/kpkgbuild |
About
Transmission is a BitTorrent client in several front ends over one engine, libtransmission. The port builds transmission-daemon with its web interface, transmission-remote, which drives a daemon, transmission-cli, which downloads on its own, the transmission-create, -edit and -show tools for torrent files, and transmission-qt, the Qt 6 desktop client.
Sources
transmission-4.1.3.tar.xz(11.3 MiB)
sha256ce7d2d8b101f7eb54bc3cf0bc55f52f7ebd4a25fa48e00bdca9a7e0fc02617da
upstream: https://github.com/transmission/transmission/releases/download/4.1.3/transmission-4.1.3.tar.xz
archive copy: sources-4/transfer--transmission-4.1.3.tar.xz
Dependencies
Depends on: cmake, ninja, pkgconf, curl, openssl, libevent, libdeflate, libpsl, miniupnpc, qt6-qtbase, qt6-qtsvg, qt6-qttools, qt6-qtwayland, librsvg, hicolor-icon-theme.
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 transmission'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/transfer/transmission.
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/transmission
echo 'ce7d2d8b101f7eb54bc3cf0bc55f52f7ebd4a25fa48e00bdca9a7e0fc02617da transmission-4.1.3.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/transmission
SRC=$SRC_ROOT/transmission-4.1.3
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf transmission-4.1.3.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_POLICY_VERSION_MINIMUM=3.5 \
-D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_INSTALL_LIBDIR=lib \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_SHARED_LIBS=OFF \
-D ENABLE_DAEMON=ON \
-D ENABLE_CLI=ON \
-D ENABLE_UTILS=ON \
-D ENABLE_QT=ON \
-D USE_QT_VERSION=6 \
-D ENABLE_GTK=OFF \
-D ENABLE_MAC=OFF \
-D REBUILD_WEB=OFF \
-D INSTALL_WEB=ON \
-D INSTALL_DOC=ON \
-D INSTALL_LIB=OFF \
-D ENABLE_NLS=ON \
-D ENABLE_TESTS=OFF \
-D ENABLE_UTP=ON \
-D ENABLE_WERROR=OFF \
-D RUN_CLANG_TIDY=OFF \
-D WITH_CRYPTO=openssl \
-D WITH_SYSTEMD=OFF \
-D WITH_INOTIFY=ON \
-D WITH_APPINDICATOR=OFF \
-D USE_SYSTEM_EVENT2=ON \
-D USE_SYSTEM_DEFLATE=ON \
-D USE_SYSTEM_PSL=ON \
-D USE_SYSTEM_MINIUPNPC=ON \
-D USE_SYSTEM_DHT=OFF \
-D USE_SYSTEM_UTP=OFF \
-D USE_SYSTEM_B64=OFF \
-D USE_SYSTEM_NATPMP=OFF \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
find "$PKG/usr/share/transmission/translations" -name '*.qm' ! -name '*_en*.qm' -delete
for s in 48 64 128 256; do
install -d "$PKG/usr/share/icons/hicolor/${s}x$s/apps"
rsvg-convert -w $s -h $s icons/hicolor_apps_scalable_transmission.svg \
-o "$PKG/usr/share/icons/hicolor/${s}x$s/apps/transmission-qt.png"
done
cat > "$PKG/usr/share/applications/transmission-qt.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Transmission
GenericName=BitTorrent Client
Comment=Download and share files over BitTorrent
Exec=transmission-qt %U
Icon=transmission-qt
Terminal=false
StartupWMClass=transmission-qt
Categories=Network;FileTransfer;P2P;Qt;
Keywords=bittorrent;torrent;magnet;download;p2p;transmission;
DESKTOP
chmod 644 "$PKG/usr/share/applications/transmission-qt.desktop"
The switches, and why each is set:
-D BUILD_SHARED_LIBS=OFF— CMake’s default library type, static. libtransmission is declared static in any case, and with-D INSTALL_LIB=OFFneither it nor its headers are installed: every program links it in.-D ENABLE_DAEMON=ON— andENABLE_CLI,ENABLE_UTILS,ENABLE_QT: the daemon,transmission-cli(off by default upstream), the utilities (transmission-create,-edit,-remoteand-show) and the Qt client.-D USE_QT_VERSION=6builds that client against Qt 6 rather than whichever Qt configure finds first. Upstream’s defaults are on for the daemon and the utilities andAUTOfor the Qt client.-D ENABLE_GTK=OFF— and-D ENABLE_MAC=OFF: no GTK client and no macOS client; the Qt client is the desktop one. Both areAUTOupstream, which would build the GTK client whenever its libraries are installed.-D REBUILD_WEB=OFF— do not rebuild the web interface’s generated assets, which runs npm and needs network access; this is upstream’s default. The release tarball carries the assets built underweb/public_html, and-D INSTALL_WEB=ONinstalls them.-D INSTALL_DOC=ON— install the manual pages and documentation.-D ENABLE_NLS=ON— native language support.build.shthen deletes every Qt translation catalogue but the English ones; kpkg’s size and language policy removes the same catalogues from every package.-D ENABLE_TESTS=OFF— no unit tests, which upstream builds by default.-D ENABLE_UTP=ON— µTP, BitTorrent’s UDP-based transport.-D ENABLE_WERROR=OFF— and-D RUN_CLANG_TIDY=OFF: warnings do not stop the build, and clang-tidy is not run (AUTOupstream, which runs it when found).-D WITH_CRYPTO=openssl— the crypto library, openssl, rather than the first of ccrypto, OpenSSL, wolfSSL and mbedTLS, in that order, that configure finds.-D WITH_SYSTEMD=OFF— no systemd start-up notification in the daemon; KDOS has no systemd (see No systemd).-D WITH_INOTIFY=ON— watch directories for new.torrentfiles with inotify.-D WITH_APPINDICATOR=OFF— no AppIndicator tray icon, which only the GTK 3 client uses.-D USE_SYSTEM_EVENT2=ON— andUSE_SYSTEM_DEFLATE,USE_SYSTEM_PSL,USE_SYSTEM_MINIUPNPC: link libevent, libdeflate, libpsl and miniupnpc from their ports instead of the copies underthird-party/.-D USE_SYSTEM_DHT=OFF— andUSE_SYSTEM_UTP,USE_SYSTEM_B64,USE_SYSTEM_NATPMP: build the DHT, libutp, libb64 and libnatpmp copies underthird-party/, none of which is a port.
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/transmission, 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 transmission-4.1.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/transmission, and runs the triggers its paths call for.
Contents
Installed programs: transmission-cli, transmission-create, transmission-daemon, transmission-edit, transmission-qt, transmission-remote, transmission-show.
Installed directories: /usr/share/doc/transmission, /usr/share/licenses/transmission, /usr/share/transmission.
Short descriptions
transmission-cli |
a bittorrent client |
transmission-create |
command-line utility to create .torrent files |
transmission-daemon |
a bittorrent client |
transmission-edit |
command-line utility to modify .torrent files' announce URLs |
transmission-qt |
a bittorrent client |
transmission-remote |
a remote control utility for |
transmission-show |
command-line utility to show .torrent file metadata |
Notes
Upstream installs the logo as SVG only. The recipe rasterises icons/hicolor_apps_scalable_transmission.svg to PNGs from 48 to 256 pixels named transmission-qt, and writes its own transmission-qt.desktop: the window’s app id is the binary’s name, transmission-qt, which the entry repeats in StartupWMClass. The entry claims no MIME type; qBittorrent is the client that claims .torrent files and magnet: links.