summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2023-01-23 14:54:28 +0100
committerJan Janssen <medhefgo@web.de>2023-01-23 14:54:28 +0100
commita6cabc90c86e67434cc461afe48d0f097b7a6028 (patch)
treef6505acdaf3c2d17f917238bece0d8cac9f0ebbf /meson.build
parentcd4300f30f0e836ec2568a84eb7b1831c2163f21 (diff)
downloadsystemd-a6cabc90c86e67434cc461afe48d0f097b7a6028.tar.gz
meson: Use python module for detection
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build10
1 files changed, 3 insertions, 7 deletions
diff --git a/meson.build b/meson.build
index edf4dcc5d9..8ab8d51b4b 100644
--- a/meson.build
+++ b/meson.build
@@ -1971,14 +1971,10 @@ jinja2_cmdline = [meson_render_jinja2, config_h, version_h]
############################################################
-python = find_program('python3')
-if run_command(python, '-c', 'import jinja2', check : false).returncode() != 0
- error('python3 jinja2 missing')
-endif
+pymod = import('python')
+python = pymod.find_installation('python3', required : true, modules : ['jinja2'])
+python_39 = python.language_version().version_compare('>=3.9')
-python_39 = run_command(python, '-c',
- 'import sys; sys.exit(0 if sys.version_info >= (3,9) else 1)',
- check : false).returncode() == 0
if get_option('ukify') == 'auto'
want_ukify = python_39 and conf.get('HAVE_GNU_EFI') == 1
elif get_option('ukify') == 'true' and (not python_39 or conf.get('HAVE_GNU_EFI') != 1)