Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / by-name / mo / modern-cpp-kafka / package.nix
blobdaa3396255bcbe926d8bf2351b1b02a9560cf847
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , fetchpatch
5 , cmake
6 , boost
7 , rdkafka
8 , gtest
9 , rapidjson
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";
19     rev = "v${version}";
20     hash = "sha256-7hkwM1YbveQpDRqwMZ3MXM88LTwlAT7uB8NL0t409To=";
21   };
23   patches = [
24     (fetchpatch {
25       name = "fix-avoid-overwriting-library-paths.patch";
26       url = "https://github.com/morganstanley/modern-cpp-kafka/pull/221.patch";
27       hash = "sha256-UsQcMvJoRTn5kgXhmXOyqfW3n59kGKO596U2WjtdqAY=";
28     })
29     (fetchpatch {
30       name = "add-pkg-config-cmake-config.patch";
31       url = "https://github.com/morganstanley/modern-cpp-kafka/pull/222.patch";
32       hash = "sha256-OjoSttnpgEwSZjCVKc888xJb5f1Dulu/rQqoGmqXNM4=";
33     })
34   ];
36   nativeBuildInputs = [ cmake ];
37   buildInputs = [ boost ];
38   propagatedBuildInputs = [ rdkafka ];
40   cmakeFlags = [
41     "-DLIBRDKAFKA_INCLUDE_DIR=${rdkafka.out}/include"
42     "-DGTEST_LIBRARY_DIR=${gtest.out}/lib"
43     "-DGTEST_INCLUDE_DIR=${gtest.dev}/include"
44     "-DRAPIDJSON_INCLUDE_DIRS=${rapidjson.out}/include"
45     "-DCMAKE_CXX_FLAGS=-Wno-uninitialized"
46   ];
48   checkInputs = [ gtest rapidjson ];
50   meta = with lib; {
51     description = "A C++ API for Kafka clients (i.e. KafkaProducer, KafkaConsumer, AdminClient)";
52     homepage = "https://github.com/morganstanley/modern-cpp-kafka";
53     license = licenses.asl20;
54     maintainers = with maintainers; [ ditsuke ];
55     platforms = platforms.unix;
56   };