mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-05-20 09:18:15 +00:00
meson: add sodium option
Allow us to pick between the built-in libsodium, use the one from the system or disable the plugin.
This commit is contained in:
parent
a43ad8f2dd
commit
1b84dd1f6b
|
@ -7,8 +7,8 @@ import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
command, meson_build_dir, meson_current_source_dir, meson_build_root, target, exclude = sys.argv[
|
command, meson_build_dir, meson_current_source_dir, meson_build_root, target, exclude, extra_env = sys.argv[
|
||||||
1:7]
|
1:8]
|
||||||
|
|
||||||
cargo_target_dir = os.path.join(meson_build_dir, 'target')
|
cargo_target_dir = os.path.join(meson_build_dir, 'target')
|
||||||
|
|
||||||
|
@ -26,9 +26,14 @@ pkg_config_path.append(os.path.join(
|
||||||
meson_build_root, 'subprojects', 'gst-plugins-base', 'pkgconfig'))
|
meson_build_root, 'subprojects', 'gst-plugins-base', 'pkgconfig'))
|
||||||
env['PKG_CONFIG_PATH'] = ':'.join(pkg_config_path)
|
env['PKG_CONFIG_PATH'] = ':'.join(pkg_config_path)
|
||||||
|
|
||||||
|
if len(extra_env) > 0:
|
||||||
|
for e in extra_env.split(','):
|
||||||
|
k, v = e.split(':')
|
||||||
|
env[k] = v
|
||||||
|
|
||||||
if command == 'build':
|
if command == 'build':
|
||||||
# cargo build
|
# cargo build
|
||||||
ext = sys.argv[7]
|
ext = sys.argv[8]
|
||||||
cargo_cmd = ['cargo', 'build', '--all-targets',
|
cargo_cmd = ['cargo', 'build', '--all-targets',
|
||||||
'--manifest-path', os.path.join(
|
'--manifest-path', os.path.join(
|
||||||
meson_current_source_dir, 'Cargo.toml'),
|
meson_current_source_dir, 'Cargo.toml'),
|
||||||
|
|
24
meson.build
24
meson.build
|
@ -33,12 +33,12 @@ plugins_rep = {
|
||||||
'gst-plugin-rav1e': 'libgstrav1e',
|
'gst-plugin-rav1e': 'libgstrav1e',
|
||||||
'gst-plugin-reqwest': 'libgstreqwest',
|
'gst-plugin-reqwest': 'libgstreqwest',
|
||||||
'gst-plugin-rusoto': 'libgstrusoto',
|
'gst-plugin-rusoto': 'libgstrusoto',
|
||||||
'gst-plugin-sodium': 'libgstsodium',
|
|
||||||
'gst-plugin-threadshare': 'libgstthreadshare',
|
'gst-plugin-threadshare': 'libgstthreadshare',
|
||||||
'gst-plugin-togglerecord': 'libgsttogglerecord',
|
'gst-plugin-togglerecord': 'libgsttogglerecord',
|
||||||
}
|
}
|
||||||
|
|
||||||
exclude = []
|
exclude = []
|
||||||
|
extra_env = {}
|
||||||
|
|
||||||
if dependency('dav1d', required : get_option('dav1d')).found()
|
if dependency('dav1d', required : get_option('dav1d')).found()
|
||||||
plugins_rep += {'gst-plugin-dav1d' : 'libgstrsdav1d'}
|
plugins_rep += {'gst-plugin-dav1d' : 'libgstrsdav1d'}
|
||||||
|
@ -46,6 +46,17 @@ else
|
||||||
exclude += ['gst-plugin-dav1d']
|
exclude += ['gst-plugin-dav1d']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
sodium = get_option ('sodium')
|
||||||
|
if sodium == 'system'
|
||||||
|
dependency('libsodium')
|
||||||
|
plugins_rep += {'gst-plugin-sodium': 'libgstsodium'}
|
||||||
|
extra_env += {'SODIUM_USE_PKG_CONFIG': '1'}
|
||||||
|
elif sodium == 'built-in'
|
||||||
|
plugins_rep += {'gst-plugin-sodium': 'libgstsodium'}
|
||||||
|
else
|
||||||
|
exclude += ['gst-plugin-sodium']
|
||||||
|
endif
|
||||||
|
|
||||||
output = []
|
output = []
|
||||||
|
|
||||||
foreach p, lib : plugins_rep
|
foreach p, lib : plugins_rep
|
||||||
|
@ -83,6 +94,13 @@ endforeach
|
||||||
|
|
||||||
exclude = ','.join(exclude)
|
exclude = ','.join(exclude)
|
||||||
|
|
||||||
|
# serialize extra_env
|
||||||
|
extra_env_list = []
|
||||||
|
foreach key, value : extra_env
|
||||||
|
extra_env_list += key + ':' + value
|
||||||
|
endforeach
|
||||||
|
extra_env_str = ','.join(extra_env_list)
|
||||||
|
|
||||||
# Always build the target so we don't have to list all source files as input
|
# Always build the target so we don't have to list all source files as input
|
||||||
rs_plugins = custom_target('gst-plugins-rs',
|
rs_plugins = custom_target('gst-plugins-rs',
|
||||||
build_by_default: true,
|
build_by_default: true,
|
||||||
|
@ -98,6 +116,7 @@ rs_plugins = custom_target('gst-plugins-rs',
|
||||||
meson.build_root(),
|
meson.build_root(),
|
||||||
target,
|
target,
|
||||||
exclude,
|
exclude,
|
||||||
|
extra_env_str,
|
||||||
ext])
|
ext])
|
||||||
|
|
||||||
# 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
|
||||||
|
@ -112,5 +131,6 @@ test('tests',
|
||||||
meson.current_source_dir(),
|
meson.current_source_dir(),
|
||||||
meson.build_root(),
|
meson.build_root(),
|
||||||
target,
|
target,
|
||||||
exclude],
|
exclude,
|
||||||
|
extra_env_str],
|
||||||
timeout: 600)
|
timeout: 600)
|
||||||
|
|
|
@ -1 +1,4 @@
|
||||||
option('dav1d', type : 'feature', value : 'auto', description : 'Build dav1d plugin')
|
option('dav1d', type : 'feature', value : 'auto', description : 'Build dav1d plugin')
|
||||||
|
option('sodium', type : 'combo',
|
||||||
|
choices : ['system', 'built-in', 'disabled'], value : 'built-in',
|
||||||
|
description : 'Weither to use libsodium from the system or the built-in version from the sodiumoxide crate')
|
||||||
|
|
Loading…
Reference in a new issue