]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: Only require Python module when building pylibmount
authorJordan Williams <jordan@jwillikers.com>
Thu, 9 May 2024 21:46:58 +0000 (16:46 -0500)
committerJordan Williams <jordan@jwillikers.com>
Thu, 9 May 2024 21:46:58 +0000 (16:46 -0500)
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 <jordan@jwillikers.com>
libmount/python/meson.build
meson.build

index 5dcdf807da89b168e2b7261111076951bc4e59cb..2c95365ba6d99766d53f0b7a044b75210dce4fff 100644 (file)
@@ -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,
index a78ebd6b89348f745d953b2e68dddb44304c496a..8b3149102c21c3f55f47a8bc7238818152281659 100644 (file)
@@ -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(