git: 45bbcf40c872 - 2026Q1 - accessibility/hyprsunset: fix build with libc++ 21

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Fri, 20 Mar 2026 12:13:07 UTC
The branch 2026Q1 has been updated by dim:

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

commit 45bbcf40c872c9aa7f725dac96925f13a7b2184b
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2026-03-14 19:08:36 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2026-03-20 12:13:00 +0000

    accessibility/hyprsunset: fix build with libc++ 21
    
    With libc++ 21 science/py-tensorflow fails to build, with errors similar
    to:
    
        /wrkdirs/usr/ports/accessibility/hyprsunset/work/hyprsunset-0.3.3/src/Hyprsunset.cpp:300:10: error: no member named 'sort' in namespace 'std'
          300 |     std::sort(profiles.begin(), profiles.end(), [](const auto& a, const auto& b) {
              |          ^~~~
    
    and:
    
        /wrkdirs/usr/ports/accessibility/hyprsunset/work/hyprsunset-0.3.3/src/Hyprsunset.cpp:329:29: error: no member named 'zoned_time' in namespace 'std::chrono'
          329 |     auto now = std::chrono::zoned_time(std::chrono::current_zone(), std::chrono::system_clock::now()).get_local_time();
              |                             ^~~~~~~~~~
    
    The former is because the header <algorithm> isn't included.
    
    The latter is because libc++ in FreeBSD doesn't have
    std::chrono::zoned_time support yet, but the program checks for the
    libc++ specific macro _LIBCPP_HAS_NO_TIME_ZONE_DATABASE. In libc++ 21,
    most of the "_LIBCPP_HAS_NO_xxx" macros have been replaced by 'positive'
    variants. In this case _LIBCPP_HAS_TIME_ZONE_DATABASE is now applicable.
    
    PR:             293811
    Approved by:    tagattie (maintainer)
    MFH:            2026Q1
    
    (cherry picked from commit ac11f2876dec2da906e05524f679f8a15acffa8e)
---
 accessibility/hyprsunset/files/patch-src_Hyprsunset.cpp | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/accessibility/hyprsunset/files/patch-src_Hyprsunset.cpp b/accessibility/hyprsunset/files/patch-src_Hyprsunset.cpp
index f2e7a4496bca..c726460f2f0c 100644
--- a/accessibility/hyprsunset/files/patch-src_Hyprsunset.cpp
+++ b/accessibility/hyprsunset/files/patch-src_Hyprsunset.cpp
@@ -1,6 +1,11 @@
---- src/Hyprsunset.cpp.orig	2025-07-24 17:32:18 UTC
+--- src/Hyprsunset.cpp.orig	2025-10-03 22:29:52 UTC
 +++ src/Hyprsunset.cpp
-@@ -5,9 +5,22 @@
+@@ -1,13 +1,29 @@
+ #include "ConfigManager.hpp"
+ #include "helpers/Log.hpp"
+ #include "IPCSocket.hpp"
++#include <algorithm>
+ #include <cstring>
  #include <mutex>
  #include <thread>
  #include <chrono>
@@ -10,7 +15,9 @@
 +#include <unistd.h>
  #include <wayland-client-core.h>
 +
-+#if defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE)
++#if defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) || \
++  (defined(_LIBCPP_HAS_TIME_ZONE_DATABASE) && \
++  _LIBCPP_HAS_TIME_ZONE_DATABASE == 0)
 +#pragma comment(lib, "date-tz")
 +#include <date/tz.h>
 +namespace std {