git: fb6ad39e0c79 - main - devel/qt6-base: Prepare for the native inotify impl

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Mon, 07 Jul 2025 11:26:49 UTC
The branch main has been updated by arrowd:

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

commit fb6ad39e0c79608486cf3a00cadd38bee3bdb56f
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2025-06-07 10:50:48 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2025-07-07 11:26:37 +0000

    devel/qt6-base: Prepare for the native inotify impl
    
    Differential Revision: https://reviews.freebsd.org/D50736
---
 devel/qt6-base/Makefile                 |  9 ++++++++-
 devel/qt6-base/files/extrapatch-inotify | 11 +++++++++++
 devel/qt6-base/pkg-plist                |  3 ++-
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/devel/qt6-base/Makefile b/devel/qt6-base/Makefile
index e3ec93bddc7c..9ccdc12070a0 100644
--- a/devel/qt6-base/Makefile
+++ b/devel/qt6-base/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	base
 DISTVERSION=	${QT6_VERSION}
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	devel
 PKGNAMEPREFIX=	qt6-
 
@@ -96,6 +96,13 @@ BUILD_DEPENDS+=	as:devel/binutils
 CMAKE_ARGS+=	-DCMAKE_ASM_FLAGS=-no-integrated-as
 .endif
 
+.if exists(/usr/include/sys/inotify.h)
+PLIST_SUB+=	INOTIFY="" KQUEUE="@comment "
+EXTRA_PATCHES+=	${FILESDIR}/extrapatch-inotify
+.else
+PLIST_SUB+=	INOTIFY="@comment " KQUEUE=""
+.endif
+
 post-patch:
 	@${REINPLACE_CMD} -e 's|%%OPENSSLLIB%%|${OPENSSLLIB}|g' \
 		${WRKSRC}/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp
diff --git a/devel/qt6-base/files/extrapatch-inotify b/devel/qt6-base/files/extrapatch-inotify
new file mode 100644
index 000000000000..15106c6c721b
--- /dev/null
+++ b/devel/qt6-base/files/extrapatch-inotify
@@ -0,0 +1,11 @@
+--- src/corelib/io/qfilesystemwatcher.cpp.orig	2025-02-13 17:45:28 UTC
++++ src/corelib/io/qfilesystemwatcher.cpp
+@@ -11,7 +11,7 @@
+ #include <qset.h>
+ #include <qtimer.h>
+ 
+-#if (defined(Q_OS_LINUX) || defined(Q_OS_QNX)) && QT_CONFIG(inotify)
++#if (defined(Q_OS_LINUX) || defined(Q_OS_QNX) || defined(Q_OS_FREEBSD)) && QT_CONFIG(inotify)
+ #define USE_INOTIFY
+ #endif
+ 
diff --git a/devel/qt6-base/pkg-plist b/devel/qt6-base/pkg-plist
index 5b6306fcaf42..21e21ab67960 100644
--- a/devel/qt6-base/pkg-plist
+++ b/devel/qt6-base/pkg-plist
@@ -62,7 +62,8 @@ bin/qmake6
 %%QT_INCDIR%%/QtCore/%%FULLVER%%/QtCore/private/qfilesystementry_p.h
 %%QT_INCDIR%%/QtCore/%%FULLVER%%/QtCore/private/qfilesystemiterator_p.h
 %%QT_INCDIR%%/QtCore/%%FULLVER%%/QtCore/private/qfilesystemmetadata_p.h
-%%QT_INCDIR%%/QtCore/%%FULLVER%%/QtCore/private/qfilesystemwatcher_kqueue_p.h
+%%INOTIFY%%%%QT_INCDIR%%/QtCore/%%FULLVER%%/QtCore/private/qfilesystemwatcher_inotify_p.h
+%%KQUEUE%%%%QT_INCDIR%%/QtCore/%%FULLVER%%/QtCore/private/qfilesystemwatcher_kqueue_p.h
 %%QT_INCDIR%%/QtCore/%%FULLVER%%/QtCore/private/qfilesystemwatcher_p.h
 %%QT_INCDIR%%/QtCore/%%FULLVER%%/QtCore/private/qfilesystemwatcher_polling_p.h
 %%QT_INCDIR%%/QtCore/%%FULLVER%%/QtCore/private/qflatmap_p.h