Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.com>2020-01-17 07:53:43 +0300
committerGuillaume Desmottes <guillaume.desmottes@collabora.com>2020-01-30 13:57:00 +0300
commit1b84dd1f6b6917630a2219bc09482d05f1fc5b8e (patch)
treee70fe129f795f06c176f583541e35080fc31c98c
parenta43ad8f2dd93abb1ae88c4f0b2e8a77b1f1fc0e4 (diff)
meson: add sodium option
Allow us to pick between the built-in libsodium, use the one from the system or disable the plugin.
-rw-r--r--cargo_wrapper.py11
-rw-r--r--meson.build24
-rw-r--r--meson_options.txt3
3 files changed, 33 insertions, 5 deletions
diff --git a/cargo_wrapper.py b/cargo_wrapper.py
index c8b143094..0d208dee5 100644
--- a/cargo_wrapper.py
+++ b/cargo_wrapper.py
@@ -7,8 +7,8 @@ import shutil
import subprocess
import sys
-command, meson_build_dir, meson_current_source_dir, meson_build_root, target, exclude = sys.argv[
- 1:7]
+command, meson_build_dir, meson_current_source_dir, meson_build_root, target, exclude, extra_env = sys.argv[
+ 1:8]
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'))
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':
# cargo build
- ext = sys.argv[7]
+ ext = sys.argv[8]
cargo_cmd = ['cargo', 'build', '--all-targets',
'--manifest-path', os.path.join(
meson_current_source_dir, 'Cargo.toml'),
diff --git a/meson.build b/meson.build
index 916d70a04..8c6c9af37 100644
--- a/meson.build
+++ b/meson.build
@@ -33,12 +33,12 @@ plugins_rep = {
'gst-plugin-rav1e': 'libgstrav1e',
'gst-plugin-reqwest': 'libgstreqwest',
'gst-plugin-rusoto': 'libgstrusoto',
- 'gst-plugin-sodium': 'libgstsodium',
'gst-plugin-threadshare': 'libgstthreadshare',
'gst-plugin-togglerecord': 'libgsttogglerecord',
}
exclude = []
+extra_env = {}
if dependency('dav1d', required : get_option('dav1d')).found()
plugins_rep += {'gst-plugin-dav1d' : 'libgstrsdav1d'}
@@ -46,6 +46,17 @@ else
exclude += ['gst-plugin-dav1d']
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 = []
foreach p, lib : plugins_rep
@@ -83,6 +94,13 @@ endforeach
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
rs_plugins = custom_target('gst-plugins-rs',
build_by_default: true,
@@ -98,6 +116,7 @@ rs_plugins = custom_target('gst-plugins-rs',
meson.build_root(),
target,
exclude,
+ extra_env_str,
ext])
# 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.build_root(),
target,
- exclude],
+ exclude,
+ extra_env_str],
timeout: 600)
diff --git a/meson_options.txt b/meson_options.txt
index 59e23fe9f..4adb45208 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1 +1,4 @@
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')