Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

109.7. libtorrent-rasterbar-2.0.15

Arvid Norberg's BitTorrent library, with its Python binding — the engine of qBittorrent and Deluge

2.0.15-1 · BSD-3-Clause · 4.9 SBU · 17.8 MiB, 289 files · 41_system, 982 of 1047 · ports/core/transfer/libtorrent-rasterbar

Homepage: https://www.libtorrent.org

libtorrent-rasterbar is Arvid Norberg’s BitTorrent library in C++ on Boost.Asio, with its Python binding. It is the torrent engine of qbittorrent, which links the library, and of deluge, whose daemon drives it through the binding.

Depends on: cmake, ninja, boost, openssl, python3, python3-setuptools.

Required by (2): deluge, qbittorrent.

Sources: libtorrent-rasterbar-2.0.15.tar.gz (4.5 MiB). Every step kpkg takes applies to this port.

Optional, off in KDOS. These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.

Install: script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install libtorrent-rasterbar'

build.sh:

cmake -B build -G Ninja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_INSTALL_LIBDIR=lib \
	-DCMAKE_CXX_STANDARD=17 \
	-DBUILD_SHARED_LIBS=ON \
	-Dwebtorrent=OFF \
	-Dgnutls=OFF \
	-Dencryption=ON \
	-Ddht=ON \
	-Dpython-bindings=ON \
	-Dpython-egg-info=ON \
	-Dpython-install-system-dir=ON \
	-Dbuild_tests=OFF \
	-Dbuild_examples=OFF \
	-Dbuild_tools=OFF
cmake --build build
DESTDIR=$PKG cmake --install build

Libraries: libtorrent-rasterbar.so.

Directories: /usr/include/libtorrent, /usr/lib/cmake/LibtorrentRasterbar, /usr/lib/python3.14/site-packages/libtorrent.egg-info, /usr/share/licenses/libtorrent-rasterbar.

The port stays on the 2.0 series. Deluge 2.2.0 is written against the 2.0 Python API: its core sets ignore_resume_timestamps, cache_size, cache_expiry and half_open_limit, names the encryption levels lt.enc_level.plaintext, rc4 and both, and reads torrent_status.paused. A 2.0 build with deprecated functions on, the CMake default, is ABI version 1 and keeps every one of those names. 2.1 builds ABI version 2, which drops them, and deluged stops at start with unknown name in settings_pack. qBittorrent builds against either series; its libtorrent-2.1.patch takes effect only from 2.1.0 on (LIBTORRENT_VERSION_NUM >= 20100). The series moves when a Deluge release supports 2.1. The library’s soname names its series (libtorrent-rasterbar.so.2.0), so a change of series needs qBittorrent’s release bumped in the same change; a qbittorrent linked against the other series does not start.

-Dpython-install-system-dir=ON puts the binding in the system Python’s site-packages rather than under the CMake prefix, and -Dpython-egg-info=ON writes its egg-info beside it, so pip and importlib.metadata see an installed libtorrent. -Dgnutls=OFF keeps OpenSSL: the GnuTLS build compiles DHT out.