git: 9ce587e8f38e - 2023Q1 - x11-wm/kwinft: unbreak X-KDE-Wayland-Interfaces detection

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Fri, 10 Feb 2023 01:24:15 UTC
The branch 2023Q1 has been updated by jbeich:

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

commit 9ce587e8f38ec3a4f5119c652143260bb02ce3a7
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2023-02-10 01:00:49 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2023-02-10 01:23:46 +0000

    x11-wm/kwinft: unbreak X-KDE-Wayland-Interfaces detection
    
    $ pkg install kwinft vulkan-tools
    $ export QT_LOGGING_RULES="kwin_*.debug=true"
    $ kwin_wayland --exit-with-session vkcube-wayland
    [...]
    kwin_wl: Could not identify process with pid 12345
    
    (cherry picked from commit 3ae6553cbd34c94c116757c0166876f63cfcde75)
---
 x11-wm/kwinft/Makefile | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/x11-wm/kwinft/Makefile b/x11-wm/kwinft/Makefile
index 646ee3d42a40..2e91d23cf1fb 100644
--- a/x11-wm/kwinft/Makefile
+++ b/x11-wm/kwinft/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	kwinft
 DISTVERSIONPREFIX=	${PORTNAME}@
 DISTVERSION=	5.24.1
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	x11-wm wayland
 
 MAINTAINER=	jbeich@FreeBSD.org
@@ -59,5 +59,16 @@ QA11Y_DESC=		Accessibility (focus tracking) for Zoom effect
 QA11Y_LIB_DEPENDS=	libqaccessibilityclient-qt5.so:accessibility/libqaccessibilityclient
 QA11Y_CMAKE_BOOL_OFF=	CMAKE_DISABLE_FIND_PACKAGE_QAccessibilityClient
 
+post-patch:
+# Convert nodes from linprocfs(5) to procfs(5)
+# XXX kwinft lacks https://invent.kde.org/plasma/kwin/-/commit/1bc7afe8aaa9
+	@${REINPLACE_CMD} -e '/proc/,+1s,/exe,/file,' \
+		${WRKSRC}/main_wayland.cpp \
+		${WRKSRC}/service_utils.h \
+		${WRKSRC}/wayland_server.cpp
+# Generic nodes are not supported by procfs(5)
+	@${REINPLACE_CMD} -e '/mounts/s,/proc,/compat/linux&,' \
+		${WRKSRC}/perf/ftrace_impl.cpp
+
 .include "${.CURDIR:H:H}/x11-toolkits/wlroots015/override.mk"
 .include <bsd.port.mk>