git: 217af776bfe1 - 2023Q4 - x11-wm/hyprland: unbreak version string after a7817297b14b

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Tue, 19 Dec 2023 00:49:01 UTC
The branch 2023Q4 has been updated by jbeich:

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

commit 217af776bfe18bf15ecdd692aeeb0d07d1077981
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2023-12-18 20:29:52 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2023-12-19 00:45:50 +0000

    x11-wm/hyprland: unbreak version string after a7817297b14b
    
    $ hyprctl version
    Hyprland, built from branch  at commit  dirty ().
    Tag:
    ...
    
    (cherry picked from commit f99fdc344f9b711bb1fd0d936ad856955e0388ec)
---
 x11-wm/hyprland/Makefile | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/x11-wm/hyprland/Makefile b/x11-wm/hyprland/Makefile
index 26410638c56d..3cb2ac664602 100644
--- a/x11-wm/hyprland/Makefile
+++ b/x11-wm/hyprland/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	hyprland
 DISTVERSIONPREFIX=	v
 DISTVERSION=	0.33.1
+PORTREVISION=	1
 CATEGORIES=	x11-wm wayland
 
 MAINTAINER=	jbeich@FreeBSD.org
@@ -46,12 +47,19 @@ X11_MESON_ENABLED=	xwayland
 
 post-patch:
 # Extract (snapshot) version from the port instead of meson.build
-	@${REINPLACE_CMD} -i .nogit -e "/GIT_BRANCH/s/run_command.*/'main'/" \
-		-e "/GIT_COMMIT_HASH/s/run_command.*/'${DISTVERSIONFULL}'/" \
-		-e "/GIT_COMMIT_MESSAGE/d" \
-		-e "/GIT_DIRTY/s/run_command.*/'portbld'/" \
+	@${REINPLACE_CMD} -i .nogit \
 		-e "/version.*jq/s/run_command.*/'${DISTVERSIONFULL}',/" \
 		${WRKSRC}/meson.build
+	@${REINPLACE_CMD} -i .nogit \
+		-e '/^HASH/s/=.*/=${DISTVERSIONFULL:C/.*-g//}/' \
+		-e '/^BRANCH/s/=.*/=main/' \
+		-e '/^MESSAGE/s/=.*/="?"/' \
+		-e "/^DATE/s/=.*/=\"$$(date -ur $$(${AWK} \
+			'/TIMESTAMP/ { print $$3 }' ${DISTINFO_FILE}))\"/" \
+		-e '/^DIRTY/s/=.*/=portbld/' \
+		-e '/^TAG/s/=.*/=${DISTVERSIONFULL}/' \
+		${WRKSRC}/scripts/generateVersion.sh
+
 # Respect PREFIX for wallpapers
 	@${REINPLACE_CMD} 's,/usr/share,${DATADIR:H},' \
 		${WRKSRC}/src/render/OpenGL.cpp