Commit f922969a authored by Nirbheek Chauhan's avatar Nirbheek Chauhan 🐜

gst-uninstalled: Fix compatibility with meson 0.50

Starting with Meson 0.50, meson instrospect --targets uses a list
for the filename and install_filenames of each target. Handle both
lists and strings.
parent 8c7727a9
......@@ -19,6 +19,22 @@ SCRIPTDIR = os.path.dirname(os.path.realpath(__file__))
PREFIX_DIR = os.path.join(SCRIPTDIR, 'prefix')
def listify(o):
if isinstance(o, str):
return [o]
if isinstance(o, list):
return o
raise AssertionError('Object {!r} must be a string or a list'.format(o))
def stringify(o):
if isinstance(o, str):
return o
if isinstance(o, list):
if len(o) == 1:
return o[0]
raise AssertionError('Did not expect object {!r} to have more than one element'.format(o))
raise AssertionError('Object {!r} must be a string or a list'.format(o))
def prepend_env_var(env, var, value):
env[var] = os.pathsep + value + os.pathsep + env.get(var, "")
env[var] = env[var].replace(os.pathsep + os.pathsep, os.pathsep).strip(os.pathsep)
......@@ -75,7 +91,8 @@ def get_subprocess_env(options):
mono_paths = set()
srcdir_path = pathlib.Path(options.srcdir)
for target in targets:
filename = target['filename']
filenames = listify(target['filename'])
for filename in filenames:
root = os.path.dirname(filename)
if srcdir_path / "subprojects/gst-devtools/validate/plugins" in (srcdir_path / root).parents:
......@@ -85,16 +102,16 @@ def get_subprocess_env(options):
prepend_env_var(env, "GI_TYPELIB_PATH",
os.path.join(options.builddir, root))
if target.get('type') != "shared library":
if not target['type'].startswith('shared'):
if target.get('installed') and'install_filename'))):
if target['installed']:
prepend_env_var(env, "GST_PLUGIN_PATH", os.path.join(options.builddir, root))
prepend_env_var(env, lib_path_envvar,
os.path.join(options.builddir, root))
elif target.get('type') == 'executable' and target.get('installed'):
elif target['type'] == 'executable' and target['installed']:
paths.add(os.path.join(options.builddir, root))
for p in paths:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment