Commit 6af2f8a9 authored by Kirill Radzikhovskyy's avatar Kirill Radzikhovskyy
Browse files

avro-cpp: fix build with fmt 11

Add patches to make fmt formatters const, as required by fmt 11.
parent 92113a1a
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
diff --git a/include/avro/Node.hh b/include/avro/Node.hh
--- a/include/avro/Node.hh
+++ b/include/avro/Node.hh
@@ -219,7 +219,7 @@ template<>
 struct fmt::formatter<avro::Name> : fmt::formatter<std::string> {
     template<typename FormatContext>
-    auto format(const avro::Name &n, FormatContext &ctx) {
+    auto format(const avro::Name &n, FormatContext &ctx) const {
         return fmt::formatter<std::string>::format(n.fullname(), ctx);
     }
 };
 No newline at end of file
+11 −0
Original line number Diff line number Diff line
diff --git a/include/avro/Types.hh b/include/avro/Types.hh
--- a/include/avro/Types.hh
+++ b/include/avro/Types.hh
@@ -113,7 +113,7 @@ template<>
 struct fmt::formatter<avro::Type> : fmt::formatter<std::string> {
     template<typename FormatContext>
-    auto format(avro::Type t, FormatContext &ctx) {
+    auto format(avro::Type t, FormatContext &ctx) const {
         return fmt::formatter<std::string>::format(avro::toString(t), ctx);
     }
 };
 No newline at end of file
+4 −0
Original line number Diff line number Diff line
@@ -18,8 +18,12 @@ stdenv.mkDerivation rec {
    hash = "sha256-8u33cSanWw7BrRZncr4Fg1HOo9dESL5+LO8gBQwPmKs=";
  };

  # TODO: remove fmt formatter patches when updating to next version
  # Patches exist upstream but don't apply cleanly.
  patches = [
    ./0001-get-rid-of-fmt-fetchcontent.patch
    ./0002-fix-fmt-name-formatter.patch
    ./0003-fix-fmt-type-formatter.patch
  ];

  nativeBuildInputs = [