gstreamer/validate/tests/getpluginsdir

28 lines
723 B
Text
Raw Normal View History

2016-09-07 13:59:22 +00:00
#!/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().replace("\n", "")
except subprocess.CalledProcessError as e:
# Probably means there is no .pc file for the module
# and it should hopefully no be too bad.
pass
2016-09-07 13:59:22 +00:00
print(res.strip(":"))