meson: check for dav1d dep

Needed to build dav1d-sys which is required by the dav1d decoder plugin.

Exclude the plugin if the dep isn't found, preventing the build to fail.
This commit is contained in:
Guillaume Desmottes 2020-01-02 09:37:55 +05:30 committed by Sebastian Dröge
parent db8b2ad08b
commit cbb1912e99
2 changed files with 17 additions and 4 deletions

View file

@ -7,7 +7,7 @@ import shutil
import subprocess
import sys
meson_build_dir, meson_current_source_dir, meson_build_root, target, ext = sys.argv[1:]
meson_build_dir, meson_current_source_dir, meson_build_root, target, ext, exclude = sys.argv[1:]
cargo_target_dir = os.path.join(meson_build_dir, 'target')
@ -27,10 +27,15 @@ env['PKG_CONFIG_PATH'] = ':'.join(pkg_config_path)
# cargo build
cargo_cmd = ['cargo', 'build', '--manifest-path',
os.path.join(meson_current_source_dir, 'Cargo.toml')]
os.path.join(meson_current_source_dir, 'Cargo.toml'),
'--workspace']
if target == 'release':
cargo_cmd.append('--release')
for e in exclude.split(','):
cargo_cmd.append('--exclude')
cargo_cmd.append(e)
try:
subprocess.run(cargo_cmd, env=env, check=True)
except subprocess.SubprocessError:

View file

@ -25,7 +25,6 @@ plugins_rep = {
'gst-plugin-audiofx': 'libgstrsaudiofx',
'gst-plugin-cdg': 'libgstcdg',
'gst-plugin-closedcaption': 'libgstrsclosedcaption',
'gst-plugin-dav1d': 'libgstrsdav1d',
'gst-plugin-fallbackswitch': 'libgstfallbackswitch',
'gst-plugin-file': 'libgstrsfile',
'gst-plugin-flv': 'libgstrsflv',
@ -38,6 +37,14 @@ plugins_rep = {
'gst-plugin-togglerecord': 'libgsttogglerecord',
}
exclude = []
if dependency('dav1d', required : false).found()
plugins_rep += {'gst-plugin-dav1d' : 'libgstrsdav1d'}
else
exclude += ['gst-plugin-dav1d']
endif
output = []
foreach p, lib : plugins_rep
@ -86,7 +93,8 @@ rs_plugins = custom_target('gst-plugins-rs',
meson.current_source_dir(),
meson.build_root(),
target,
ext])
ext,
','.join(exclude)])
# FIXME: raises a warning as the target has multiple outputs and meson will use
# only the first one. All the plugins have the same basedir, hence