meson: Use python module to install override files

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3929>
This commit is contained in:
Thibault Saunier 2021-09-20 17:20:44 -03:00 committed by GStreamer Marge Bot
parent 47c183cdfd
commit da11e6610e
3 changed files with 11 additions and 7 deletions

View file

@ -1,5 +1,8 @@
install_data(['gi/overrides/GES.py'], install_dir: pygi_override_dir)
env = environment()
env.prepend('_GI_OVERRIDES_PATH', meson.current_source_dir() / 'gi/overrides')
meson.add_devenv(env)
python.install_sources(['gi/overrides/GES.py'],
pure : false,
subdir: 'gi/overrides',
)

View file

@ -144,6 +144,8 @@ gir_init_section = [ '--add-init-section=' + \
'gst_init(NULL,NULL);' + \
'ges_init();', '--quiet']
pymod = import('python')
python = pymod.find_installation(required: get_option('python'))
has_python = false
static_build = get_option('default_library') == 'static'
if static_build
@ -153,8 +155,6 @@ if static_build
message('Disabling python support as it is not supported on static builds')
endif
elif build_gir
pymod = import('python')
python = pymod.find_installation(required: get_option('python'))
if python.found()
# Workaround for https://github.com/mesonbuild/meson/issues/5629
pythonver = python.language_version()

View file

@ -1,7 +1,8 @@
pysources = ['Gst.py', 'GstPbutils.py', 'GstVideo.py', 'GstAudio.py']
install_data(pysources,
install_dir: pygi_override_dir,
install_tag: 'python-runtime')
python.install_sources(pysources,
pure : false,
subdir: 'gi/overrides',
)
gstpython = python.extension_module('_gi_gst',
sources: ['gstmodule.c'],