summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2025-05-10 09:33:44 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2025-05-10 09:33:44 +0000
commit1a8a9a832eb52cb3bb7ea6453a88451d54ebc597 (patch)
tree6004215c4217660dedace192e06bd5f1f8aec036
parentaccessibility/at-spi2-core: Update to 2.56.1 (diff)
devel/libvirt: depend on GNU grep(1) in a more robust way
FreeBSD ships native grep(1) implementation in the base for quite a while, so don't bother to check its origin and just request GNU version explicitly like on Darwin (macOS). Depending on `/usr/local/bin/grep' is also wrong because of the hardcoded prefix and because compatibility symlinks are optional (plans are to disable them in the future).
-rw-r--r--devel/libvirt/Makefile2
-rw-r--r--devel/libvirt/files/patch-build-aux_meson.build27
2 files changed, 28 insertions, 1 deletions
diff --git a/devel/libvirt/Makefile b/devel/libvirt/Makefile
index 97f20f5b39ac..12c6bae430f8 100644
--- a/devel/libvirt/Makefile
+++ b/devel/libvirt/Makefile
@@ -13,7 +13,7 @@ LICENSE= LGPL3
LIB_DEPENDS= libcurl.so:ftp/curl \
libgnutls.so:security/gnutls
BUILD_DEPENDS= dnsmasq:dns/dnsmasq \
- ${LOCALBASE}/bin/grep:textproc/gnugrep \
+ ggrep:textproc/gnugrep \
gsed:textproc/gsed \
rst2html:textproc/py-docutils@${PY_FLAVOR} \
xsltproc:textproc/libxslt
diff --git a/devel/libvirt/files/patch-build-aux_meson.build b/devel/libvirt/files/patch-build-aux_meson.build
new file mode 100644
index 000000000000..63e689340bbc
--- /dev/null
+++ b/devel/libvirt/files/patch-build-aux_meson.build
@@ -0,0 +1,27 @@
+--- build-aux/meson.build.orig 2025-05-02 07:25:45 UTC
++++ build-aux/meson.build
+@@ -13,23 +13,10 @@ if git and tests_enabled[0]
+ if host_machine.system() == 'freebsd' or host_machine.system() == 'darwin'
+ make_prog = find_program('gmake')
+ sed_prog = find_program('gsed')
++ grep_prog = find_program('ggrep')
+ else
+ make_prog = find_program('make')
+ sed_prog = find_program('sed')
+- endif
+-
+- if host_machine.system() == 'freebsd'
+- grep_prog = find_program('grep')
+- grep_cmd = run_command(grep_prog, '--version', check: true)
+- if grep_cmd.stdout().startswith('grep (BSD grep')
+- grep_prog = find_program('/usr/local/bin/grep', required: false)
+- if not grep_prog.found()
+- error('GNU grep not found')
+- endif
+- endif
+- elif host_machine.system() == 'darwin'
+- grep_prog = find_program('ggrep')
+- else
+ grep_prog = find_program('grep')
+ endif
+