]> 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>
Mon, 13 May 2024 12:25:53 +0000 (07:25 -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>
(cherry picked from commit cb7ac65dcaf655ea5dedf8820ab6417629241aa4)

libmount/python/meson.build
meson.build

index b353285e57d92fe4b99f8c29187b1691fe3dcf1d..422ecab8af18aaa5ee6317daa09464e149acab32 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 ae9517c128c8554b94ed1463f9943396a715b2aa..a5df66d202495ee51261cd3b692ee64738b9ae5a 100644 (file)
@@ -906,11 +906,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'
@@ -3715,7 +3711,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(