summaryrefslogtreecommitdiff
path: root/gst-env.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2023-01-11 01:13:30 +0530
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2023-01-25 11:38:52 +0000
commit3d13a0d2522361893b145beb97a06d5671424cfc (patch)
tree4589e885ed7cc3947f89bf12733c4b4f5b273954 /gst-env.py
parent8e8d8206f1d798384c1b8551811fb789a69e01b2 (diff)
downloadgstreamer-3d13a0d2522361893b145beb97a06d5671424cfc.tar.gz
gst-env.py: Output DYLD_LIBRARY_PATH with --only-environment on macOS
DYLD_LIBRARY_PATH is considered a security risk by Apple, so shells filter it out, but we can set it when using --only-environment so people can use it like so: eval $(./gst-env.py --only-environment) This is currently the only way to build an app that links to gstreamer inside the devenv on macOS and have it run properly. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3708>
Diffstat (limited to 'gst-env.py')
-rwxr-xr-xgst-env.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/gst-env.py b/gst-env.py
index fb266adad3..1eac43b9b9 100755
--- a/gst-env.py
+++ b/gst-env.py
@@ -294,8 +294,12 @@ def get_subprocess_env(options, gst_version):
if os.name == 'nt':
lib_path_envvar = 'PATH'
elif platform.system() == 'Darwin':
- # RPATH is sufficient on macOS, and DYLD_LIBRARY_PATH can cause issues with dynamic linker path priority
+ # DYLD_LIBRARY_PATH is stripped when new shells are spawned and can
+ # cause issues with runtime linker resolution, so only set it when
+ # using --only-environment
lib_path_envvar = None
+ if options.only_environment:
+ lib_path_envvar = 'DYLD_LIBRARY_PATH'
else:
lib_path_envvar = 'LD_LIBRARY_PATH'