From 61323239117359de4ece2d382cb9142f8abf2620 Mon Sep 17 00:00:00 2001 From: Akemi Date: Fri, 29 Sep 2017 18:25:54 +0200 Subject: 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. --- osdep/macosx_application.m | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'osdep') 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); } -- cgit v1.2.3