diff --git a/ports/sdbus-cpp/pic.patch b/ports/sdbus-cpp/pic.patch new file mode 100644 index 0000000000..3b2c06c45c --- /dev/null +++ b/ports/sdbus-cpp/pic.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7332b23..822a594 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -130,7 +130,7 @@ target_compile_definitions(sdbus-c++-objlib PRIVATE + target_include_directories(sdbus-c++-objlib PUBLIC $ + $) +-if(DEFINED BUILD_SHARED_LIBS) ++if(BUILD_SHARED_LIBS) +- set_target_properties(sdbus-c++-objlib PROPERTIES POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}) ++ set_target_properties(sdbus-c++-objlib PROPERTIES POSITION_INDEPENDENT_CODE ON) + endif() + if(BUILD_LIBSYSTEMD) + add_dependencies(sdbus-c++-objlib LibsystemdBuildProject) diff --git a/ports/sdbus-cpp/portfile.cmake b/ports/sdbus-cpp/portfile.cmake new file mode 100644 index 0000000000..f9b952ad66 --- /dev/null +++ b/ports/sdbus-cpp/portfile.cmake @@ -0,0 +1,38 @@ +message(WARNING "You will need to install sytemd dependencies to build sdbus-cpp:\nsudo apt install libsystemd-dev\n") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Kistler-Group/sdbus-cpp + REF "v${VERSION}" + SHA512 8f4cb9ae88b1ec0db0bcc27e131fcb9ad8a8bc88e39721b3b73f63e057bae4cd36619894e25114ccddb1a8e6c21db2f80adcabb3263ff5d8b34b72af7563afe2 + PATCHES + pic.patch # can be dropped once https://github.com/Kistler-Group/sdbus-cpp/pull/361 is merged+released +) + + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + tool BUILD_CODE_GEN +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS ${FEATURE_OPTIONS} + -DBUILD_LIBSYSTEMD=OFF +) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/sdbus-c++) +vcpkg_fixup_pkgconfig() +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/share" + "${CURRENT_PACKAGES_DIR}/debug/bin" +) + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING" "${SOURCE_PATH}/COPYING-LGPL-Exception") +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") + +if ("tool" IN_LIST FEATURES) + vcpkg_copy_tools(TOOL_NAMES sdbus-c++-xml2cpp AUTO_CLEAN) +endif() diff --git a/ports/sdbus-cpp/usage b/ports/sdbus-cpp/usage new file mode 100644 index 0000000000..bea252a667 --- /dev/null +++ b/ports/sdbus-cpp/usage @@ -0,0 +1,3 @@ +sdbus-cpp provides CMake targets: + find_package(sdbus-c++ REQUIRED) + target_link_libraries(main PRIVATE SDBusCpp::sdbus-c++) diff --git a/ports/sdbus-cpp/vcpkg.json b/ports/sdbus-cpp/vcpkg.json new file mode 100644 index 0000000000..3895a5f0e7 --- /dev/null +++ b/ports/sdbus-cpp/vcpkg.json @@ -0,0 +1,28 @@ +{ + "name": "sdbus-cpp", + "version": "1.3.0", + "description": "High-level C++ D-Bus library for Linux designed to provide easy-to-use yet powerful API in modern C++", + "homepage": "https://github.com/Kistler-Group/sdbus-cpp", + "license": "LGPL-2.1", + "supports": "linux", + "dependencies": [ + "dbus", + "libsystemd", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "tool": { + "description": "build C++ codegen tool", + "dependencies": [ + "expat" + ] + } + } +} diff --git a/versions/baseline.json b/versions/baseline.json index 41c2b79fbe..80bd21092b 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7524,6 +7524,10 @@ "baseline": "2018-08-26-16e6f435", "port-version": 3 }, + "sdbus-cpp": { + "baseline": "1.3.0", + "port-version": 0 + }, "sdformat10": { "baseline": "10.0.0", "port-version": 3 diff --git a/versions/s-/sdbus-cpp.json b/versions/s-/sdbus-cpp.json new file mode 100644 index 0000000000..6fdcf9ad52 --- /dev/null +++ b/versions/s-/sdbus-cpp.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "cae6cd5686aeefb86b4b97cda6d258d80a9eb5b6", + "version": "1.3.0", + "port-version": 0 + } + ] +}