1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-03 07:10:10 +01:00

Bug290 (load LAME, FFmpeg from correct place): original fix again...

... 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 commit 07661c186f

The 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
This commit is contained in:
Paul Licameli
2017-07-26 23:51:50 -04:00
parent e359383d3b
commit 8b32eea8bb
3 changed files with 43 additions and 1 deletions

View File

@@ -890,6 +890,7 @@
28BD8AB3101DF4C700686679 /* ExecMenuCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28BD8AAC101DF4C600686679 /* ExecMenuCommand.cpp */; };
28BD8AB4101DF4C700686679 /* GetAllMenuCommands.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28BD8AAE101DF4C600686679 /* GetAllMenuCommands.cpp */; };
28C3946D1818356800FDDAC9 /* AudacityLogger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28C3946B1818356800FDDAC9 /* AudacityLogger.cpp */; };
28C816BA131255790035BB10 /* Audacity.sh in Install wrapper */ = {isa = PBXBuildFile; fileRef = 28C816B81312555B0035BB10 /* Audacity.sh */; };
28C8211D1B5C661E00B53328 /* ViewInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28C8211C1B5C661E00B53328 /* ViewInfo.cpp */; };
28CA9E6B1AE60C53005C0BFE /* dBTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 82FF184D13CF01A600C1B664 /* dBTable.cpp */; };
28CA9E6C1AE60C53005C0BFE /* dBTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 82FF184E13CF01A600C1B664 /* dBTable.h */; };
@@ -1491,6 +1492,17 @@
name = "Install miscellany";
runOnlyForDeploymentPostprocessing = 1;
};
28C816B7131255550035BB10 /* Install wrapper */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 8;
dstPath = "";
dstSubfolderSpec = 6;
files = (
28C816BA131255790035BB10 /* Audacity.sh in Install wrapper */,
);
name = "Install wrapper";
runOnlyForDeploymentPostprocessing = 1;
};
ED95519E195D956F0027176E /* Install background image */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 8;
@@ -2697,6 +2709,7 @@
28CC03A61AD386CF00826380 /* sndsliders.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sndsliders.c; sourceTree = "<group>"; };
28CC03A71AD386CF00826380 /* sndsliders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sndsliders.h; sourceTree = "<group>"; };
28CC03B01AD3874500826380 /* security.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = security.c; sourceTree = "<group>"; };
28C816B81312555B0035BB10 /* Audacity.sh */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.script.sh; name = Audacity.sh; path = mac/Audacity.sh; sourceTree = "<group>"; };
28CCDCFF0F939FD70081F2FC /* FileHistory.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = FileHistory.cpp; sourceTree = "<group>"; tabWidth = 3; };
28CCDD040F93A0B20081F2FC /* FileHistory.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = FileHistory.h; sourceTree = "<group>"; tabWidth = 3; };
28D000A31A32920C00367B21 /* DeviceChange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceChange.cpp; sourceTree = "<group>"; };
@@ -3913,6 +3926,7 @@
isa = PBXGroup;
children = (
174F73C8098D516D009CD6E0 /* Resources */,
28C816B81312555B0035BB10 /* Audacity.sh */,
28006FFA132C167600BD34D7 /* Install.txt */,
178CF4FF0989541C0056CE58 /* configmac.h */,
174F73D7098D51AA009CD6E0 /* Info.plist */,
@@ -6800,6 +6814,7 @@
28708D631B17C3C400496FEB /* Copy wxWidgets libs */,
288F0980131A400F0008E860 /* Install manual */,
282413DA131D52CE009FD931 /* Install plugins */,
28C816B7131255550035BB10 /* Install wrapper */,
2892CE28131AFB1900E1E17D /* Install miscellany */,
ED95519E195D956F0027176E /* Install background image */,
282413D8131D51FC009FD931 /* Create dist */,