-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
[qcoro] New port #33273
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4843fc5
[qcoro-qt6] New port
danvratil c15f7ed
Rename the port to qcoro
danvratil 3843339
Clean up upstream patch
danvratil 2668ef4
Add x86-osx=failed to ci.baseline
danvratil 7f8a017
Use ${VERSION} in portfile
danvratil db275e5
Update version
danvratil e81842d
Add missing QCoro6Coro cmake module
danvratil e007117
Update version
danvratil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
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); | ||
})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
] | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.