[Spice-commits] meson.build
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jan 27 08:51:21 UTC 2022
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit a7b5474bf808934cf0ee1107a58d5f4d97b9afbf
Author: Frediano Ziglio <freddy77 at gmail.com>
Date: Thu Oct 28 16:45:34 2021 +0100
build: Correctly check for Python modules
Currently using Meson the command "python -m <MODULE_NAME>" is
run. However this command instead of trying to import the module
tried to execute it as a script failing for the updated pyparsing
with:
/usr/bin/python3: No module named pyparsing.__main__; 'pyparsing' is a package and cannot be directly executed
So instead use "python -c 'import <MODULE_NAME>".
Autoconf is already using that command (see m4/ax_python_module.m4).
Signed-off-by: Frediano Ziglio <freddy77 at gmail.com>
diff --git a/meson.build b/meson.build
index aff6243..eeccecd 100644
--- a/meson.build
+++ b/meson.build
@@ -132,7 +132,7 @@ if spice_common_generate_client_code or spice_common_generate_server_code
if get_option('python-checks')
foreach module : ['six', 'pyparsing']
message('Checking for python module @0@'.format(module))
- cmd = run_command(python, '-m', module)
+ cmd = run_command(python, '-c', 'import @0@'.format(module))
if cmd.returncode() != 0
error('Python module @0@ not found'.format(module))
endif
More information about the Spice-commits
mailing list