From 6af2f8a95b385e4e468452f9d5c4ca9129dde711 Mon Sep 17 00:00:00 2001 From: Kirill Radzikhovskyy Date: Wed, 15 Oct 2025 19:26:36 +1100 Subject: [PATCH] avro-cpp: fix build with fmt 11 Add patches to make fmt formatters const, as required by fmt 11. --- .../av/avro-cpp/0002-fix-fmt-name-formatter.patch | 11 +++++++++++ .../av/avro-cpp/0003-fix-fmt-type-formatter.patch | 11 +++++++++++ pkgs/by-name/av/avro-cpp/package.nix | 4 ++++ 3 files changed, 26 insertions(+) create mode 100644 pkgs/by-name/av/avro-cpp/0002-fix-fmt-name-formatter.patch create mode 100644 pkgs/by-name/av/avro-cpp/0003-fix-fmt-type-formatter.patch diff --git a/pkgs/by-name/av/avro-cpp/0002-fix-fmt-name-formatter.patch b/pkgs/by-name/av/avro-cpp/0002-fix-fmt-name-formatter.patch new file mode 100644 index 000000000000..9fc82840b61b --- /dev/null +++ b/pkgs/by-name/av/avro-cpp/0002-fix-fmt-name-formatter.patch @@ -0,0 +1,11 @@ +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 : fmt::formatter { + template +- auto format(const avro::Name &n, FormatContext &ctx) { ++ auto format(const avro::Name &n, FormatContext &ctx) const { + return fmt::formatter::format(n.fullname(), ctx); + } + }; \ No newline at end of file diff --git a/pkgs/by-name/av/avro-cpp/0003-fix-fmt-type-formatter.patch b/pkgs/by-name/av/avro-cpp/0003-fix-fmt-type-formatter.patch new file mode 100644 index 000000000000..cb13eb4cb915 --- /dev/null +++ b/pkgs/by-name/av/avro-cpp/0003-fix-fmt-type-formatter.patch @@ -0,0 +1,11 @@ +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 : fmt::formatter { + template +- auto format(avro::Type t, FormatContext &ctx) { ++ auto format(avro::Type t, FormatContext &ctx) const { + return fmt::formatter::format(avro::toString(t), ctx); + } + }; \ No newline at end of file diff --git a/pkgs/by-name/av/avro-cpp/package.nix b/pkgs/by-name/av/avro-cpp/package.nix index 09f24f5d9621..df6a4b80d39c 100644 --- a/pkgs/by-name/av/avro-cpp/package.nix +++ b/pkgs/by-name/av/avro-cpp/package.nix @@ -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 = [