git: 8ad8a0c61416 - main - x11/hyprpaper: unbreak with libc++ 16 after 4285975bf9ca

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Sat, 17 Aug 2024 04:32:02 UTC
The branch main has been updated by jbeich:

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

commit 8ad8a0c61416b79e4cfeccb4253be7c73e018f0e
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2024-08-17 04:30:19 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2024-08-17 04:31:45 +0000

    x11/hyprpaper: unbreak with libc++ 16 after 4285975bf9ca
    
    In file included from src/Hyprpaper.cpp:1:
    In file included from src/Hyprpaper.hpp:3:
    In file included from src/config/ConfigManager.hpp:2:
    In file included from src/config/../defines.hpp:20:
    /usr/local/include/hyprutils/math/Vector2D.hpp:141:5: error: no member named 'format_error' in namespace 'std'
        AQ_FORMAT_PARSE(AQ_FORMAT_FLAG('j', formatJson) //
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/local/include/hyprutils/math/Vector2D.hpp:110:57: note: expanded from macro 'AQ_FORMAT_PARSE'
                switch (*it) { specs__ default : throw std::format_error("invalid format specification"); }                                                                            \
                                                       ~~~~~^
    /usr/local/include/hyprutils/math/Vector2D.hpp:148:68: error: no member named 'format' in namespace 'std'
            std::string formatString = precision.empty() ? "{}" : std::format("{{:.{}f}}", precision);
                                                                  ~~~~~^
    /usr/local/include/hyprutils/math/Vector2D.hpp:151:33: error: no member named 'format' in namespace 'std'
                formatString = std::format("[{0}, {0}]", formatString);
                               ~~~~~^
    /usr/local/include/hyprutils/math/Vector2D.hpp:153:33: error: no member named 'format' in namespace 'std'
                formatString = std::format("{0}x{0}", formatString);
                               ~~~~~^
    /usr/local/include/hyprutils/math/Vector2D.hpp:155:33: error: no member named 'format' in namespace 'std'
                formatString = std::format("[Vector2D: x: {0}, y: {0}]", formatString);
                               ~~~~~^
    /usr/local/include/hyprutils/math/Vector2D.hpp:157:31: error: no member named 'vformat' in namespace 'std'
                string buf = std::vformat(formatString, std::make_format_args(vec.x, vec.y));
                             ~~~~~^
    /usr/local/include/hyprutils/math/Vector2D.hpp:157:58: error: no member named 'make_format_args' in namespace 'std'
                string buf = std::vformat(formatString, std::make_format_args(vec.x, vec.y));
                                                        ~~~~~^
    /usr/local/include/hyprutils/math/Vector2D.hpp:158:25: error: no member named 'format_to' in namespace 'std'
                return std::format_to(ctx.out(), "{}", buf);
                       ~~~~~^
    /usr/local/include/hyprutils/math/Vector2D.hpp:159:23: error: no type named 'format_error' in namespace 'std'; did you mean 'domain_error'?
            } catch (std::format_error& e) { return std::format_to(ctx.out(), "[{}, {}]", vec.x, vec.y); }
                     ~~~~~^
    /usr/include/c++/v1/stdexcept:123:29: note: 'domain_error' declared here
    class _LIBCPP_EXCEPTION_ABI domain_error
                                ^
    In file included from src/Hyprpaper.cpp:1:
    In file included from src/Hyprpaper.hpp:3:
    In file included from src/config/ConfigManager.hpp:2:
    In file included from src/config/../defines.hpp:20:
    /usr/local/include/hyprutils/math/Vector2D.hpp:159:54: error: no member named 'format_to' in namespace 'std'
            } catch (std::format_error& e) { return std::format_to(ctx.out(), "[{}, {}]", vec.x, vec.y); }
                                                    ~~~~~^
    
    Reported by:    pkg-fallout
---
 x11/hyprpaper/Makefile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/x11/hyprpaper/Makefile b/x11/hyprpaper/Makefile
index 8dab8c74a064..ebdbdf88f226 100644
--- a/x11/hyprpaper/Makefile
+++ b/x11/hyprpaper/Makefile
@@ -23,6 +23,11 @@ USE_GITHUB=	yes
 GH_ACCOUNT=	hyprwm
 PLIST_FILES=	bin/${PORTNAME}
 
+# XXX Drop after FreeBSD 14.0 EOL around 2024-10-01
+.if exists(/usr/lib/libc++.so) && !exists(/usr/include/c++/v1/__format/write_escaped.h)
+CXXFLAGS+=	-fexperimental-library
+.endif
+
 post-patch:
 # Extract (snapshot) version from the port instead of Git
 	@${REINPLACE_CMD} -i .nogit -e '/Get git info/,/^include/{//p;d;}' \