git: 8a4a4d26acaf - main - x11/hypridle: add new port

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Fri, 23 Feb 2024 04:13:10 UTC
The branch main has been updated by jbeich:

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

commit 8a4a4d26acaf199d48bd2164ddeda103028b4c1d
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2024-02-17 23:40:04 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2024-02-23 04:12:13 +0000

    x11/hypridle: add new port
    
    Hyprland's idle daemon. Requires logind or consolekit2 session.
    
    Features:
     - based on the ext-idle-notify-v1 wayland protocol
     - support for dbus' loginctl commands (lock / unlock / before-sleep)
     - support for dbus' inhibit (used by e.g. firefox / steam)
    
    https://github.com/hyprwm/hypridle
---
 x11/Makefile           |  1 +
 x11/hypridle/Makefile  | 37 +++++++++++++++++++++++++++++++++++++
 x11/hypridle/distinfo  |  7 +++++++
 x11/hypridle/pkg-descr |  6 ++++++
 4 files changed, 51 insertions(+)

diff --git a/x11/Makefile b/x11/Makefile
index c347b37c2617..2318ff802b6f 100644
--- a/x11/Makefile
+++ b/x11/Makefile
@@ -122,6 +122,7 @@
     SUBDIR += hs-xmobar
     SUBDIR += hsetroot
     SUBDIR += hybrid-bar
+    SUBDIR += hypridle
     SUBDIR += hyprpaper
     SUBDIR += hyprpicker
     SUBDIR += i3bar-river
diff --git a/x11/hypridle/Makefile b/x11/hypridle/Makefile
new file mode 100644
index 000000000000..5c72eef434f2
--- /dev/null
+++ b/x11/hypridle/Makefile
@@ -0,0 +1,37 @@
+PORTNAME=	hypridle
+DISTVERSIONPREFIX=	v
+DISTVERSION=	0.1.0
+CATEGORIES=	x11 wayland
+
+PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
+PATCHFILES+=	56f334cbe867.patch:-p1 # https://github.com/hyprwm/hypridle/issues/7
+PATCHFILES+=	ea8588fefbe5.patch:-p1 # https://github.com/hyprwm/hypridle/pull/19
+
+MAINTAINER=	jbeich@FreeBSD.org
+COMMENT=	Hyprland's idle daemon #'
+WWW=		https://github.com/hyprwm/hypridle
+
+LICENSE=	BSD3CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	wayland-protocols>0:graphics/wayland-protocols
+LIB_DEPENDS=	libhyprlang.so:devel/hyprlang \
+		libsdbus-c++.so:devel/sdbus-cpp \
+		libwayland-client.so:graphics/wayland
+
+USES=		compiler:c++11-lib cmake pkgconfig
+USE_GITHUB=	yes
+GH_ACCOUNT=	hyprwm
+LDFLAGS+=	-Wl,--as-needed # sdbus-cpp deps
+PLIST_FILES=	bin/${PORTNAME}
+
+post-patch:
+# Temporarily use ConsoleKit2 like sysutils/gnome-settings-daemon
+	@${REINPLACE_CMD} -e 's,/login1,/ConsoleKit/Manager,' \
+		-e 's,login1,ConsoleKit,' \
+		-e 's,logind,consolekit2,' \
+		-e 's,GetSession,&ByPID,' \
+		-e 's,"auto",uint32_t{getpid()},' \
+		${WRKSRC}/src/core/Hypridle.cpp
+
+.include <bsd.port.mk>
diff --git a/x11/hypridle/distinfo b/x11/hypridle/distinfo
new file mode 100644
index 000000000000..37bf650695e0
--- /dev/null
+++ b/x11/hypridle/distinfo
@@ -0,0 +1,7 @@
+TIMESTAMP = 1708213204
+SHA256 (hyprwm-hypridle-v0.1.0_GH0.tar.gz) = 142cceacd91bf7f0bf6ae0e4e298f7375a5c6d38216756062e415dbf93f3b317
+SIZE (hyprwm-hypridle-v0.1.0_GH0.tar.gz) = 11696
+SHA256 (56f334cbe867.patch) = 17179dc3f1896f46a991e3fd8a77df2b6ef6dbd2f23e06eedd2b7a73c163494a
+SIZE (56f334cbe867.patch) = 682
+SHA256 (ea8588fefbe5.patch) = e85782d0036814a303c9dfb8e0a84eef832479a2903c7e505750ae0cdb9c727f
+SIZE (ea8588fefbe5.patch) = 1167
diff --git a/x11/hypridle/pkg-descr b/x11/hypridle/pkg-descr
new file mode 100644
index 000000000000..f792a6b31c54
--- /dev/null
+++ b/x11/hypridle/pkg-descr
@@ -0,0 +1,6 @@
+Hyprland's idle daemon. Requires logind or consolekit2 session.
+
+Features:
+ - based on the ext-idle-notify-v1 wayland protocol
+ - support for dbus' loginctl commands (lock / unlock / before-sleep)
+ - support for dbus' inhibit (used by e.g. firefox / steam)