DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] meson: use built-in 'modules' helper for python dependencies
@ 2024-06-23 12:30 luca.boccassi
  2024-06-23 14:00 ` Dmitry Kozlyuk
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: luca.boccassi @ 2024-06-23 12:30 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson

From: Luca Boccassi <bluca@debian.org>

We now require Meson 0.53 or later, so we can use this feature introduced
in 0.51. This also fixes a build failure on SUSE Leap 15.6.

Cc: stable@dpdk.org

Signed-off-by: Luca Boccassi <bluca@debian.org>
---
 buildtools/meson.build | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/buildtools/meson.build b/buildtools/meson.build
index 72447b60a0..3adf34e1a8 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -5,7 +5,11 @@ pkgconf = find_program('pkg-config', 'pkgconf', required: false)
 check_symbols = find_program('check-symbols.sh')
 ldflags_ibverbs_static = find_program('options-ibverbs-static.sh')
 
-python3 = import('python').find_installation(required: false)
+python3_required_modules = []
+if host_machine.system() != 'windows'
+    python3_required_modules = ['elftools']
+endif
+python3 = import('python').find_installation('python3', required: false, modules: python3_required_modules)
 if python3.found()
     py3 = [python3]
 else
@@ -45,16 +49,3 @@ else
     pmdinfogen += 'elf'
 endif
 
-# TODO: starting from Meson 0.51.0 use
-#     python3 = import('python').find_installation('python',
-#        modules : python3_required_modules)
-python3_required_modules = []
-if host_machine.system() != 'windows'
-    python3_required_modules = ['elftools']
-endif
-foreach module : python3_required_modules
-    script = 'import importlib.util; import sys; exit(importlib.util.find_spec("@0@") is None)'
-    if run_command(py3, '-c', script.format(module), check: false).returncode() != 0
-        error('missing python module: @0@'.format(module))
-    endif
-endforeach
-- 
2.43.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-06-25 12:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-23 12:30 [PATCH] meson: use built-in 'modules' helper for python dependencies luca.boccassi
2024-06-23 14:00 ` Dmitry Kozlyuk
2024-06-24  8:14 ` Bruce Richardson
2024-06-25 12:33   ` David Marchand
2024-06-24  9:15 ` David Marchand
2024-06-24  9:20   ` Kevin Traynor
2024-06-24 22:04   ` Luca Boccassi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).