mirror of
				https://github.com/cookiengineer/audacity
				synced 2025-11-03 23:53:55 +01:00 
			
		
		
		
	... That is, put a little shell script in the application bundle, and invoke it (in Release, though not Debug where it interferes with Xcode debugging) See commit07661c186fThe shell nulls the environment variable DYLD_LIBRARY_PATH and then executes the main program. This is needed because changes to DYLD_LIBRARY_PATH during the main program's run fail to affect the loading of dynamic libraries afterward. We need null in DYLD_LIBRARY_PATH to make absolute paths to libraries take priority. More info: Documentation of workings of the macOS dynamic loader https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryUsageGuidelines.html The same problem and solution is discussed here https://stackoverflow.com/questions/6713692/problems-with-using-setenv-and-then-making-the-dlopen-call It is claimed there that Firefox did the same trick with a shell, which I do not observe in my version, but GIMP 2.8.16 does this, as I can see by examining package contents Also note the mention in this commit's comments (where the script was removed because bug543's fix left it unused), that the script also used to interfere with signing. I hope that there will be a way around that.98186b9317
		
			
				
	
	
		
			22 lines
		
	
	
		
			710 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			710 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/sh
 | 
						|
#
 | 
						|
# The purpose of this script is to give the user more control over where libraries
 | 
						|
# such as Lame and FFmpeg get loaded from.
 | 
						|
#
 | 
						|
# Since absolute pathnames are used when loading these libraries, the normal search
 | 
						|
# path would be DYLD_LIBRARY_PATH, absolute path, DYLD_FALLBACK_LIBRARY_PATH.  This
 | 
						|
# means that DYLD_LIBRARY_PATH can override what the user actually wants.
 | 
						|
#
 | 
						|
# So, we simply clear DYLD_LIBRARY_PATH to allow the users choice to be the first
 | 
						|
# one tried.
 | 
						|
#
 | 
						|
 | 
						|
DYLD_FALLBACK_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$DYLD_FALLBACK_LIBRARY_PATH:$HOME/lib:/usr/local/lib:/usr/lib"
 | 
						|
export DYLD_FALLBACK_LIBRARY_PATH
 | 
						|
 | 
						|
DYLD_LIBRARY_PATH=""
 | 
						|
export DYLD_LIBRARY_PATH
 | 
						|
 | 
						|
dir=$(dirname "$0")
 | 
						|
"$dir/Audacity"
 |