Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[qcoro] New port #33273

Merged
merged 8 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions ports/qcoro/0001-qt6-deprecated-qwebsocket-error.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff --git a/qcoro/websockets/qcorowebsocket.cpp b/qcoro/websockets/qcorowebsocket.cpp
index be9c1f7..c686d14 100644
--- a/qcoro/websockets/qcorowebsocket.cpp
+++ b/qcoro/websockets/qcorowebsocket.cpp
@@ -32,7 +32,13 @@ public:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please submit the content of this patch to the upstream, we need to wait for their approval.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Github user names checks out to be upstream?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm the upstream :) This patch is already in the main branch, just wasn't included in 0.9.0 release. It will be dropped once 0.10.0 is out.

emitReady(true);
}
}))
- , mError(connect(socket, qOverload<QAbstractSocket::SocketError>(&QWebSocket::error), this, [this](auto error) {
+ , mError(connect(socket, qOverload<QAbstractSocket::SocketError>(
+#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
+ &QWebSocket::errorOccurred
+#else
+ &QWebSocket::error
+#endif
+ ), this, [this](auto error) {
qWarning() << "QWebSocket failed to connect to a websocket server: " << error;
emitReady(false);
}))
59 changes: 59 additions & 0 deletions ports/qcoro/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO danvratil/qcoro
REF "v${VERSION}"
SHA512 f708e1a82861c39434d6934172246c3280864e933b333b56c0471f1a629f9da65554d1508af4291ac2257ad8df2040655394ae5525d728710de5bd83cef8fbee
HEAD_REF main
PATCHES 0001-qt6-deprecated-qwebsocket-error.patch
)

vcpkg_check_features(
OUT_FEATURE_OPTIONS EXTRA_OPTIONS
FEATURES
dbus QCORO_WITH_QTDBUS
network QCORO_WITH_QTNETWORK
websockets QCORO_WITH_QTWEBSOCKETS
quick QCORO_WITH_QTQUICK
qml QCORO_WITH_QML
test QCORO_WITH_QTTEST
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DUSE_QT_VERSION=6
-DBUILD_TESTING=OFF
-DQCORO_BUILD_EXAMPLES=OFF
${EXTRA_OPTIONS}
)

vcpkg_cmake_install()

if (QCORO_WITH_QTDBUS)
vcpkg_cmake_config_fixup(PACKAGE_NAME QCoro6DBus DO_NOT_DELETE_PARENT_CONFIG_PATH CONFIG_PATH lib/cmake/QCoro6DBus)
endif()
if (QCORO_WITH_QTNETWORK)
vcpkg_cmake_config_fixup(PACKAGE_NAME QCoro6Network DO_NOT_DELETE_PARENT_CONFIG_PATH CONFIG_PATH lib/cmake/QCoro6Network)
endif()
if (QCORO_WITH_QTWEBSOCKETS)
vcpkg_cmake_config_fixup(PACKAGE_NAME QCoro6WebSockets DO_NOT_DELETE_PARENT_CONFIG_PATH CONFIG_PATH lib/cmake/QCoro6WebSockets)
endif()
if (QCORO_WITH_QTQUICK)
vcpkg_cmake_config_fixup(PACKAGE_NAME QCoro6Quick DO_NOT_DELETE_PARENT_CONFIG_PATH CONFIG_PATH lib/cmake/QCoro6Quick)
endif()
if (QCORO_WITH_QML)
vcpkg_cmake_config_fixup(PACKAGE_NAME QCoro6Qml DO_NOT_DELETE_PARENT_CONFIG_PATH CONFIG_PATH lib/cmake/QCoro6Qml)
endif()
if (QCORO_WITH_QTTEST)
vcpkg_cmake_config_fixup(PACKAGE_NAME QCoro6Test DO_NOT_DELETE_PARENT_CONFIG_PATH CONFIG_PATH lib/cmake/QCoro6Test)
endif()
vcpkg_cmake_config_fixup(PACKAGE_NAME QCoro6Coro DO_NOT_DELETE_PARENT_CONFIG_PATH CONFIG_PATH lib/cmake/QCoro6Coro)
vcpkg_cmake_config_fixup(PACKAGE_NAME QCoro6 DO_NOT_DELETE_PARENT_CONFIG_PATH CONFIG_PATH lib/cmake/QCoro6)
vcpkg_cmake_config_fixup(PACKAGE_NAME QCoro6Core CONFIG_PATH lib/cmake/QCoro6Core)

# Remove debug includes and CMake macros
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
36 changes: 36 additions & 0 deletions ports/qcoro/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
qcoro-qt6 provides CMake targets:

# Generic coroutine types and tools
find_package(QCoro6Coro CONFIG REQUIRED)
target_link_libraries(main PRIVATE QCoro6::Coro)

# Coroutine support for QtCore types
find_package(QCoro6Core CONFIG REQUIRED)
target_link_libraries(main PRIVATE QCoro6::Core)

# Coroutine supports for QtDBus types
find_package(QCoro6DBus CONFIG REQUIRED)
target_link_libraries(main PRIVATE QCoro6::DBus)

# Coroutine support for QtNetwork types
find_package(QCoro6Network CONFIG REQUIRED)
target_link_libraries(main PRIVATE QCoro6::Network)

# Coroutine support for QtQml types
find_package(QCoro6Qml CONFIG REQUIRED)
target_link_libraries(main PRIVATE QCoro6::Qml)

# Coroutine support for QML
find_package(QCoro6Quick CONFIG REQUIRED)
target_link_libraries(main PRIVATE QCoro6::Quick)

# Coroutine support for developing tests with QtTest
find_package(QCoro6Test CONFIG REQUIRED)
target_link_libraries(main PRIVATE QCoro6::Test)

# Coroutine support for QtWebSockets types
find_package(QCoro6WebSockets CONFIG REQUIRED)
target_link_libraries(main PRIVATE QCoro6::WebSockets)

You can also use `QCoro` target namespace for transparent
support of both Qt5 and Qt6.
56 changes: 56 additions & 0 deletions ports/qcoro/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"name": "qcoro",
"version": "0.9.0",
"description": "Coroutine support for Qt",
"homepage": "https://www.github.com/danvratil/qcoro",
"documentation": "https://qcoro.dvratil.cz",
"license": "MIT",
"dependencies": [
"qtbase",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"default-features": [
"dbus",
"network",
"qml",
"quick",
"test",
"websockets"
],
"features": {
"dbus": {
"description": "Coroutine support for QtDBus module"
},
"network": {
"description": "Coroutine support for QtNetwork module"
},
"qml": {
"description": "Coroutine support for QtQml module",
"dependencies": [
"qtdeclarative"
]
},
"quick": {
"description": "Coroutine support for QtQuick module",
"dependencies": [
"qtdeclarative"
]
},
"test": {
"description": "Support code for easier testing of coroutines with QtTest."
},
"websockets": {
"description": "Coroutine support for QtWebSockets module",
"dependencies": [
"qtwebsockets"
]
}
}
}
2 changes: 2 additions & 0 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,8 @@ python3:x64-android=fail
# Not yet ready for these platforms.
qbittorrent:x64-osx=fail
qbittorrent:x64-linux=fail
# Triggers ICE in release build.
qcoro:x64-osx=fail
qpid-proton:arm-neon-android=fail
qpid-proton:arm-uwp=fail
qpid-proton:arm64-android=fail
Expand Down
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6616,6 +6616,10 @@
"baseline": "2.3.5",
"port-version": 2
},
"qcoro": {
"baseline": "0.9.0",
"port-version": 0
},
"qcustomplot": {
"baseline": "2.1.1",
"port-version": 1
Expand Down
9 changes: 9 additions & 0 deletions versions/q-/qcoro.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "0b82c30bd542212b17946094149433dda747515f",
"version": "0.9.0",
"port-version": 0
}
]
}