meson: find python3 via python3 module

And rename python3 variable in meson build files for clarity.

https://bugzilla.gnome.org/show_bug.cgi?id=783198
This commit is contained in:
Tim-Philipp Müller 2017-07-07 12:06:44 +01:00
parent d93ebba58b
commit f28435b0d4
2 changed files with 4 additions and 8 deletions

View file

@ -72,12 +72,12 @@ gen_grammar = configure_file(input : 'gen_grammar.py.in',
parser = custom_target('parselex',
input : 'parse.l',
output : ['lex.priv_gst_parse_yy.c', 'parse_lex.h'],
command : [py3, gen_lex, '@OUTPUT0@', '@OUTPUT1@', '@INPUT@', 'DUMMY']
command : [python3, gen_lex, '@OUTPUT0@', '@OUTPUT1@', '@INPUT@', 'DUMMY']
)
grammar = custom_target('parsegrammar',
input : 'grammar.y',
output : ['grammar.tab.c', 'grammar.tab.h'],
command : [py3, gen_grammar, '@OUTPUT0@', '@OUTPUT1@', '@INPUT@'],
command : [python3, gen_grammar, '@OUTPUT0@', '@OUTPUT1@', '@INPUT@'],
depends : [parser],
)

View file

@ -385,11 +385,7 @@ if libtype == 'static'
endif
# Used in gst/parse/meson.build and below
py3 = find_program('python3', required : false)
if not py3.found()
# Maybe 'python' is Python 3
py3 = find_program('python')
endif
python3 = import('python3').find_python()
bashcomp_dep = dependency('bash-completion', version : '>= 2.0', required : false)
@ -449,6 +445,6 @@ else
endif
endif
run_command(py3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')
run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')
install_data('gst-element-check-1.0.m4', install_dir : join_paths(get_option('datadir'), 'aclocal'))