summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThibault Saunier <thibault.saunier@osg.samsung.com>2016-09-05 17:43:13 -0300
committerThibault Saunier <thibault.saunier@osg.samsung.com>2016-09-05 18:20:35 -0300
commitacd047db157777f94680b9eaaa9dd15d50265c98 (patch)
treeb779e7240b35c62d2082cdb59fe79cc06d285404 /tests
parenta81734a371228742c1507dfb65126286bc81fea7 (diff)
meson: Properly find where GStreamer plugins are when using subprojects
And fix building with meson 0.34
Diffstat (limited to 'tests')
-rw-r--r--tests/check/getpluginsdir25
-rw-r--r--tests/check/meson.build3
2 files changed, 27 insertions, 1 deletions
diff --git a/tests/check/getpluginsdir b/tests/check/getpluginsdir
new file mode 100644
index 000000000..102e3c823
--- /dev/null
+++ b/tests/check/getpluginsdir
@@ -0,0 +1,25 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+import subprocess
+
+builddir = os.environ['MESON_BUILD_ROOT']
+
+res = ''
+args = sys.argv[1:]
+for i in range(0, len(args), 2):
+ project = args[i]
+ pkg_name = args[i + 1]
+ path = os.path.join(builddir, 'subprojects', project)
+ if os.path.exists(path):
+ res += ':' + path
+ else:
+ try:
+ res += ':' + subprocess.check_output(['pkg-config',
+ '--variable=pluginsdir',
+ pkg_name]).decode()
+ except subprocess.CalledProcessError:
+ exit(1)
+
+print(res.strip(":"))
diff --git a/tests/check/meson.build b/tests/check/meson.build
index e60aa8175..c7527d2e0 100644
--- a/tests/check/meson.build
+++ b/tests/check/meson.build
@@ -85,7 +85,8 @@ test_defines = [
'-DGST_USE_UNSTABLE_API',
]
-runcmd = run_command('pkg-config', '--variable=pluginsdir', 'gstreamer-1.0')
+getpluginsdir = find_program('getpluginsdir')
+runcmd = run_command(getpluginsdir, 'gstreamer', 'gstreamer-1.0')
if runcmd.returncode() == 0
core_plugins_dir = runcmd.stdout().strip()
message('Using GStreamer plug-ins in ' + core_plugins_dir)