ac11f2876d
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
33 lines
773 B
C++
33 lines
773 B
C++
--- src/Hyprsunset.cpp.orig 2025-10-03 22:29:52 UTC
|
|
+++ src/Hyprsunset.cpp
|
|
@@ -1,13 +1,29 @@
|
|
#include "ConfigManager.hpp"
|
|
#include "helpers/Log.hpp"
|
|
#include "IPCSocket.hpp"
|
|
+#include <algorithm>
|
|
#include <cstring>
|
|
#include <mutex>
|
|
#include <thread>
|
|
#include <chrono>
|
|
+#include <signal.h>
|
|
#include <sys/poll.h>
|
|
#include <sys/timerfd.h>
|
|
+#include <unistd.h>
|
|
#include <wayland-client-core.h>
|
|
+
|
|
+#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 {
|
|
+ namespace chrono {
|
|
+ using date::current_zone;
|
|
+ using date::zoned_time;
|
|
+ }
|
|
+}
|
|
+#endif
|
|
|
|
#define TIMESPEC_NSEC_PER_SEC 1000000000L
|
|
|