12 stdenv.mkDerivation rec {
13 pname = "modern-cpp-kafka";
14 version = "2023.03.07";
16 src = fetchFromGitHub {
17 repo = "modern-cpp-kafka";
18 owner = "morganstanley";
20 hash = "sha256-7hkwM1YbveQpDRqwMZ3MXM88LTwlAT7uB8NL0t409To=";
24 (fetchpatch { # https://github.com/morganstanley/modern-cpp-kafka/pull/221
25 name = "fix-avoid-overwriting-library-paths.patch";
26 url = "https://github.com/morganstanley/modern-cpp-kafka/compare/a146d10bcf166f55299c7a55728abaaea52cb0e5...a0b5ec08315759097ce656813be57b2c38d79091.patch";
27 hash = "sha256-UsQcMvJoRTn5kgXhmXOyqfW3n59kGKO596U2WjtdqAY=";
29 (fetchpatch { # https://github.com/morganstanley/modern-cpp-kafka/pull/222
30 name = "add-pkg-config-cmake-config.patch";
31 url = "https://github.com/morganstanley/modern-cpp-kafka/commit/edc576ab83710412f6201e2bb8de5cb41682ee4a.patch";
32 hash = "sha256-OjoSttnpgEwSZjCVKc888xJb5f1Dulu/rQqoGmqXNM4=";
34 # Fix gcc-13 build failure:
35 # https://github.com/morganstanley/modern-cpp-kafka/pull/229
37 name = "add-pkg-config-cmake-config.patch";
38 url = "https://github.com/morganstanley/modern-cpp-kafka/commit/236f8f91f5c3ad6e1055a6f55cd3aebd218e1226.patch";
39 hash = "sha256-cy568TQUu08sadq79hDz9jMvDqiDjfr+1cLMxFWGm1Q=";
44 # Blanket -Werror tends to fail on minor unrelated warnings.
45 # Currently this fixes gcc-13 build failure.
46 substituteInPlace CMakeLists.txt --replace-fail '"-Werror"' ' '
49 nativeBuildInputs = [ cmake ];
50 buildInputs = [ boost ];
51 propagatedBuildInputs = [ rdkafka ];
54 "-DLIBRDKAFKA_INCLUDE_DIR=${rdkafka.out}/include"
55 "-DGTEST_LIBRARY_DIR=${gtest.out}/lib"
56 "-DGTEST_INCLUDE_DIR=${gtest.dev}/include"
57 "-DRAPIDJSON_INCLUDE_DIRS=${rapidjson.out}/include"
58 "-DCMAKE_CXX_FLAGS=-Wno-uninitialized"
61 checkInputs = [ gtest rapidjson ];
64 description = "C++ API for Kafka clients (i.e. KafkaProducer, KafkaConsumer, AdminClient)";
65 homepage = "https://github.com/morganstanley/modern-cpp-kafka";
66 license = licenses.asl20;
67 maintainers = with maintainers; [ ditsuke ];
68 platforms = platforms.unix;