From f766f1060735814ac683fe4bd4c93e354a503dd1 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 10 Feb 2024 11:51:49 +0000 Subject: [PATCH] modern-cpp-kafka: fix `gcc-13` build failure Without the change build fails as https://hydra.nixos.org/build/247616582: In file included from /build/source/tests/unit/TestKafkaMetrics.cc:1: /build/source/include/kafka/addons/KafkaMetrics.h:46:22: error: 'int64_t' is not a member of 'std'; did you mean 'int64_t'? 46 | ResultsType getInt(const KeysType& keys) const { return get(keys); } | ^~~~~~~ --- pkgs/by-name/mo/modern-cpp-kafka/package.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/by-name/mo/modern-cpp-kafka/package.nix b/pkgs/by-name/mo/modern-cpp-kafka/package.nix index daa3396255bc..7986c63aab53 100644 --- a/pkgs/by-name/mo/modern-cpp-kafka/package.nix +++ b/pkgs/by-name/mo/modern-cpp-kafka/package.nix @@ -31,8 +31,21 @@ stdenv.mkDerivation rec { url = "https://github.com/morganstanley/modern-cpp-kafka/pull/222.patch"; hash = "sha256-OjoSttnpgEwSZjCVKc888xJb5f1Dulu/rQqoGmqXNM4="; }) + # Fix gcc-13 build failure: + # https://github.com/morganstanley/modern-cpp-kafka/pull/229 + (fetchpatch { + name = "add-pkg-config-cmake-config.patch"; + url = "https://github.com/morganstanley/modern-cpp-kafka/commit/236f8f91f5c3ad6e1055a6f55cd3aebd218e1226.patch"; + hash = "sha256-cy568TQUu08sadq79hDz9jMvDqiDjfr+1cLMxFWGm1Q="; + }) ]; + postPatch = '' + # Blanket -Werror tends to fail on minor unrelated warnings. + # Currently this fixes gcc-13 build failure. + substituteInPlace CMakeLists.txt --replace-fail '"-Werror"' ' ' + ''; + nativeBuildInputs = [ cmake ]; buildInputs = [ boost ]; propagatedBuildInputs = [ rdkafka ];