sharedlib_reg = re.compile(r'\.so|\.dylib|\.dll')
typelib_reg = re.compile(r'.*\.typelib$')
- pluginpath_reg = re.compile(r'lib.*' + re.escape(os.path.normpath('/gstreamer-1.0/')))
if os.name is 'nt':
lib_path_envvar = 'PATH'
elif sharedlib_reg.search(filename):
if not target['type'].startswith('shared'):
continue
- if target['installed']:
- if pluginpath_reg.search(os.path.normpath(stringify(target['install_filename']))):
- prepend_env_var(env, "GST_PLUGIN_PATH", os.path.join(options.builddir, root))
- continue
prepend_env_var(env, lib_path_envvar,
os.path.join(options.builddir, root))
elif target['type'] == 'executable' and target['installed']:
paths.add(os.path.join(options.builddir, root))
+ with open(os.path.join(options.builddir, 'GstPluginsPath.json')) as f:
+ for plugin_path in json.load(f):
+ prepend_env_var(env, 'GST_PLUGIN_PATH', plugin_path)
+
for p in paths:
prepend_env_var(env, 'PATH', p)
subproj = subproject(project_name, required: is_required)
endif
- if subproj.found()
- if build_infos.has_key('build-hotdoc', default: false)
- foreach plugin: subproj.get_variable('plugins')
- all_plugins += plugin.full_path()
- endforeach
- if documented_projects != ''
- documented_projects += ','
- endif
-
- documented_projects += project_name
+ if subproj.found() and build_infos.has_key('build-hotdoc', default: false)
+ foreach plugin: subproj.get_variable('plugins')
+ all_plugins += plugin.full_path()
+ endforeach
+ if documented_projects != ''
+ documented_projects += ','
endif
documented_projects += project_name
endif
endif
+cmdres = run_command(python3, find_program('scripts/generate_plugins_path.py'), '--builddir',
+ meson.build_root(), all_plugins)
+assert(cmdres.returncode() == 0, 'Could not create plugins path: @0@'.format(cmdres.stderr()))
+
message('Building subprojects: ' + ', '.join(subprojects_names))
setenv = find_program('gst-uninstalled.py')
run_target('uninstalled', command : [setenv, '--builddir=@0@'.format(meson.build_root()),
--- /dev/null
+#!/usr/bin/env python3
+
+import argparse
+import os
+import json
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--builddir", help="The meson build directory")
+ parser.add_argument(dest="plugins", help="The list of plugins", nargs="+")
+
+ options = parser.parse_args()
+
+ all_paths = set()
+ for plugin in options.plugins:
+ all_paths.add(os.path.dirname(plugin))
+
+ with open(os.path.join(options.builddir, 'GstPluginsPath.json'), "w") as f:
+ json.dump(list(all_paths), f, indent=4, sort_keys=True)