From a3e8197f2d7fa043f5c0dc5ccac3446fac6ebac2 Mon Sep 17 00:00:00 2001 From: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> Date: Tue, 3 Sep 2019 16:08:17 -0700 Subject: [cppkafka] Add new port (#7987) * [cppkafka] Add new port * Add test and example options. --- ports/cppkafka/CONTROL | 5 +++++ ports/cppkafka/portfile.cmake | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 ports/cppkafka/CONTROL create mode 100644 ports/cppkafka/portfile.cmake (limited to 'ports/cppkafka') diff --git a/ports/cppkafka/CONTROL b/ports/cppkafka/CONTROL new file mode 100644 index 000000000..f3a34e1fa --- /dev/null +++ b/ports/cppkafka/CONTROL @@ -0,0 +1,5 @@ +Source: cppkafka +Version: 0.3.1 +Homepage: https://github.com/mfontanini/cppkafka +Description: cppkafka allows C++ applications to consume and produce messages using the Apache Kafka protocol. The library is built on top of librdkafka, and provides a high level API that uses modern C++ features to make it easier to write code while keeping the wrapper's performance overhead to a minimum. +Build-Depends: boost-program-options, librdkafka \ No newline at end of file diff --git a/ports/cppkafka/portfile.cmake b/ports/cppkafka/portfile.cmake new file mode 100644 index 000000000..7b97e7f0d --- /dev/null +++ b/ports/cppkafka/portfile.cmake @@ -0,0 +1,24 @@ +include(vcpkg_common_functions) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO mfontanini/cppkafka + REF v0.3.1 + SHA512 60d01ce1dd9bd9119676be939ed5ab03539abb1f945c1b31e432edfe0f06542778f7fef37696f5ff19c53024f44d5cbd8aeddbbb231c38b098e05285d3ff0cab + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DCPPKAFKA_DISABLE_TESTS=ON + -DCPPKAFKA_DISABLE_EXAMPLES=ON +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file -- cgit v1.2.3 From 50b49af28a7ab619b341f3ba20d47592d302baab Mon Sep 17 00:00:00 2001 From: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> Date: Fri, 27 Sep 2019 09:48:09 -0700 Subject: [cppkafka] Fix dynamic build. (#8073) * [cppkafka] Fix dynamic build. * [cppkafka] Remove CPPKAFKA_BOOST_STATIC_LIBS * Remove CPPKAFKA_RDKAFKA_STATIC_LIB option --- ports/cppkafka/CONTROL | 2 +- ports/cppkafka/fix-dynamic.patch | 12 ++++++++++++ ports/cppkafka/portfile.cmake | 10 ++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 ports/cppkafka/fix-dynamic.patch (limited to 'ports/cppkafka') diff --git a/ports/cppkafka/CONTROL b/ports/cppkafka/CONTROL index f3a34e1fa..5fb06c47d 100644 --- a/ports/cppkafka/CONTROL +++ b/ports/cppkafka/CONTROL @@ -1,5 +1,5 @@ Source: cppkafka -Version: 0.3.1 +Version: 0.3.1-1 Homepage: https://github.com/mfontanini/cppkafka Description: cppkafka allows C++ applications to consume and produce messages using the Apache Kafka protocol. The library is built on top of librdkafka, and provides a high level API that uses modern C++ features to make it easier to write code while keeping the wrapper's performance overhead to a minimum. Build-Depends: boost-program-options, librdkafka \ No newline at end of file diff --git a/ports/cppkafka/fix-dynamic.patch b/ports/cppkafka/fix-dynamic.patch new file mode 100644 index 000000000..e19188e27 --- /dev/null +++ b/ports/cppkafka/fix-dynamic.patch @@ -0,0 +1,12 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 5d31078..b1d3634 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -43,6 +43,7 @@ target_include_directories(cppkafka PUBLIC ${PROJECT_SOURCE_DIR}/include) + + install( + TARGETS cppkafka ++ RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + COMPONENT dev diff --git a/ports/cppkafka/portfile.cmake b/ports/cppkafka/portfile.cmake index 7b97e7f0d..fbb6e3bce 100644 --- a/ports/cppkafka/portfile.cmake +++ b/ports/cppkafka/portfile.cmake @@ -6,18 +6,28 @@ vcpkg_from_github( REF v0.3.1 SHA512 60d01ce1dd9bd9119676be939ed5ab03539abb1f945c1b31e432edfe0f06542778f7fef37696f5ff19c53024f44d5cbd8aeddbbb231c38b098e05285d3ff0cab HEAD_REF master + PATCHES fix-dynamic.patch ) +if (VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(CPPKAFKA_BUILD_SHARED OFF) +else() + set(CPPKAFKA_BUILD_SHARED ON) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS + -DCPPKAFKA_BUILD_SHARED=${CPPKAFKA_BUILD_SHARED} -DCPPKAFKA_DISABLE_TESTS=ON -DCPPKAFKA_DISABLE_EXAMPLES=ON ) vcpkg_install_cmake() +vcpkg_copy_pdbs() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright -- cgit v1.2.3 From 726c11148105a97aef39bec024fdb7c140b1b154 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Mon, 7 Oct 2019 19:35:13 +0200 Subject: [vcpkg] fatal_error when patch fails to apply (#8087) vcpkg will now fail on failure to apply patches except when using `--head`. --- ports/cppkafka/CONTROL | 4 ++-- ports/cppkafka/fix-dynamic.patch | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'ports/cppkafka') diff --git a/ports/cppkafka/CONTROL b/ports/cppkafka/CONTROL index 5fb06c47d..5dec433ef 100644 --- a/ports/cppkafka/CONTROL +++ b/ports/cppkafka/CONTROL @@ -1,5 +1,5 @@ Source: cppkafka -Version: 0.3.1-1 +Version: 0.3.1-2 Homepage: https://github.com/mfontanini/cppkafka Description: cppkafka allows C++ applications to consume and produce messages using the Apache Kafka protocol. The library is built on top of librdkafka, and provides a high level API that uses modern C++ features to make it easier to write code while keeping the wrapper's performance overhead to a minimum. -Build-Depends: boost-program-options, librdkafka \ No newline at end of file +Build-Depends: boost-program-options, librdkafka diff --git a/ports/cppkafka/fix-dynamic.patch b/ports/cppkafka/fix-dynamic.patch index e19188e27..f18a0fbf7 100644 --- a/ports/cppkafka/fix-dynamic.patch +++ b/ports/cppkafka/fix-dynamic.patch @@ -1,12 +1,12 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 5d31078..b1d3634 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -43,6 +43,7 @@ target_include_directories(cppkafka PUBLIC ${PROJECT_SOURCE_DIR}/include) - - install( - TARGETS cppkafka -+ RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - COMPONENT dev +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 5d31078..b1d3634 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -43,6 +43,7 @@ target_include_directories(cppkafka PUBLIC ${PROJECT_SOURCE_DIR}/include) + + install( + TARGETS cppkafka ++ RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + COMPONENT dev -- cgit v1.2.3