git: 45a162f3dfab - main - emulators/qemu: Fix build on 15

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Wed, 03 Dec 2025 21:46:28 UTC
The branch main has been updated by bofh:

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

commit 45a162f3dfab9e6e34ee7f1881965dab6957eb22
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2025-12-03 21:45:36 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2025-12-03 21:46:15 +0000

    emulators/qemu: Fix build on 15
---
 emulators/qemu/Makefile                      |  3 +++
 emulators/qemu/files/extra-patch-meson.build | 28 ++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/emulators/qemu/Makefile b/emulators/qemu/Makefile
index db43eab2d357..d0f32d5f327d 100644
--- a/emulators/qemu/Makefile
+++ b/emulators/qemu/Makefile
@@ -124,6 +124,9 @@ CFLAGS:=	${CFLAGS:C/-fno-tree-vrp//}
 WITHOUT_CPU_CFLAGS=	yes #to avoid problems with register allocation
 
 BINARY_ALIAS=	python3=${PYTHON_VERSION}
+.if exists(/usr/include/sys/inotify.h)
+EXTRA_PATCHES+=                ${PATCHDIR}/extra-patch-meson.build
+.endif
 
 PORTDOCS=	.buildinfo _static/* about/* dbus-dbusindex.html devel/* docs \
 		genindex.html glossary.html index.html interop/* objects.inv \
diff --git a/emulators/qemu/files/extra-patch-meson.build b/emulators/qemu/files/extra-patch-meson.build
new file mode 100644
index 000000000000..e80d63168f1c
--- /dev/null
+++ b/emulators/qemu/files/extra-patch-meson.build
@@ -0,0 +1,28 @@
+--- meson.build.orig	2025-12-03 21:35:34 UTC
++++ meson.build
+@@ -2738,17 +2738,6 @@ have_inotify_init1 = cc.has_header_symbol('sys/inotify
+ 
+ have_inotify_init = cc.has_header_symbol('sys/inotify.h', 'inotify_init')
+ have_inotify_init1 = cc.has_header_symbol('sys/inotify.h', 'inotify_init1')
+-inotify = not_found
+-if (have_inotify_init or have_inotify_init1) and host_os == 'freebsd'
+-  # libinotify-kqueue
+-  inotify = cc.find_library('inotify')
+-  if have_inotify_init
+-    have_inotify_init = inotify.found()
+-  endif
+-  if have_inotify_init1
+-    have_inotify_init1 = inotify.found()
+-  endif
+-endif
+ config_host_data.set('CONFIG_INOTIFY', have_inotify_init)
+ config_host_data.set('CONFIG_INOTIFY1', have_inotify_init1)
+ 
+@@ -5011,7 +5000,6 @@ if host_os == 'freebsd'
+ summary_info += {'selinux':           selinux}
+ summary_info += {'libdw':             libdw}
+ if host_os == 'freebsd'
+-  summary_info += {'libinotify-kqueue': inotify}
+ endif
+ if host_os == 'darwin'
+   summary_info += {'ParavirtualizedGraphics support': pvg}