meson: set variables for each program in build-aux dir

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2022-08-02 13:36:15 +01:00
parent b379d28678
commit c7a75aa3c2
4 changed files with 22 additions and 9 deletions

14
build-aux/meson.build Normal file
View File

@ -0,0 +1,14 @@
scripts = [
'buildenv.py',
'dist.py',
'gen-authors.py',
'msitool.py',
'post_install.py',
'run-windres.py',
]
foreach name : scripts
sname = name.split('.')[0].underscorify()
set_variable('@0@_prog'.format(sname), find_program(name))
endforeach

View File

@ -50,7 +50,7 @@ if with_msi
output: ['buildenv.txt'],
command: [
python3,
join_paths(meson.source_root(), 'build-aux', 'buildenv.py')
buildenv_prog,
],
capture: true)
@ -93,7 +93,7 @@ if with_msi
build_by_default: false,
command: [
python3,
join_paths(meson.source_root(), 'build-aux', 'msitool.py'),
msitool_prog,
meson.build_root(),
prefix,
wixl_arch,

View File

@ -508,9 +508,10 @@ configure_file(
configuration: conf_data
)
subdir('build-aux')
if git
authors_helper = join_paths(meson.source_root(), 'build-aux', 'gen-authors.py')
authors = run_command(python3.path(), authors_helper, env: runutf8)
authors = run_command(python3.path(), gen_authors_prog, env: runutf8)
authors_file = 'AUTHORS.in'
authors_conf = configuration_data()
@ -534,9 +535,8 @@ if git
configuration: conf_data
)
dist_helper = join_paths(meson.source_root(), 'build-aux', 'dist.py')
meson.add_dist_script(python3.path(), dist_helper, meson.build_root(), 'AUTHORS')
meson.add_dist_script(python3.path(), dist_helper, meson.build_root(), 'virt-viewer.spec')
meson.add_dist_script(python3.path(), dist_prog, meson.build_root(), 'AUTHORS')
meson.add_dist_script(python3.path(), dist_prog, meson.build_root(), 'virt-viewer.spec')
endif
gnome = import('gnome')

View File

@ -174,7 +174,6 @@ executable(
if host_machine.system() == 'windows'
windres = find_program('windres')
runwindres = join_paths(meson.source_root(), 'build-aux', 'run-windres.py')
rcfile = configure_file(
input: 'virt-viewer.rc.in',
@ -188,7 +187,7 @@ if host_machine.system() == 'windows'
output: ['virt-viewer-rc.o'],
command : [
python3,
runwindres,
run_windres_prog,
windres,
join_paths(meson.build_root(), 'icons'),
meson.current_source_dir(),