mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-16 19:25:18 +00:00
Simplify generate_plugins_path.py script
This also fix an empty plugin name being prepended to the list.
This commit is contained in:
parent
6dfcecb16a
commit
7cf00627be
2 changed files with 18 additions and 14 deletions
24
meson.build
24
meson.build
|
@ -86,13 +86,11 @@ if build_system == 'windows'
|
||||||
subproject('win-nasm')
|
subproject('win-nasm')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
pathsep = host_machine.system() == 'windows' ? ';' : ':'
|
|
||||||
|
|
||||||
subproject('orc', required: get_option('orc'))
|
subproject('orc', required: get_option('orc'))
|
||||||
|
|
||||||
subprojects_names = []
|
subprojects_names = []
|
||||||
plugins_doc_caches = []
|
plugins_doc_caches = []
|
||||||
all_plugins = ''
|
all_plugins = []
|
||||||
foreach sp : subprojects
|
foreach sp : subprojects
|
||||||
project_name = sp[0]
|
project_name = sp[0]
|
||||||
build_infos = sp[1]
|
build_infos = sp[1]
|
||||||
|
@ -114,10 +112,7 @@ foreach sp : subprojects
|
||||||
else
|
else
|
||||||
plugins = []
|
plugins = []
|
||||||
endif
|
endif
|
||||||
|
all_plugins += plugins
|
||||||
foreach plugin: plugins
|
|
||||||
all_plugins += pathsep + plugin.full_path()
|
|
||||||
endforeach
|
|
||||||
|
|
||||||
subprojects_names += [project_name]
|
subprojects_names += [project_name]
|
||||||
cmdres = run_command(python3, '-c', symlink.format(project_name, meson.current_source_dir()))
|
cmdres = run_command(python3, '-c', symlink.format(project_name, meson.current_source_dir()))
|
||||||
|
@ -170,9 +165,18 @@ else
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
cmdres = run_command(python3, find_program('scripts/generate_plugins_path.py'), '--builddir',
|
all_plugins_paths = []
|
||||||
meson.build_root(), all_plugins)
|
foreach plugin: all_plugins
|
||||||
assert(cmdres.returncode() == 0, 'Could not create plugins path: @0@'.format(cmdres.stderr()))
|
all_plugins_paths += plugin.full_path()
|
||||||
|
endforeach
|
||||||
|
|
||||||
|
generate_plugins_paths = find_program('scripts/generate_plugins_path.py')
|
||||||
|
configure_file(
|
||||||
|
output : 'GstPluginsPath.json',
|
||||||
|
command : [generate_plugins_paths,
|
||||||
|
'@OUTPUT@',
|
||||||
|
all_plugins_paths]
|
||||||
|
)
|
||||||
|
|
||||||
message('Building subprojects: ' + ', '.join(subprojects_names))
|
message('Building subprojects: ' + ', '.join(subprojects_names))
|
||||||
setenv = find_program('gst-env.py')
|
setenv = find_program('gst-env.py')
|
||||||
|
|
|
@ -6,14 +6,14 @@ import json
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("--builddir", help="The meson build directory")
|
parser.add_argument(dest="output", help="Output file")
|
||||||
parser.add_argument(dest="plugins", help="The list of plugins")
|
parser.add_argument(dest="plugins", nargs=argparse.REMAINDER, help="The list of plugins")
|
||||||
|
|
||||||
options = parser.parse_args()
|
options = parser.parse_args()
|
||||||
|
|
||||||
all_paths = set()
|
all_paths = set()
|
||||||
for plugin in options.plugins.split(os.pathsep):
|
for plugin in options.plugins:
|
||||||
all_paths.add(os.path.dirname(plugin))
|
all_paths.add(os.path.dirname(plugin))
|
||||||
|
|
||||||
with open(os.path.join(options.builddir, 'GstPluginsPath.json'), "w") as f:
|
with open(options.output, "w") as f:
|
||||||
json.dump(list(all_paths), f, indent=4, sort_keys=True)
|
json.dump(list(all_paths), f, indent=4, sort_keys=True)
|
||||||
|
|
Loading…
Reference in a new issue