DPDK patches and discussions
 help / color / mirror / Atom feed
From: luca.boccassi@gmail.com
To: dev@dpdk.org
Cc: bruce.richardson@intel.com
Subject: [PATCH] meson: use built-in 'modules' helper for python dependencies
Date: Sun, 23 Jun 2024 13:30:23 +0100	[thread overview]
Message-ID: <20240623123032.35928-1-luca.boccassi@gmail.com> (raw)

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


             reply	other threads:[~2024-06-23 12:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-23 12:30 luca.boccassi [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240623123032.35928-1-luca.boccassi@gmail.com \
    --to=luca.boccassi@gmail.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).