]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: Python venv
authorFred Morcos <fred.morcos@open-xchange.com>
Thu, 6 Jul 2023 09:52:43 +0000 (11:52 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:27 +0000 (13:28 +0100)
meson.build
meson/python-venv/meson.build [new file with mode: 0644]

index 25e8f3ffe4a9b60b80489dadb5f85b4c65636c9d..034a374ff2981d9c54bc67db1a9e13e9e21e758a 100644 (file)
@@ -47,6 +47,7 @@ subdir('meson/boost')           # Boost
 subdir('meson/unit-tests')      # Unit Tests
 subdir('meson/reproducible')    # Reproducible Builds
 subdir('meson/fuzz-targets')    # Fuzzing Targets
+subdir('meson/python-venv')     # Python Venv
 
 # Boost Program Options library
 dep_boost_program_options = dependency('boost', modules: ['program_options'], required: true)
diff --git a/meson/python-venv/meson.build b/meson/python-venv/meson.build
new file mode 100644 (file)
index 0000000..5f702d5
--- /dev/null
@@ -0,0 +1,29 @@
+# Python Venv
+# Outputs: python_have_venv
+
+python_have_venv = false
+
+dep_python = dependency('python3', version: '>= 3.6', required: false)
+if not dep_python.found()
+  warning('Python3 dependency not found')
+  subdir_done()
+endif
+
+summary('Python', dep_python.found(), bool_yn: true, section: 'Configuration')
+summary('Python Version', dep_python.version(), section: 'Configuration')
+
+python_prog = 'python' + dep_python.version()
+python_prog = find_program(python_prog, required: false)
+if not python_prog.found()
+  warning('Python3 program not found')
+  subdir_done()
+endif
+
+python_prog_res = run_command(python_prog, '-c', '"import venv"', check: false)
+if python_prog_res.returncode() != 0
+  warning('Python3 venv module not found')
+  subdir_done()
+endif
+
+python_have_venv = true
+summary('Python venv', python_have_venv, bool_yn: true, section: 'Configuration')