git: d9a1aaa98d16 - main - accessibility/hyprsunset: update to 0.3.1

From: Hiroki Tagato <tagattie_at_FreeBSD.org>
Date: Sat, 02 Aug 2025 04:20:42 UTC
The branch main has been updated by tagattie:

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

commit d9a1aaa98d16108d5910f84f0a2f933d792ab64e
Author:     Hiroki Tagato <tagattie@FreeBSD.org>
AuthorDate: 2025-08-02 04:16:38 +0000
Commit:     Hiroki Tagato <tagattie@FreeBSD.org>
CommitDate: 2025-08-02 04:20:30 +0000

    accessibility/hyprsunset: update to 0.3.1
    
    While here:
    - mark as BROKEN on FreeBSD 13
      It does not build with an error related to devel/date.
    - use hyprland-protocols from ports
    - add patch to unbreak build on system with libc++ 19
    
    Changelog:
    - https://github.com/hyprwm/hyprsunset/releases/tag/v0.3.0
    - https://github.com/hyprwm/hyprsunset/releases/tag/v0.3.1
    
    Reported by:    portscout
---
 accessibility/hyprsunset/Makefile                  | 18 ++++++++++++----
 accessibility/hyprsunset/distinfo                  |  8 +++----
 .../hyprsunset/files/patch-CMakeLists.txt          | 23 --------------------
 .../hyprsunset/files/patch-src_Hyprsunset.cpp      | 25 ++++++++++++++++++++++
 accessibility/hyprsunset/pkg-descr                 | 11 +++++++---
 5 files changed, 50 insertions(+), 35 deletions(-)

diff --git a/accessibility/hyprsunset/Makefile b/accessibility/hyprsunset/Makefile
index 5fbaf23a3541..f77b8b76904d 100644
--- a/accessibility/hyprsunset/Makefile
+++ b/accessibility/hyprsunset/Makefile
@@ -1,7 +1,6 @@
 PORTNAME=	hyprsunset
 DISTVERSIONPREFIX=	v
-DISTVERSION=	0.2.0
-PORTREVISION=	4
+DISTVERSION=	0.3.1
 CATEGORIES=	accessibility wayland
 
 MAINTAINER=	tagattie@FreeBSD.org
@@ -11,16 +10,27 @@ WWW=		https://github.com/hyprwm/hyprsunset
 LICENSE=	BSD3CLAUSE
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
+BROKEN_FreeBSD_13=	fails to build: /usr/local/include/date/date.h:6636:15: error: no member named 'read' in namespace 'date::detail'; did you mean '::read'?
+
 BUILD_DEPENDS=	hyprwayland-scanner>=0.4.0:devel/hyprwayland-scanner \
+		hyprland-protocols>=0.4.0:graphics/hyprland-protocols \
 		wayland-protocols>0:graphics/wayland-protocols
-LIB_DEPENDS=	libhyprutils.so:devel/hyprutils \
+LIB_DEPENDS=	libhyprlang.so:devel/hyprlang \
+		libhyprutils.so:devel/hyprutils \
 		libwayland-client.so:graphics/wayland
 
 USES=		cmake compiler:c++11-lib localbase:ldflags pkgconfig
+
 USE_GITHUB=	yes
 GH_ACCOUNT=	hyprwm
-GH_TUPLE=	hyprwm:hyprland-protocols:v0.6.2:hyprland_protocols/subprojects/hyprland-protocols
+
 PLIST_FILES=	bin/${PORTNAME} \
 		lib/systemd/user/${PORTNAME}.service
 
+# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282377
+.if exists(/usr/lib/libc++.so)
+LIB_DEPENDS+=	libdate-tz.so:devel/date
+USES+=		localbase:ldflags
+.endif
+
 .include <bsd.port.mk>
