From: Jordan Williams Date: Thu, 9 May 2024 21:46:58 +0000 (-0500) Subject: meson: Only require Python module when building pylibmount X-Git-Tag: v2.42-start~353^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cb7ac65dcaf655ea5dedf8820ab6417629241aa4;p=thirdparty%2Futil-linux.git meson: Only require Python module when building pylibmount Only the python executable is required for tests. Version 1.4.1 of Meson will require the Python.h for find_installation. This will result in the tests requiring Python.h unnecessarily. Use find_program to find the Python program for the tests instead. Signed-off-by: Jordan Williams --- diff --git a/libmount/python/meson.build b/libmount/python/meson.build index 5dcdf807d..2c95365ba 100644 --- a/libmount/python/meson.build +++ b/libmount/python/meson.build @@ -13,6 +13,11 @@ if LINUX pylibmount_sources += 'context.c' endif +python_module = import('python') +python = python_module.find_installation( + get_option('python'), + required : true, + disabler : true) python.extension_module( 'pylibmount', pylibmount_sources, diff --git a/meson.build b/meson.build index a78ebd6b8..8b3149102 100644 --- a/meson.build +++ b/meson.build @@ -913,11 +913,7 @@ bison_gen = generator( output : ['@BASENAME@.tab.c', '@BASENAME@.tab.h'], arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@']) -python_module = import('python') -python = python_module.find_installation( - get_option('python'), - required : true, - disabler : true) +python_program = find_program('python3', 'python', native : true) meson_make_symlink = meson.current_source_dir() + '/tools/meson-make-symlink.sh' meson_make_manpage_stub = meson.current_source_dir() + '/tools/meson-make-manpage-stub.sh' @@ -3784,7 +3780,7 @@ configure_file(output : 'meson.conf', '''asan=@0@ PYTHON=@1@ '''.format(get_option('b_sanitize')=='address' ? 'yes' : '', - python.full_path())]) + python_program.full_path())]) run_sh = find_program('tests/run.sh') run_target(