-
Notifications
You must be signed in to change notification settings - Fork 7.5k
[dbus-cxx] add new port #47617
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
[dbus-cxx] add new port #47617
Changes from all commits
9b1491f
59e757a
79c8780
10dbe31
328c1d6
1ac63de
1c39d17
d4b0d99
643a471
b909b83
4820c3f
9b5fde7
99acc6f
e86d0e8
4996c74
c3f3277
3365b5b
00287dc
3b48cc4
d92505b
81c77cc
5eba7aa
f8802a7
5fd03a3
485dd71
8ebfc64
82241f8
dd76bef
41bdbf0
5ab6b01
a89301e
1dd5be7
714841b
973bd70
18eccc2
3d89bd1
8ea6a34
2d5fd42
959c5ee
9069cd6
acfcd42
4d4d09a
bb0fd02
a0c6df8
aae0b1d
bb537c8
8480251
a8620c5
92fa113
b7e6457
9661198
74086ef
426d409
e1bf1f0
9dd3832
970ad64
7d5cd2a
48d925e
f4149d0
b141975
9e46379
8f5f78f
17d9e39
f18ab28
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| diff --git a/cmake/dbus-cxxConfig.cmake.in b/cmake/dbus-cxxConfig.cmake.in | ||
| new file mode 100644 | ||
| index 0000000..42181f0 | ||
| --- /dev/null | ||
| +++ b/cmake/dbus-cxxConfig.cmake.in | ||
| @@ -0,0 +1,79 @@ | ||
| +@PACKAGE_INIT@ | ||
| + | ||
| +set(dbus-cxx_KNOWN_COMPONENTS "glib" "qt" "uv") | ||
| + | ||
| +include(CMakeFindDependencyMacro) | ||
| + | ||
| +find_dependency(Threads) | ||
| +find_dependency(sigc++-3) | ||
| + | ||
| +if(@ENABLE_GLIB_SUPPORT@) | ||
| + find_dependency(PkgConfig) | ||
| + pkg_check_modules(glib REQUIRED IMPORTED_TARGET glib-2.0) | ||
| +endif() | ||
| + | ||
| +if(@ENABLE_UV_SUPPORT@) | ||
| + find_dependency(libuv) | ||
| +endif() | ||
| + | ||
| +if(@ENABLE_QT_SUPPORT@) | ||
| + find_dependency(Qt6 COMPONENTS Core) | ||
| +endif() | ||
| + | ||
| +include("${CMAKE_CURRENT_LIST_DIR}/dbus-cxxTargets.cmake") | ||
| + | ||
| +if("glib" IN_LIST dbus-cxx_FIND_COMPONENTS) | ||
| + if(@ENABLE_GLIB_SUPPORT@) | ||
| + if(TARGET dbus-cxx::dbus-cxx-glib) | ||
| + set(dbus-cxx_glib_FOUND TRUE) | ||
| + else() | ||
| + set(dbus-cxx_glib_FOUND FALSE) | ||
| + if(dbus-cxx_FIND_REQUIRED_glib) | ||
| + message(FATAL_ERROR "Requested 'glib' component but target 'dbus-cxx::dbus-cxx-glib' is not available.") | ||
| + endif() | ||
| + endif() | ||
| + else() | ||
| + set(dbus-cxx_glib_FOUND FALSE) | ||
| + if(dbus-cxx_FIND_REQUIRED_glib) | ||
| + message(FATAL_ERROR "Requested 'glib' component but dbus-cxx was built without glib support.") | ||
| + endif() | ||
| + endif() | ||
| +endif() | ||
| + | ||
| +if("uv" IN_LIST dbus-cxx_FIND_COMPONENTS) | ||
| + if(@ENABLE_UV_SUPPORT@) | ||
| + if(TARGET dbus-cxx::dbus-cxx-uv) | ||
| + set(dbus-cxx_uv_FOUND TRUE) | ||
| + else() | ||
| + set(dbus-cxx_uv_FOUND FALSE) | ||
| + if(dbus-cxx_FIND_REQUIRED_uv) | ||
| + message(FATAL_ERROR "Requested 'uv' component but target 'dbus-cxx::dbus-cxx-uv' is not available.") | ||
| + endif() | ||
| + endif() | ||
| + else() | ||
| + set(dbus-cxx_uv_FOUND FALSE) | ||
| + if(dbus-cxx_FIND_REQUIRED_uv) | ||
| + message(FATAL_ERROR "Requested 'uv' component but dbus-cxx was built without uv support.") | ||
| + endif() | ||
| + endif() | ||
| +endif() | ||
| + | ||
| +if("qt" IN_LIST dbus-cxx_FIND_COMPONENTS) | ||
| + if(@ENABLE_QT_SUPPORT@) | ||
| + if(TARGET dbus-cxx::dbus-cxx-qt) | ||
| + set(dbus-cxx_qt_FOUND TRUE) | ||
| + else() | ||
| + set(dbus-cxx_qt_FOUND FALSE) | ||
| + if(dbus-cxx_FIND_REQUIRED_qt) | ||
| + message(FATAL_ERROR "Requested 'qt' component but target 'dbus-cxx::dbus-cxx-qt' is not available.") | ||
| + endif() | ||
| + endif() | ||
| + else() | ||
| + set(dbus-cxx_qt_FOUND FALSE) | ||
| + if(dbus-cxx_FIND_REQUIRED_qt) | ||
| + message(FATAL_ERROR "Requested 'qt' component but dbus-cxx was built without qt support.") | ||
| + endif() | ||
| + endif() | ||
| +endif() | ||
| + | ||
| +check_required_components(dbus-cxx) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) | ||
|
|
||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO dbus-cxx/dbus-cxx | ||
| REF "${VERSION}" | ||
| SHA512 ad6551d03d0c7d499e9f0c6d77584e39d361a1464017be3c40c237d4c43306ad0ffb49b52c06b89cd62ec7346ebcb29f3d166a31b245fd978159e337a08ebafb | ||
| HEAD_REF master | ||
| PATCHES | ||
| create-cmakeconfig.patch | ||
| use-cmakeconfig.patch | ||
| ) | ||
|
|
||
| vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS | ||
| FEATURES | ||
| "glib" ENABLE_GLIB_SUPPORT | ||
| "libuv" ENABLE_UV_SUPPORT | ||
| "qt6" ENABLE_QT_SUPPORT | ||
| ) | ||
|
|
||
| if (EXISTS "${CURRENT_INSTALLED_DIR}/lib/pkgconfig/libuv-static.pc") | ||
| set(UV_STATIC ON) | ||
| else () | ||
| set(UV_STATIC OFF) | ||
| endif () | ||
|
|
||
| vcpkg_cmake_configure( | ||
| SOURCE_PATH "${SOURCE_PATH}" | ||
| OPTIONS | ||
| ${FEATURE_OPTIONS} | ||
| -DBUILD_TESTING=OFF | ||
| -DENABLE_CODE_COVERAGE_REPORT=OFF | ||
| -DENABLE_EXAMPLES=OFF | ||
| -DENABLE_TOOLS=OFF | ||
| -DBUILD_SITE=OFF | ||
| -DUV_STATIC=${UV_STATIC} | ||
| ) | ||
|
|
||
| vcpkg_cmake_install() | ||
|
|
||
| vcpkg_cmake_config_fixup(PACKAGE_NAME "dbus-cxx" CONFIG_PATH "lib/cmake/dbus-cxx") | ||
|
|
||
| vcpkg_fixup_pkgconfig() | ||
| vcpkg_copy_pdbs() | ||
|
|
||
| file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") | ||
|
|
||
| vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| index 0030f17..0e19089 100644 | ||
| --- a/CMakeLists.txt | ||
| +++ b/CMakeLists.txt | ||
| @@ -23,7 +23,6 @@ include( CTest ) | ||
| include( CheckCXXSymbolExists ) | ||
| include( CheckCXXCompilerFlag ) | ||
| IF( CMAKE_BUILD_TYPE MATCHES Debug ) | ||
| -include( CodeCoverage ) | ||
| ENDIF( CMAKE_BUILD_TYPE MATCHES Debug ) | ||
|
|
||
| find_package(PkgConfig REQUIRED) | ||
| @@ -36,7 +35,8 @@ set( DBUS_CXX_INCLUDE_VERSION 2.0 ) | ||
| set( PKG_VERSION ${dbus-cxx_VERSION} ) | ||
|
|
||
| # Our required dependencies: libsigc++ 3.0 | ||
| -pkg_check_modules( sigc REQUIRED IMPORTED_TARGET sigc++-3.0 ) | ||
| +find_package(sigc++-3 CONFIG REQUIRED) | ||
| +add_library(PkgConfig::sigc ALIAS sigc-3.0) | ||
|
|
||
| # | ||
| # Check our options | ||
| @@ -355,18 +355,26 @@ INSTALL( FILES "${PROJECT_BINARY_DIR}/dbus-cxx-2.0.pc" | ||
| # Support for find_package | ||
| # | ||
| install(EXPORT dbus-cxxTargets | ||
| - FILE dbus-cxxConfig.cmake | ||
| - NAMESPACE dbus-cxx:: | ||
| + FILE dbus-cxxTargets.cmake | ||
| + NAMESPACE dbus-cxx:: | ||
| DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/dbus-cxx | ||
| ) | ||
|
|
||
| include(CMakePackageConfigHelpers) | ||
| -write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/dbus-cxxConfigVersion.cmake" | ||
| +write_basic_package_version_file( | ||
| + "${CMAKE_CURRENT_BINARY_DIR}/dbus-cxxConfigVersion.cmake" | ||
| VERSION ${PROJECT_VERSION} | ||
| COMPATIBILITY SameMajorVersion | ||
| ) | ||
| -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/dbus-cxxConfigVersion.cmake" | ||
| - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/dbus-cxx | ||
| +configure_package_config_file( | ||
| + "${PROJECT_SOURCE_DIR}/cmake/dbus-cxxConfig.cmake.in" | ||
| + "${CMAKE_CURRENT_BINARY_DIR}/dbus-cxxConfig.cmake" | ||
| + INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/dbus-cxx" | ||
| +) | ||
| +install(FILES | ||
| + "${CMAKE_CURRENT_BINARY_DIR}/dbus-cxxConfig.cmake" | ||
| + "${CMAKE_CURRENT_BINARY_DIR}/dbus-cxxConfigVersion.cmake" | ||
| + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/dbus-cxx" | ||
| ) | ||
|
|
||
| # | ||
| diff --git a/dbus-cxx-glib/CMakeLists.txt b/dbus-cxx-glib/CMakeLists.txt | ||
| index 6b98f27..87c245c 100644 | ||
| --- a/dbus-cxx-glib/CMakeLists.txt | ||
| +++ b/dbus-cxx-glib/CMakeLists.txt | ||
| @@ -67,6 +67,6 @@ INSTALL( FILES "${CMAKE_CURRENT_BINARY_DIR}/dbus-cxx-glib-2.0.pc" | ||
| install( TARGETS dbus-cxx-glib | ||
| EXPORT dbus-cxxTargets | ||
| COMPONENT glib | ||
| - PUBLIC_HEADER DESTINATION include/dbus-cxx-glib-${DBUS_CXX_INCLUDE_VERSION} | ||
| - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" | ||
| - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ) | ||
| + PUBLIC_HEADER DESTINATION include/dbus-cxx-glib-${DBUS_CXX_INCLUDE_VERSION} COMPONENT glib | ||
| + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT glib | ||
| + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT glib) | ||
| diff --git a/dbus-cxx-qt/CMakeLists.txt b/dbus-cxx-qt/CMakeLists.txt | ||
| index 9c637ed..a7b75ca 100644 | ||
| --- a/dbus-cxx-qt/CMakeLists.txt | ||
| +++ b/dbus-cxx-qt/CMakeLists.txt | ||
| @@ -16,7 +16,7 @@ set(CMAKE_AUTOMOC ON) | ||
| set(CMAKE_AUTORCC ON) | ||
| set(CMAKE_AUTOUIC ON) | ||
|
|
||
| -find_package(Qt5 COMPONENTS Core REQUIRED) | ||
| +find_package(Qt6 COMPONENTS Core REQUIRED) | ||
|
|
||
| set( dbus-cxx-qt-headers dbus-cxx-qt.h qtthreaddispatcher.h qtdispatcher.h ) | ||
| set( dbus-cxx-qt-sources dbus-cxx-qt.cpp qtthreaddispatcher.cpp qtdispatcher.cpp ) | ||
| @@ -28,7 +28,7 @@ set_target_properties( dbus-cxx-qt PROPERTIES | ||
| VERSION 2.0.0 SOVERSION 2 | ||
| PUBLIC_HEADER "${dbus-cxx-qt-headers}" | ||
| ) | ||
| -target_link_libraries( dbus-cxx-qt PUBLIC Qt5::Core dbus-cxx PkgConfig::sigc ${LIBRT} ) | ||
| +target_link_libraries( dbus-cxx-qt PUBLIC Qt6::Core dbus-cxx PkgConfig::sigc ${LIBRT} ) | ||
| target_include_directories( dbus-cxx-qt INTERFACE | ||
| $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> | ||
| $<INSTALL_INTERFACE:include/dbus-cxx-qt-${DBUS_CXX_INCLUDE_VERSION}> | ||
| @@ -73,6 +73,6 @@ INSTALL( FILES "${CMAKE_CURRENT_BINARY_DIR}/dbus-cxx-qt-2.0.pc" | ||
| install( TARGETS dbus-cxx-qt | ||
| EXPORT dbus-cxxTargets | ||
| COMPONENT qt | ||
| - PUBLIC_HEADER DESTINATION include/dbus-cxx-qt-${DBUS_CXX_INCLUDE_VERSION} | ||
| - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" | ||
| - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ) | ||
| + PUBLIC_HEADER DESTINATION include/dbus-cxx-qt-${DBUS_CXX_INCLUDE_VERSION} COMPONENT qt | ||
| + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT qt | ||
| + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT qt) | ||
| diff --git a/dbus-cxx-uv/CMakeLists.txt b/dbus-cxx-uv/CMakeLists.txt | ||
| index 23d51c5..a1e3abb 100644 | ||
| --- a/dbus-cxx-uv/CMakeLists.txt | ||
| +++ b/dbus-cxx-uv/CMakeLists.txt | ||
| @@ -18,7 +18,7 @@ else() | ||
| set( LIBUV_PKG_NAME libuv ) | ||
| endif() | ||
|
|
||
| -pkg_check_modules( libuv REQUIRED IMPORTED_TARGET ${LIBUV_PKG_NAME} ) | ||
| +find_package(libuv CONFIG REQUIRED) | ||
|
|
||
| set( dbus-cxx-uv-headers dbus-cxx-uv.h uvdispatcher.h ) | ||
| set( dbus-cxx-uv-sources dbus-cxx-uv.cpp uvdispatcher.cpp ) | ||
| @@ -33,7 +33,7 @@ target_include_directories( dbus-cxx-uv INTERFACE | ||
| $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> | ||
| $<INSTALL_INTERFACE:include/dbus-cxx-uv-${DBUS_CXX_INCLUDE_VERSION}> | ||
| ) | ||
| -target_link_libraries( dbus-cxx-uv PUBLIC PkgConfig::libuv ) | ||
| +target_link_libraries( dbus-cxx-uv PUBLIC $<IF:$<TARGET_EXISTS:libuv::uv_a>,libuv::uv_a,libuv::uv> ) | ||
|
|
||
| set_property( TARGET dbus-cxx-uv PROPERTY CXX_STANDARD 17 ) | ||
|
|
||
| @@ -74,6 +74,6 @@ INSTALL( FILES "${CMAKE_CURRENT_BINARY_DIR}/dbus-cxx-uv-2.0.pc" | ||
| install( TARGETS dbus-cxx-uv | ||
| EXPORT dbus-cxxTargets | ||
| COMPONENT uv | ||
| - PUBLIC_HEADER DESTINATION include/dbus-cxx-uv-${DBUS_CXX_INCLUDE_VERSION} | ||
| - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" | ||
| - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ) | ||
| + PUBLIC_HEADER DESTINATION include/dbus-cxx-uv-${DBUS_CXX_INCLUDE_VERSION} COMPONENT uv | ||
| + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT uv | ||
| + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT uv) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| { | ||
| "name": "dbus-cxx", | ||
| "version": "2.6.0", | ||
| "description": "DBus-cxx provides an object-oriented interface to DBus.", | ||
| "homepage": "https://dbus-cxx.github.io/", | ||
| "license": "LGPL-3.0-or-later AND BSD-3-Clause", | ||
| "supports": "linux", | ||
| "dependencies": [ | ||
| "libsigcpp", | ||
| { | ||
| "name": "vcpkg-cmake", | ||
| "host": true | ||
| }, | ||
| { | ||
| "name": "vcpkg-cmake-config", | ||
| "host": true | ||
| } | ||
| ], | ||
| "default-features": [ | ||
| "glib", | ||
| "libuv", | ||
| "qt6" | ||
| ], | ||
|
luadebug marked this conversation as resolved.
Comment on lines
+19
to
+23
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @JavierMatosD Why is this set of default-features acceptable here and rejected in other proposal? An application wouldn't use three different dispatchers at the same time.
https://dbus-cxx.github.io/ > Features And all three options are off by default upstream.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are not acceptable. This was an oversight on my part and should not have been merged in its current form.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reverting this PR @luadebug, please reopen this PR and note we generally try to avoid using "default-features" as it was intended to only provide the minimum required for the port to be usable but default features can be difficult to disable downstream. I recommend taking a look at our docs on default features: https://learn.microsoft.com/en-us/vcpkg/concepts/default-features#role-of-default-features and its constraints https://learn.microsoft.com/en-us/vcpkg/contributing/maintainer-guide#default-features-should-enable-behaviors-not-apis |
||
| "features": { | ||
| "glib": { | ||
| "description": "Build dbus-cxx with GLib module", | ||
| "dependencies": [ | ||
| "glib" | ||
| ] | ||
| }, | ||
| "libuv": { | ||
| "description": "Build dbus-cxx with libuv module", | ||
| "dependencies": [ | ||
| "libuv" | ||
| ] | ||
| }, | ||
| "qt6": { | ||
| "description": "Build dbus-cxx with QT6 module", | ||
| "dependencies": [ | ||
| "qtbase" | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| set(VCPKG_POLICY_EMPTY_PACKAGE enabled) | ||
| vcpkg_cmake_configure( | ||
| SOURCE_PATH "${CURRENT_PORT_DIR}/project" | ||
| ) | ||
| vcpkg_cmake_build() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| cmake_minimum_required(VERSION 3.25.1) | ||
| project(dbus-cxx-test CXX) | ||
| set(CMAKE_CXX_STANDARD 17) | ||
| find_package(dbus-cxx CONFIG REQUIRED COMPONENTS glib uv qt) | ||
| add_executable(main main.cpp) | ||
| target_link_libraries(main PRIVATE dbus-cxx::dbus-cxx dbus-cxx::dbus-cxx-glib dbus-cxx::dbus-cxx-uv dbus-cxx::dbus-cxx-qt) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #include <dbus-cxx.h> | ||
| #include <dbus-cxx-glib.h> | ||
| #include <dbus-cxx-uv.h> | ||
| #include <dbus-cxx-qt.h> | ||
| #include <memory> | ||
| int main() | ||
| { | ||
| auto connection = DBus::Connection::create(DBus::BusType::SESSION); | ||
| std::shared_ptr<DBus::Dispatcher> GLibDisp = DBus::GLib::GLibDispatcher::create(); | ||
| std::shared_ptr<DBus::Dispatcher> UvDisp = DBus::Uv::UvDispatcher::create(); | ||
| std::shared_ptr<DBus::Dispatcher> QTdisp = DBus::Qt::QtDispatcher::create(); | ||
| return 0; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "name": "vcpkg-ci-dbus-cxx", | ||
| "version-string": "ci", | ||
| "description": "Validates dbus-cxx", | ||
| "dependencies": [ | ||
| "dbus-cxx", | ||
| { | ||
| "name": "vcpkg-cmake", | ||
| "host": true | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "versions": [ | ||
| { | ||
| "git-tree": "a5186297adc882cab80c9ba4d5de5ddc9e3ddcdc", | ||
| "version": "2.6.0", | ||
| "port-version": 0 | ||
| } | ||
| ] | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.