mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-26 05:21:00 +00:00
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:
parent
db8b2ad08b
commit
cbb1912e99
2 changed files with 17 additions and 4 deletions
9
cargo.py
9
cargo.py
|
@ -7,7 +7,7 @@ import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
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')
|
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 build
|
||||||
cargo_cmd = ['cargo', 'build', '--manifest-path',
|
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':
|
if target == 'release':
|
||||||
cargo_cmd.append('--release')
|
cargo_cmd.append('--release')
|
||||||
|
|
||||||
|
for e in exclude.split(','):
|
||||||
|
cargo_cmd.append('--exclude')
|
||||||
|
cargo_cmd.append(e)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
subprocess.run(cargo_cmd, env=env, check=True)
|
subprocess.run(cargo_cmd, env=env, check=True)
|
||||||
except subprocess.SubprocessError:
|
except subprocess.SubprocessError:
|
||||||
|
|
12
meson.build
12
meson.build
|
@ -25,7 +25,6 @@ plugins_rep = {
|
||||||
'gst-plugin-audiofx': 'libgstrsaudiofx',
|
'gst-plugin-audiofx': 'libgstrsaudiofx',
|
||||||
'gst-plugin-cdg': 'libgstcdg',
|
'gst-plugin-cdg': 'libgstcdg',
|
||||||
'gst-plugin-closedcaption': 'libgstrsclosedcaption',
|
'gst-plugin-closedcaption': 'libgstrsclosedcaption',
|
||||||
'gst-plugin-dav1d': 'libgstrsdav1d',
|
|
||||||
'gst-plugin-fallbackswitch': 'libgstfallbackswitch',
|
'gst-plugin-fallbackswitch': 'libgstfallbackswitch',
|
||||||
'gst-plugin-file': 'libgstrsfile',
|
'gst-plugin-file': 'libgstrsfile',
|
||||||
'gst-plugin-flv': 'libgstrsflv',
|
'gst-plugin-flv': 'libgstrsflv',
|
||||||
|
@ -38,6 +37,14 @@ plugins_rep = {
|
||||||
'gst-plugin-togglerecord': 'libgsttogglerecord',
|
'gst-plugin-togglerecord': 'libgsttogglerecord',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exclude = []
|
||||||
|
|
||||||
|
if dependency('dav1d', required : false).found()
|
||||||
|
plugins_rep += {'gst-plugin-dav1d' : 'libgstrsdav1d'}
|
||||||
|
else
|
||||||
|
exclude += ['gst-plugin-dav1d']
|
||||||
|
endif
|
||||||
|
|
||||||
output = []
|
output = []
|
||||||
|
|
||||||
foreach p, lib : plugins_rep
|
foreach p, lib : plugins_rep
|
||||||
|
@ -86,7 +93,8 @@ rs_plugins = custom_target('gst-plugins-rs',
|
||||||
meson.current_source_dir(),
|
meson.current_source_dir(),
|
||||||
meson.build_root(),
|
meson.build_root(),
|
||||||
target,
|
target,
|
||||||
ext])
|
ext,
|
||||||
|
','.join(exclude)])
|
||||||
|
|
||||||
# FIXME: raises a warning as the target has multiple outputs and meson will use
|
# 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
|
# only the first one. All the plugins have the same basedir, hence
|
||||||
|
|
Loading…
Reference in a new issue