summaryrefslogtreecommitdiff
path: root/gst-env.py
diff options
context:
space:
mode:
authorSebastian Fricke <sebastian.fricke@collabora.com>2022-02-17 21:44:30 +0100
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2022-03-01 11:33:10 +0000
commit57158f419491a98585054d9554d8a6c702684bc7 (patch)
treed779d4e18f476968bfb84a5f8e1ead01426faf82 /gst-env.py
parent683d0456d9bf0d239abdc336d08ee4d71f027260 (diff)
downloadgstreamer-57158f419491a98585054d9554d8a6c702684bc7.tar.gz
Allow running gst-uninstalled when GStreamer is a subproject
As described in Merge request 222, the previous solution is not the best possible solution and was also missing documentation. Adjust the suggestion to the current GStreamer mono-repository. And apply this change after reverting the previous commit. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1743>
Diffstat (limited to 'gst-env.py')
-rwxr-xr-xgst-env.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/gst-env.py b/gst-env.py
index 384acb8d5d..d4a0ef6885 100755
--- a/gst-env.py
+++ b/gst-env.py
@@ -390,10 +390,16 @@ def get_subprocess_env(options, gst_version):
os.path.join(options.builddir, root),
options.sysroot)
- 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,
- options.sysroot)
+ # Search for the Plugin paths file either in the build directory root
+ # or check if gstreamer is a subproject of another project
+ for sub_directories in [[], ['subprojects', 'gstreamer']]:
+ plugin_paths = os.path.join(options.builddir, *sub_directories, 'GstPluginsPath.json')
+ if os.path.exists(plugin_paths):
+ with open(plugin_paths) as f:
+ for plugin_path in json.load(f):
+ prepend_env_var(env, 'GST_PLUGIN_PATH', plugin_path,
+ options.sysroot)
+ break
# Sort to iterate in a consistent order (`set`s and `hash`es are randomized)
for p in sorted(paths):