diff --git a/recipes/cppkafka/all/conandata.yml b/recipes/cppkafka/all/conandata.yml index 741ef5502bb96..19152c1beae0c 100644 --- a/recipes/cppkafka/all/conandata.yml +++ b/recipes/cppkafka/all/conandata.yml @@ -1,9 +1,15 @@ sources: + "0.4.1": + url: "https://github.com/mfontanini/cppkafka/archive/refs/tags/v0.4.1.tar.gz" + sha256: "45770ae0404cb9ba73d659618c51cd55b574c66ed3c7b148360222fb524b0ff7" "0.4.0": url: "https://github.com/mfontanini/cppkafka/archive/refs/tags/0.4.0.tar.gz" sha256: "f4f05eb7a180a856663b02ec0b777283275ef88e5523f3013fd51c6c4ab63b5a" patches: + "0.4.1": + - patch_file: "patches/0.4.0-0001-no-template-export.patch" + - patch_file: "patches/0.4.1-0003-clean-rpath.patch" "0.4.0": - - patch_file: "patches/0001-no-template-export.patch" - - patch_file: "patches/0002-cppstd.patch" - - patch_file: "patches/0003-clean-rpath.patch" + - patch_file: "patches/0.4.0-0001-no-template-export.patch" + - patch_file: "patches/0.4.0-0002-cppstd.patch" + - patch_file: "patches/0.4.0-0003-clean-rpath.patch" diff --git a/recipes/cppkafka/all/conanfile.py b/recipes/cppkafka/all/conanfile.py index 41a226efdbb76..1f97490b74bf8 100644 --- a/recipes/cppkafka/all/conanfile.py +++ b/recipes/cppkafka/all/conanfile.py @@ -2,6 +2,7 @@ from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -10,11 +11,10 @@ class CppKafkaConan(ConanFile): name = "cppkafka" description = "Modern C++ Apache Kafka client library (wrapper for librdkafka)" - topics = ("librdkafka", "kafka") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/mfontanini/cppkafka" - license = "MIT" - + topics = ("librdkafka", "kafka") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -41,8 +41,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.81.0") - self.requires("librdkafka/2.0.2") + self.requires("boost/1.83.0", transitive_headers=True) + self.requires("librdkafka/2.3.0", transitive_headers=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -57,7 +57,7 @@ def generate(self): tc.variables["CPPKAFKA_DISABLE_TESTS"] = True tc.variables["CPPKAFKA_DISABLE_EXAMPLES"] = True tc.variables["CPPKAFKA_RDKAFKA_STATIC_LIB"] = False # underlying logic is useless - if self.settings.os == "Windows": + if Version(self.version) < "0.4.1" and self.settings.os == "Windows": tc.preprocessor_definitions["NOMINMAX"] = 1 tc.generate() cd = CMakeDeps(self) diff --git a/recipes/cppkafka/all/patches/0001-no-template-export.patch b/recipes/cppkafka/all/patches/0.4.0-0001-no-template-export.patch similarity index 100% rename from recipes/cppkafka/all/patches/0001-no-template-export.patch rename to recipes/cppkafka/all/patches/0.4.0-0001-no-template-export.patch diff --git a/recipes/cppkafka/all/patches/0002-cppstd.patch b/recipes/cppkafka/all/patches/0.4.0-0002-cppstd.patch similarity index 100% rename from recipes/cppkafka/all/patches/0002-cppstd.patch rename to recipes/cppkafka/all/patches/0.4.0-0002-cppstd.patch diff --git a/recipes/cppkafka/all/patches/0003-clean-rpath.patch b/recipes/cppkafka/all/patches/0.4.0-0003-clean-rpath.patch similarity index 100% rename from recipes/cppkafka/all/patches/0003-clean-rpath.patch rename to recipes/cppkafka/all/patches/0.4.0-0003-clean-rpath.patch diff --git a/recipes/cppkafka/all/patches/0.4.1-0003-clean-rpath.patch b/recipes/cppkafka/all/patches/0.4.1-0003-clean-rpath.patch new file mode 100644 index 0000000000000..86c2d7f5ce27a --- /dev/null +++ b/recipes/cppkafka/all/patches/0.4.1-0003-clean-rpath.patch @@ -0,0 +1,28 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6c667df..46c5590 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -28,7 +28,7 @@ if (NOT CMAKE_CXX_FLAGS) + add_definitions("-DNOGDI=1") + add_definitions("-DNOMINMAX=1") + else() +- set(CMAKE_CXX_FLAGS "-Wall") ++# set(CMAKE_CXX_FLAGS "-Wall") + endif() + endif() + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 214ccd4..d2667ce 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -46,8 +46,8 @@ set_target_properties(${TARGET_NAME} PROPERTIES + ARCHIVE_OUTPUT_NAME "${TARGET_NAME}" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_INSTALL_LIBDIR}" + LIBRARY_OUTPUT_NAME "${TARGET_NAME}" +- INSTALL_RPATH "${CMAKE_INSTALL_LIBDIR}" +- INSTALL_RPATH_USE_LINK_PATH TRUE ++ # INSTALL_RPATH "${CMAKE_INSTALL_LIBDIR}" ++ # INSTALL_RPATH_USE_LINK_PATH TRUE + VERSION ${CPPKAFKA_VERSION} + SOVERSION ${CPPKAFKA_VERSION}) + # In CMake >= 3.15 Boost::boost == Boost::headers diff --git a/recipes/cppkafka/config.yml b/recipes/cppkafka/config.yml index da269653d6e6b..bf6438ecd493c 100644 --- a/recipes/cppkafka/config.yml +++ b/recipes/cppkafka/config.yml @@ -1,3 +1,5 @@ versions: + "0.4.1": + folder: "all" "0.4.0": folder: "all"