aboutsummaryrefslogtreecommitdiffhomepage
path: root/osdep
diff options
context:
space:
mode:
authorGravatar Akemi <der.richter@gmx.de>2017-09-29 18:25:54 +0200
committerGravatar Akemi <der.richter@gmx.de>2017-10-03 11:30:56 +0200
commit61323239117359de4ece2d382cb9142f8abf2620 (patch)
treecd3245b460fed154108daf655979f2880f214da4 /osdep
parent77021cf6fe6a1813b832c8927c288e958b6f6845 (diff)
osx: add some common paths to our $PATH when started from bundle
with the previous commit we removed the ability of loading the standard shell environment. this exact behaviour can only be re-added by either invoking the standard shell in a background process and reading it's environment vars or by manually reading all the various shell configs. both ways are kinda dirty and the former was already rejected before. for now we will just add some commonly used paths, when started from the bundle, so it can find the binaries used by mpv again. for example the youtube-dl one for our youtube-dl hook.
Diffstat (limited to 'osdep')
-rw-r--r--osdep/macosx_application.m8
1 files changed, 8 insertions, 0 deletions
diff --git a/osdep/macosx_application.m b/osdep/macosx_application.m
index b42cba5c37..c5540494e4 100644
--- a/osdep/macosx_application.m
+++ b/osdep/macosx_application.m
@@ -261,6 +261,14 @@ static void setup_bundle(int *argc, char *argv[])
argv[1] = NULL;
}
+ NSDictionary *env = [[NSProcessInfo processInfo] environment];
+ NSString *path_bundle = [env objectForKey:@"PATH"];
+ NSString *path_new = [NSString stringWithFormat:@"%@:%@:%@:%@",
+ path_bundle,
+ @"/usr/local/bin",
+ @"/usr/opt/bin",
+ @"/usr/opt/local/bin"];
+ setenv("PATH", [path_new UTF8String], 1);
setenv("MPVBUNDLE", "true", 1);
}