git: 0a3ff9e0417c - main - devel/libinotify: Convert PRINTF/REINPLACE_CMD to patch files

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Tue, 12 Aug 2025 18:17:15 UTC
The branch main has been updated by sunpoet:

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

commit 0a3ff9e0417ce394152f56197c99a559e60f6aec
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2025-08-12 17:57:08 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2025-08-12 18:15:32 +0000

    devel/libinotify: Convert PRINTF/REINPLACE_CMD to patch files
---
 devel/libinotify/Makefile                           | 7 +++----
 devel/libinotify/files/extra-patch-libinotify.pc.in | 8 ++++++++
 devel/libinotify/files/inotify.h                    | 2 ++
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/devel/libinotify/Makefile b/devel/libinotify/Makefile
index 2e844386e02b..d748982036f5 100644
--- a/devel/libinotify/Makefile
+++ b/devel/libinotify/Makefile
@@ -19,11 +19,10 @@ INSTALL_TARGET=	install-strip
 USE_LDCONFIG=	yes
 
 .if exists(/usr/include/sys/inotify.h)
+EXTRA_PATCHES=	${PATCHDIR}/extra-patch-libinotify.pc.in
+
 post-install:
-	${PRINTF} '#pragma GCC system_header\n#include_next <sys/inotify.h>\n' \
-		> ${STAGEDIR}${PREFIX}/include/sys/inotify.h
-	${SED} -e '/Libs:/d' -e '/Cflags:/d' ${WRKSRC}/libinotify.pc \
-		> ${STAGEDIR}${PREFIX}/libdata/pkgconfig/libinotify.pc
+	${INSTALL_DATA} ${FILESDIR}/inotify.h ${STAGEDIR}${PREFIX}/include/sys/inotify.h
 .endif
 
 .include <bsd.port.mk>
diff --git a/devel/libinotify/files/extra-patch-libinotify.pc.in b/devel/libinotify/files/extra-patch-libinotify.pc.in
new file mode 100644
index 000000000000..eb58e5e51190
--- /dev/null
+++ b/devel/libinotify/files/extra-patch-libinotify.pc.in
@@ -0,0 +1,8 @@
+--- libinotify.pc.in.orig	2019-03-06 22:25:31 UTC
++++ libinotify.pc.in
+@@ -6,5 +6,3 @@ Version: @PACKAGE_VERSION@
+ Name: @PACKAGE_NAME@
+ Description: Kqueue based inotify shim library
+ Version: @PACKAGE_VERSION@
+-Libs: -L${libdir} -linotify
+-Cflags: -I${includedir}
diff --git a/devel/libinotify/files/inotify.h b/devel/libinotify/files/inotify.h
new file mode 100644
index 000000000000..83b08bd27147
--- /dev/null
+++ b/devel/libinotify/files/inotify.h
@@ -0,0 +1,2 @@
+#pragma GCC system_header
+#include_next <sys/inotify.h>