git: cb838d2e468d - main - devel/avro-cpp: fix const bugs in custom formatters

From: Matthias Andree <mandree_at_FreeBSD.org>
Date: Sun, 10 Aug 2025 19:03:24 UTC
The branch main has been updated by mandree:

URL: https://cgit.FreeBSD.org/ports/commit/?id=cb838d2e468df09f90a4cd4b57cb3ff2b66367e4

commit cb838d2e468df09f90a4cd4b57cb3ff2b66367e4
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2025-08-09 00:40:57 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2025-08-10 19:02:44 +0000

    devel/avro-cpp: fix const bugs in custom formatters
    
    These will break with fmt 11.2.
    
    Since the project is broken in other ways, do only the minimum
    so it will survive a feature-incomplete inefficient "TRYBROKEN=yes"
    build, and then mark it BROKEN with its bugs.
    
    PR:             286858
    Reported by:    diizzy@
    Approved by:    maintainer timeout (sunpoet@, 82 days)
---
 devel/avro-cpp/Makefile                          |  3 ++-
 devel/avro-cpp/files/patch-include_avro_Node.hh  | 11 +++++++++++
 devel/avro-cpp/files/patch-include_avro_Types.hh | 11 +++++++++++
 3 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/devel/avro-cpp/Makefile b/devel/avro-cpp/Makefile
index 84f0f36a00b2..373b34492473 100644
--- a/devel/avro-cpp/Makefile
+++ b/devel/avro-cpp/Makefile
@@ -11,10 +11,11 @@ COMMENT=	C++ library for Apache Avro
 WWW=		https://avro.apache.org/ \
 		https://github.com/apache/avro
 
+BROKEN=		Lots of cmake warnings, does not find snappy, does not link libfmt dynamically
+
 LICENSE=	APACHE20
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
-BUILD_DEPENDS=	libfmt>=10.2.1<10.2.1_99:devel/libfmt
 LIB_DEPENDS=	libboost_regex.so:devel/boost-libs \
 		libfmt.so:devel/libfmt \
 		libsnappy.so:archivers/snappy
diff --git a/devel/avro-cpp/files/patch-include_avro_Node.hh b/devel/avro-cpp/files/patch-include_avro_Node.hh
new file mode 100644
index 000000000000..bf11578b713f
--- /dev/null
+++ b/devel/avro-cpp/files/patch-include_avro_Node.hh
@@ -0,0 +1,11 @@
+--- include/avro/Node.hh.orig	2024-07-26 07:46:40 UTC
++++ include/avro/Node.hh
+@@ -219,7 +219,7 @@ struct fmt::formatter<avro::Name> : fmt::formatter<std
+ 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);
+     }
+ };
diff --git a/devel/avro-cpp/files/patch-include_avro_Types.hh b/devel/avro-cpp/files/patch-include_avro_Types.hh
new file mode 100644
index 000000000000..097457641fe8
--- /dev/null
+++ b/devel/avro-cpp/files/patch-include_avro_Types.hh
@@ -0,0 +1,11 @@
+--- include/avro/Types.hh.orig	2024-07-26 07:46:40 UTC
++++ include/avro/Types.hh
+@@ -113,7 +113,7 @@ struct fmt::formatter<avro::Type> : fmt::formatter<std
+ 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);
+     }
+ };