256.1. qcoro-0.13.0
C++20 coroutines for Qt — co_await on network replies, D-Bus calls, processes, timers and QML
0.13.0-1 · MIT AND BSD-3-Clause · 1.1 SBU · 1.0 MiB, 144 files · 43_toolkits, 68 of 344 · ports/core/qt-extra/qcoro
Homepage: https://qcoro.dvratil.cz/
QCoro gives Qt C++20 coroutines: a QNetworkReply, a D-Bus pending call, a QProcess, a timer, a socket or a QML-facing task can be co_awaited instead of chained through signals. It is a set of shared libraries, libQCoro6Core with one library per Qt module beside it, and CMake packages named QCoro6 with a component for each. plasma-workspace, powerdevil, plasma-nm and Discover require it, kio-extras’ sftp:/ worker requires it, and the Gear applications that co_await a futuresql query build on it.
Depends on: cmake, ninja, qt6-qtbase, qt6-qtdeclarative, qt6-qtwebsockets.
Required by (15): angelfish, audiotube, discover, itinerary, kaccounts-integration, kaccounts-providers, kdenetwork-filesharing, kdos-discover, kio-extras, kontrast, neochat, plasma-nm, plasma-workspace, powerdevil, tokodon.
Sources: qcoro-0.13.0.tar.gz (159.6 KiB). Every step kpkg takes applies to this port.
Install: script/chroot/exec.sh bash -c 'source script/phases/43_toolkits/phase.env && kpkg install qcoro'
build.sh:
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 USE_QT_VERSION=6 \
-D QCORO_BUILD_EXAMPLES=OFF \
-D QCORO_WITH_QTDBUS=ON \
-D QCORO_WITH_QTNETWORK=ON \
-D QCORO_WITH_QTWEBSOCKETS=ON \
-D QCORO_WITH_QTQUICK=ON \
-D QCORO_WITH_QML=ON \
-D QCORO_WITH_QTTEST=ON \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
-D CMAKE_INSTALL_LIBDIR=lib— QCoro is a plain CMake project that includesGNUInstallDirsitself and reads no ECM install variable, so the library directory is named the CMake way.-D BUILD_SHARED_LIBS=ON— Build shared libraries. QCoro declares its libraries with no type, so CMake’s default makes them static archives, which every consumer would then copy into itself.-D USE_QT_VERSION=6— Build against Qt 6 only. Upstream looks for Qt 6 and falls back to Qt 5; naming the version makes a missing Qt 6 module stop the configure instead of selecting the other Qt.-D QCORO_BUILD_EXAMPLES=OFF— Build no example programs. Upstream builds them by default, and they install nothing.-D QCORO_WITH_QTDBUS=ON— TheQCoro6DBuscomponent, forco_awaiton aQDBusPendingCall.-D QCORO_WITH_QTNETWORK=ON— TheQCoro6Networkcomponent: replies, sockets and servers.-D QCORO_WITH_QTWEBSOCKETS=ON— TheQCoro6WebSocketscomponent, over qt6-qtwebsockets.-D QCORO_WITH_QTQUICK=ON— TheQCoro6Quickcomponent, an image provider whose loading is a coroutine. It uses Qt Quick’s private API, so the library is tied to the Qt release it was built against.-D QCORO_WITH_QML=ON— TheQCoro6Qmlcomponent, which hands a coroutine to QML as a promise-like task. It uses Qt Qml’s private API.-D QCORO_WITH_QTTEST=ON— TheQCoro6Testcomponent, header-only helpers that a consumer’s own tests include.
Each QCORO_WITH_* switch is on by default upstream. The recipe names them, so a component a consumer requires cannot drop out of the package unnoticed.
Libraries: libQCoro6Core.so, libQCoro6DBus.so, libQCoro6Network.so, libQCoro6Qml.so, libQCoro6Quick.so, libQCoro6WebSockets.so.
Directories: /usr/include/qcoro6, /usr/lib/cmake/QCoro6, /usr/lib/cmake/QCoro6Core, /usr/lib/cmake/QCoro6Coro, /usr/lib/cmake/QCoro6DBus, /usr/lib/cmake/QCoro6Network, /usr/lib/cmake/QCoro6Qml, /usr/lib/cmake/QCoro6Quick, /usr/lib/cmake/QCoro6Test, /usr/lib/cmake/QCoro6WebSockets, /usr/share/licenses/qcoro.
Coroutines need C++20. QCoro6Coro’s CMake package installs the qcoro_enable_coroutines() macro, which adds GCC’s -fcoroutines, and a consumer calls it itself. find_package(QCoro6) with no component is refused by the package, so a consumer always names the components it uses.