git: 024e2eaf9829 - main - devel/hyprlang: unbreak build with libc++ 16

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Fri, 05 Jan 2024 15:09:01 UTC
The branch main has been updated by jbeich:

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

commit 024e2eaf982905be2a8b80e7b54311154647af94
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2024-01-05 04:24:37 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2024-01-05 15:07:54 +0000

    devel/hyprlang: unbreak build with libc++ 16
    
    src/config.cpp:276:42: error: no member named 'format' in namespace 'std'
                        result.setError(std::format("special category's first value must be the key. Key for <{}> is <{}>", PCAT->name, PCAT->key));
                                        ~~~~~^
    src/config.cpp:287:34: error: no member named 'format' in namespace 'std'
                result.setError(std::format("config option <{}> does not exist.", valueName));
                                ~~~~~^
    src/config.cpp:297:38: error: no member named 'format' in namespace 'std'
                    result.setError(std::format("failed parsing an int: {}", e.what()));
                                    ~~~~~^
    src/config.cpp:306:38: error: no member named 'format' in namespace 'std'
                    result.setError(std::format("failed parsing a float: {}", e.what()));
                                    ~~~~~^
    src/config.cpp:324:38: error: no member named 'format' in namespace 'std'
                    result.setError(std::format("failed parsing a vec2: {}", e.what()));
                                    ~~~~~^
    src/config.cpp:533:38: error: no member named 'format' in namespace 'std'
                impl->parseError += std::format("Config error in file {} at line {}: {}", file, linenum, RET.errorStdString);
                                    ~~~~~^
    src/config.cpp:546:38: error: no member named 'format' in namespace 'std'
                impl->parseError += std::format("Config error in file {}: Unclosed category at EOF", file);
                                    ~~~~~^
    
    Reported by:    pkg-fallout
---
 devel/hyprlang/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/devel/hyprlang/Makefile b/devel/hyprlang/Makefile
index ce8b7557ccc5..c67f2d34f8d0 100644
--- a/devel/hyprlang/Makefile
+++ b/devel/hyprlang/Makefile
@@ -23,4 +23,10 @@ PLIST_FILES=	include/${PORTNAME}.hpp \
 		lib/lib${PORTNAME}.so \
 		share/pkgconfig/${PORTNAME}.pc
 
+# XXX Drop after FreeBSD 14.0 EOL around 2025-03-01
+.if exists(/usr/include/c++/v1/__format/format_functions.h) && \
+   !exists(/usr/include/c++/v1/__format/write_escaped.h)
+CXXFLAGS+=	-fexperimental-library
+.endif
+
 .include <bsd.port.mk>