diff --git a/accessibility/hyprsunset/distinfo b/accessibility/hyprsunset/distinfo
index f6174220fa02..e727ebbdd309 100644
--- a/accessibility/hyprsunset/distinfo
+++ b/accessibility/hyprsunset/distinfo
@@ -1,5 +1,3 @@
-TIMESTAMP = 1742816163
-SHA256 (hyprwm-hyprsunset-v0.2.0_GH0.tar.gz) = 178d2b6c0042e005770eb31492fb7583c9fd25e37351a29f44bff56e87a52ad3
-SIZE (hyprwm-hyprsunset-v0.2.0_GH0.tar.gz) = 11336
-SHA256 (hyprwm-hyprland-protocols-v0.6.2_GH0.tar.gz) = bba082af141599d4342e7b8505401a6e3a32be819d9eb23ce6c90f7407e62c1f
-SIZE (hyprwm-hyprland-protocols-v0.6.2_GH0.tar.gz) = 9887
+TIMESTAMP = 1754099943
+SHA256 (hyprwm-hyprsunset-v0.3.1_GH0.tar.gz) = 5c91addca1be04ab02faeebfee4f46608b484d2e90c9249dc7e145ac690d433a
+SIZE (hyprwm-hyprsunset-v0.3.1_GH0.tar.gz) = 15281
diff --git a/accessibility/hyprsunset/files/patch-CMakeLists.txt b/accessibility/hyprsunset/files/patch-CMakeLists.txt
deleted file mode 100644
index 847fb208217f..000000000000
--- a/accessibility/hyprsunset/files/patch-CMakeLists.txt
+++ /dev/null
@@ -1,23 +0,0 @@
--- Checking for module 'hyprland-protocols>=0.4.0'
---   Package 'hyprland-protocols' not found
-CMake Error at /usr/local/share/cmake/Modules/FindPkgConfig.cmake:645 (message):
-  The following required packages were not found:
-
-   - hyprland-protocols>=0.4.0
-
---- CMakeLists.txt.orig	2024-10-08 19:23:45 UTC
-+++ CMakeLists.txt
-@@ -98,8 +98,12 @@ protocolwayland()
- 
- protocolwayland()
- 
--pkg_check_modules(hyprland_protocols_dep REQUIRED IMPORTED_TARGET hyprland-protocols>=0.4.0)
-+pkg_check_modules(hyprland_protocols_dep IMPORTED_TARGET hyprland-protocols>=0.4.0)
-+if(hyprland_protocols_dep_FOUND)
- pkg_get_variable(HYPRLAND_PROTOCOLS hyprland-protocols pkgdatadir)
-+else()
-+set(HYPRLAND_PROTOCOLS "${CMAKE_SOURCE_DIR}/subprojects/hyprland-protocols")
-+endif()
- message(STATUS "hyprland-protocols dependency set to ${HYPRLAND_PROTOCOLS}")
- 
- protocolnew("${HYPRLAND_PROTOCOLS}/protocols" "hyprland-ctm-control-v1" true)
diff --git a/accessibility/hyprsunset/files/patch-src_Hyprsunset.cpp b/accessibility/hyprsunset/files/patch-src_Hyprsunset.cpp
new file mode 100644
index 000000000000..c8e22b0d7bfa
--- /dev/null
+++ b/accessibility/hyprsunset/files/patch-src_Hyprsunset.cpp
@@ -0,0 +1,25 @@
+--- src/Hyprsunset.cpp.orig	2025-07-24 17:32:18 UTC
++++ src/Hyprsunset.cpp
+@@ -5,9 +5,22 @@
+ #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_VERSION) || defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE)
++#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
+ 
diff --git a/accessibility/hyprsunset/pkg-descr b/accessibility/hyprsunset/pkg-descr
index 529a3f5db819..9d58a97507b5 100644
--- a/accessibility/hyprsunset/pkg-descr
+++ b/accessibility/hyprsunset/pkg-descr
@@ -1,5 +1,10 @@
 hyprsunset is a small utility to provide a blue light filter for your
-system. This method is preferred to screen shaders as it will not be
-captured via recording / screenshots.
+system.
 
-Requires hyprland >= 0.45.0 for hyprland-ctm-control-v1 protocol.
+This method is preferred to screen shaders as it will not be captured
+via recording / screenshots.
+
+hyprsunset also provides a gamma filter, which can be used to adjust
+perceived display brightness on monitors that do not support software
+control, or to reduce perceived brightness below the monitor's
+minimum.