Revert to using a wrapper when starting Audacity

But, this time use a "C" wrapper as posited by Paul in:

   https://bugzilla.audacityteam.org/show_bug.cgi?id=543#c6

Doing so should bypass the execve()/decontruction issue and
still allow entitlements to work.

This also sets the build system to Legacy so that a "clean"
action will not produce:

   error: Could not delete '...' because it was not created by
          the build system.

And, I'm not sure why the deployment target was 10.9, but it
should have been 10.7.
This commit is contained in:
Leland Lucius 2020-02-02 02:46:53 -06:00
parent eb86a1eab7
commit 080b746b66
8 changed files with 182 additions and 92 deletions

View File

@ -2,31 +2,15 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.automation.apple-events</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.debugger</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.device.audio-input</key>
<true/>
<key>com.apple.security.device.camera</key>
<true/>
<key>com.apple.security.personal-information.addressbook</key>
<true/>
<key>com.apple.security.personal-information.calendars</key>
<true/>
<key>com.apple.security.personal-information.location</key>
<true/>
<key>com.apple.security.personal-information.photos-library</key>
<true/>
</dict>
</plist>

View File

@ -1,21 +0,0 @@
#!/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")
exec "$dir/Audacity"

View File

@ -732,7 +732,6 @@
2860BA280E0F0DD800A13878 /* ExportFFmpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2860BA260E0F0DD800A13878 /* ExportFFmpeg.cpp */; };
28624C0F181CE65700E1AD1A /* sratom.h in Headers */ = {isa = PBXBuildFile; fileRef = 286243A0181CE65500E1AD1A /* sratom.h */; };
28624C10181CE65700E1AD1A /* sratom.c in Sources */ = {isa = PBXBuildFile; fileRef = 286243A1181CE65500E1AD1A /* sratom.c */; };
2872DFEA1B5EEC15004385B1 /* hy.po in Sources */ = {isa = PBXBuildFile; fileRef = 28ECC1911A66CC5000EECC53 /* hy.po */; };
287DBE890F3F6B2700C5BBED /* audio_detect.c in Sources */ = {isa = PBXBuildFile; fileRef = 287DBE830F3F6B2700C5BBED /* audio_detect.c */; };
287DBE8A0F3F6B2700C5BBED /* chunk.c in Sources */ = {isa = PBXBuildFile; fileRef = 287DBE840F3F6B2700C5BBED /* chunk.c */; };
287DBE8B0F3F6B2700C5BBED /* ima_oki_adpcm.c in Sources */ = {isa = PBXBuildFile; fileRef = 287DBE850F3F6B2700C5BBED /* ima_oki_adpcm.c */; };
@ -828,6 +827,8 @@
2897F6F80AB3DB5A003C20C5 /* ToolsToolBar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2897F6EC0AB3DB5A003C20C5 /* ToolsToolBar.cpp */; };
2897F6F90AB3DB5A003C20C5 /* TranscriptionToolBar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2897F6EE0AB3DB5A003C20C5 /* TranscriptionToolBar.cpp */; };
2897F6FE0AB3DCD0003C20C5 /* Grabber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2897F6FC0AB3DCD0003C20C5 /* Grabber.cpp */; };
289A865023E66001006A8CC5 /* Wrapper.c in Sources */ = {isa = PBXBuildFile; fileRef = 289A864E23E65EAA006A8CC5 /* Wrapper.c */; };
289A865323E66478006A8CC5 /* Wrapper in Install wrapper */ = {isa = PBXBuildFile; fileRef = 289A864223E65A3E006A8CC5 /* Wrapper */; };
289D127A1B44D57F00B5B6AA /* VSTControlOSX.mm in Sources */ = {isa = PBXBuildFile; fileRef = 289D12791B44D57F00B5B6AA /* VSTControlOSX.mm */; };
289E750A1006D0BD00CEF79B /* MixerBoard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 289E75081006D0BD00CEF79B /* MixerBoard.cpp */; };
289F9C7E0AC671BB00797DC1 /* DeviceToolBar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 289F9C7C0AC671BB00797DC1 /* DeviceToolBar.cpp */; };
@ -1275,7 +1276,6 @@
5E36A0AE217FA2430068E082 /* TransportMenus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E36A0A5217FA2430068E082 /* TransportMenus.cpp */; };
5E36A0AF217FA2430068E082 /* ViewMenus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E36A0A6217FA2430068E082 /* ViewMenus.cpp */; };
5E36A0B0217FA2430068E082 /* WindowMenus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E36A0A7217FA2430068E082 /* WindowMenus.cpp */; };
5E36A0B2217FC5A10068E082 /* (null) in Sources */ = {isa = PBXBuildFile; };
5E36A0B4217FC6540068E082 /* HelpMenus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E36A0B3217FC6540068E082 /* HelpMenus.cpp */; };
5E3A530822AD277A00C4ADB8 /* ProjectSelectionManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E3A530622AD277A00C4ADB8 /* ProjectSelectionManager.cpp */; };
5E3FFE721EC9032B0020F7C9 /* NoteTrackSliderHandles.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E3FFE701EC9032B0020F7C9 /* NoteTrackSliderHandles.cpp */; };
@ -1612,6 +1612,13 @@
remoteGlobalIDString = 2862299E181CE4B600E1AD1A;
remoteInfo = lv2;
};
289A864C23E65E25006A8CC5 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 1790ABE309883346008A330A /* Project object */;
proxyType = 1;
remoteGlobalIDString = 289A864123E65A3E006A8CC5;
remoteInfo = Wrapper;
};
28D489281B5F061200A2E4DF /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 1790ABE309883346008A330A /* Project object */;
@ -1677,6 +1684,17 @@
name = "Install miscellany";
runOnlyForDeploymentPostprocessing = 1;
};
289A865223E66456006A8CC5 /* Install wrapper */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 6;
files = (
289A865323E66478006A8CC5 /* Wrapper in Install wrapper */,
);
name = "Install wrapper";
runOnlyForDeploymentPostprocessing = 0;
};
ED95519E195D956F0027176E /* Install background image */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 8;
@ -2787,6 +2805,8 @@
2897F6EF0AB3DB5A003C20C5 /* TranscriptionToolBar.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = TranscriptionToolBar.h; sourceTree = "<group>"; tabWidth = 3; };
2897F6FC0AB3DCD0003C20C5 /* Grabber.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = Grabber.cpp; sourceTree = "<group>"; tabWidth = 3; };
2897F6FD0AB3DCD0003C20C5 /* Grabber.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = Grabber.h; sourceTree = "<group>"; tabWidth = 3; };
289A864223E65A3E006A8CC5 /* Wrapper */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Wrapper; sourceTree = BUILT_PRODUCTS_DIR; };
289A864E23E65EAA006A8CC5 /* Wrapper.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Wrapper.c; path = mac/Wrapper.c; sourceTree = "<group>"; };
289D12771B44D57F00B5B6AA /* VSTControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VSTControl.h; path = VST/VSTControl.h; sourceTree = "<group>"; };
289D12781B44D57F00B5B6AA /* VSTControlOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VSTControlOSX.h; path = VST/VSTControlOSX.h; sourceTree = "<group>"; };
289D12791B44D57F00B5B6AA /* VSTControlOSX.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = VSTControlOSX.mm; path = VST/VSTControlOSX.mm; sourceTree = "<group>"; };
@ -4369,9 +4389,10 @@
isa = PBXGroup;
children = (
174F73C8098D516D009CD6E0 /* Resources */,
28006FFA132C167600BD34D7 /* Install.txt */,
178CF4FF0989541C0056CE58 /* configmac.h */,
174F73D7098D51AA009CD6E0 /* Info.plist */,
28006FFA132C167600BD34D7 /* Install.txt */,
289A864E23E65EAA006A8CC5 /* Wrapper.c */,
178CF4FF0989541C0056CE58 /* configmac.h */,
);
name = mac;
path = ..;
@ -4424,6 +4445,7 @@
28FADDEF1833C3C500BA4141 /* libexpat.a */,
65326E9E2253D2BE00844F28 /* libmp3lame.a */,
65326EA72253D68900844F28 /* libmpg123.a */,
289A864223E65A3E006A8CC5 /* Wrapper */,
);
name = Products;
sourceTree = "<group>";
@ -7638,6 +7660,7 @@
28032580131DB4960059D002 /* Copy plug-ins */,
28032560131DAFAF0059D002 /* Copy nyquist */,
28708D631B17C3C400496FEB /* Copy wxWidgets libs */,
289A865223E66456006A8CC5 /* Install wrapper */,
288F0980131A400F0008E860 /* Install manual */,
282413DA131D52CE009FD931 /* Install plugins */,
2892CE28131AFB1900E1E17D /* Install miscellany */,
@ -7648,6 +7671,7 @@
286D31370F264C38004E6E4A /* PBXBuildRule */,
);
dependencies = (
289A864D23E65E25006A8CC5 /* PBXTargetDependency */,
28D489291B5F061200A2E4DF /* PBXTargetDependency */,
285B11851833D0F10073B36C /* PBXTargetDependency */,
176EEC7109A2F54D00188F3B /* PBXTargetDependency */,
@ -7760,6 +7784,21 @@
productReference = 2880527E0DEA694100671EA4 /* mod-script-pipe.so */;
productType = "com.apple.product-type.library.dynamic";
};
289A864123E65A3E006A8CC5 /* Wrapper */ = {
isa = PBXNativeTarget;
buildConfigurationList = 289A864623E65A3F006A8CC5 /* Build configuration list for PBXNativeTarget "Wrapper" */;
buildPhases = (
289A863E23E65A3E006A8CC5 /* Sources */,
);
buildRules = (
);
dependencies = (
);
name = Wrapper;
productName = Wrapper;
productReference = 289A864223E65A3E006A8CC5 /* Wrapper */;
productType = "com.apple.product-type.tool";
};
28E236F40E515D1D00281398 /* libscorealign */ = {
isa = PBXNativeTarget;
buildConfigurationList = 28E237030E515D1D00281398 /* Build configuration list for PBXNativeTarget "libscorealign" */;
@ -7954,6 +7993,10 @@
2880527D0DEA694100671EA4 = {
ProvisioningStyle = Manual;
};
289A864123E65A3E006A8CC5 = {
CreatedOnToolsVersion = 10.3;
ProvisioningStyle = Manual;
};
28D489241B5F052C00A2E4DF = {
ProvisioningStyle = Manual;
};
@ -7999,6 +8042,7 @@
projectRoot = ..;
targets = (
1790AFAF09883B6D008A330A /* Audacity */,
289A864123E65A3E006A8CC5 /* Wrapper */,
28D489241B5F052C00A2E4DF /* Create Info Header */,
28FADDCA1833C3C500BA4141 /* expat */,
176EEBE909A2F16200188F3B /* libFLAC */,
@ -8078,7 +8122,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PROJECT_DIR}/scripts/copy_plugins.sh\"";
shellScript = "\"${PROJECT_DIR}/scripts/copy_plugins.sh\"\n";
};
282413D8131D51FC009FD931 /* Create dist */ = {
isa = PBXShellScriptBuildPhase;
@ -8106,7 +8150,7 @@
);
runOnlyForDeploymentPostprocessing = 1;
shellPath = /bin/sh;
shellScript = "\"${PROJECT_DIR}/scripts/install_ladspa_plugins.sh\"";
shellScript = "\"${PROJECT_DIR}/scripts/install_ladspa_plugins.sh\"\n";
};
28708D631B17C3C400496FEB /* Copy wxWidgets libs */ = {
isa = PBXShellScriptBuildPhase;
@ -8135,7 +8179,7 @@
);
runOnlyForDeploymentPostprocessing = 1;
shellPath = /bin/sh;
shellScript = "\"${PROJECT_DIR}/scripts/install_manual.sh\"";
shellScript = "\"${PROJECT_DIR}/scripts/install_manual.sh\"\n";
};
28AF137C23A832AC0084A82E /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
@ -8621,7 +8665,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2872DFEA1B5EEC15004385B1 /* hy.po in Sources */,
28C8211D1B5C661E00B53328 /* ViewInfo.cpp in Sources */,
1790B11A09883BFD008A330A /* AudacityApp.cpp in Sources */,
5E2B3E5C22BD9798005042E1 /* SelectUtilities.cpp in Sources */,
@ -8744,7 +8787,6 @@
1790B18809883BFD008A330A /* SpectrumPrefs.cpp in Sources */,
5EBD1C9422D11DAF00299FD4 /* SpectrumVZoomHandle.cpp in Sources */,
5E36A0B4217FC6540068E082 /* HelpMenus.cpp in Sources */,
5E36A0B2217FC5A10068E082 /* (null) in Sources */,
1790B18909883BFD008A330A /* Prefs.cpp in Sources */,
5E73963B1DAFD82D00BA0A4D /* PopupMenuTable.cpp in Sources */,
1790B18A09883BFD008A330A /* Printing.cpp in Sources */,
@ -9181,6 +9223,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
289A863E23E65A3E006A8CC5 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
289A865023E66001006A8CC5 /* Wrapper.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
28E236FB0E515D1D00281398 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@ -9403,6 +9453,11 @@
target = 2862299E181CE4B600E1AD1A /* lv2 */;
targetProxy = 28640879181CE78E00CC4E2C /* PBXContainerItemProxy */;
};
289A864D23E65E25006A8CC5 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 289A864123E65A3E006A8CC5 /* Wrapper */;
targetProxy = 289A864C23E65E25006A8CC5 /* PBXContainerItemProxy */;
};
28D489291B5F061200A2E4DF /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 28D489241B5F052C00A2E4DF /* Create Info Header */;
@ -9538,7 +9593,7 @@
INFOPLIST_PREFIX_HEADER = build/Info.plist.h;
INFOPLIST_PREPROCESS = YES;
KEEP_PRIVATE_EXTERNS = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.7;
ONLY_LINK_ESSENTIAL_SYMBOLS = YES;
ON_DEMAND_RESOURCES_INITIAL_INSTALL_TAGS = "";
OTHER_LDFLAGS = (
@ -9566,6 +9621,7 @@
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
ENABLE_HARDENED_RUNTIME = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_FOR_TARGET_1)",
"BUILDING_AUDACITY=1",
@ -9871,7 +9927,7 @@
INFOPLIST_PREFIX_HEADER = build/Info.plist.h;
INFOPLIST_PREPROCESS = YES;
KEEP_PRIVATE_EXTERNS = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.7;
ONLY_LINK_ESSENTIAL_SYMBOLS = YES;
ON_DEMAND_RESOURCES_INITIAL_INSTALL_TAGS = "";
OTHER_LDFLAGS = (
@ -9899,6 +9955,7 @@
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
ENABLE_HARDENED_RUNTIME = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(TOPLEVEL)/src/AudacityHeaders.h";
GCC_PREPROCESSOR_DEFINITIONS = (
@ -10181,6 +10238,42 @@
};
name = Release;
};
289A864723E65A3F006A8CC5 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ENABLE_HARDENED_RUNTIME = YES;
PRODUCT_NAME = Wrapper;
SKIP_INSTALL = YES;
};
name = Debug;
};
289A864823E65A3F006A8CC5 /* Debug64 */ = {
isa = XCBuildConfiguration;
buildSettings = {
ENABLE_HARDENED_RUNTIME = YES;
PRODUCT_NAME = Wrapper;
SKIP_INSTALL = YES;
};
name = Debug64;
};
289A864923E65A3F006A8CC5 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ENABLE_HARDENED_RUNTIME = YES;
PRODUCT_NAME = Wrapper;
SKIP_INSTALL = YES;
};
name = Release;
};
289A864A23E65A3F006A8CC5 /* Release64 */ = {
isa = XCBuildConfiguration;
buildSettings = {
ENABLE_HARDENED_RUNTIME = YES;
PRODUCT_NAME = Wrapper;
SKIP_INSTALL = YES;
};
name = Release64;
};
28D489261B5F052C00A2E4DF /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -10265,7 +10358,7 @@
INFOPLIST_PREFIX_HEADER = build/Info.plist.h;
INFOPLIST_PREPROCESS = YES;
KEEP_PRIVATE_EXTERNS = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.7;
ONLY_LINK_ESSENTIAL_SYMBOLS = YES;
ON_DEMAND_RESOURCES_INITIAL_INSTALL_TAGS = "";
OTHER_LDFLAGS = (
@ -10293,6 +10386,7 @@
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
ENABLE_HARDENED_RUNTIME = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_FOR_TARGET_1)",
"BUILDING_AUDACITY=1",
@ -10722,7 +10816,7 @@
INFOPLIST_PREFIX_HEADER = build/Info.plist.h;
INFOPLIST_PREPROCESS = YES;
KEEP_PRIVATE_EXTERNS = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.7;
ONLY_LINK_ESSENTIAL_SYMBOLS = YES;
ON_DEMAND_RESOURCES_INITIAL_INSTALL_TAGS = "";
OTHER_LDFLAGS = (
@ -10750,6 +10844,7 @@
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
ENABLE_HARDENED_RUNTIME = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(TOPLEVEL)/src/AudacityHeaders.h";
GCC_PREPROCESSOR_DEFINITIONS = (
@ -11588,6 +11683,17 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug64;
};
289A864623E65A3F006A8CC5 /* Build configuration list for PBXNativeTarget "Wrapper" */ = {
isa = XCConfigurationList;
buildConfigurations = (
289A864723E65A3F006A8CC5 /* Debug */,
289A864823E65A3F006A8CC5 /* Debug64 */,
289A864923E65A3F006A8CC5 /* Release */,
289A864A23E65A3F006A8CC5 /* Release64 */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug64;
};
28D489251B5F052C00A2E4DF /* Build configuration list for PBXLegacyTarget "Create Info Header" */ = {
isa = XCConfigurationList;
buildConfigurations = (

View File

@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildSystemType</key>
<string>Original</string>
<key>IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded</key>
<false/>
</dict>

50
mac/Wrapper.c Normal file
View File

@ -0,0 +1,50 @@
/**********************************************************************
Audacity: A Digital Audio Editor
Wrapper.c
Audacity(R) is copyright (c) 2020-2020 Audacity Team.
License: GPL v2. See License.txt.
*******************************************************************//**
\file
Give the user more control over where libraries such as 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 unset DYLD_LIBRARY_PATH variable and then invoke the main
executable.
*//*******************************************************************/
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
static const char audacity[] = "Audacity";
extern char **environ;
int main(int argc, char *argv[])
{
size_t len = strlen(argv[0]);
char *path = alloca(len + sizeof(audacity)); // not precise, but we don't need it to be
strcpy(path, argv[0]);
char *slash = strrchr(path, '/');
if (slash)
{
strcpy(++slash, audacity);
}
unsetenv("DYLD_LIBRARY_PATH");
execve(path, argv, environ);
}

View File

@ -133,10 +133,10 @@ then
--options runtime \
--entitlements "${SRCROOT}/${CODE_SIGN_ENTITLEMENTS}" \
--sign "${CODESIGN_APP_IDENTITY}" \
"${DSTROOT}/Audacity.app"
$(find ${DSTROOT}/Audacity.app -type f ! -path "*help*")
# Create the ZIP archive for notarization
xcrun ditto -c -k --keepParent "${DSTROOT}" "${DSTROOT}.zip"
xcrun ditto -c -k --keepParent "${DSTROOT}/Audacity.app" "${DSTROOT}.zip"
# Send it off for notarization
notarize "${DSTROOT}.zip"

View File

@ -1,5 +1,11 @@
#!/bin/sh
# Only want to run during a build
if [ -n "${ACTION}" -a "${ACTION}" != "build" ]
then
exit 0
fi
#
# Here we create empty xcconfig files if they do not exist. Otherwise,
# the build will fail.
@ -20,12 +26,12 @@ done
#
cd ${TOPLEVEL}
mkdir -p mac/build
eval $(g++ -E -dM src/Audacity.h | awk '/#define *AUDACITY_(VERSION|RELEASE|REVISION|MODLEVEL) /{print $2 "=" $3}')
eval $(g++ -Wno-deprecated -stdlib=libc++ -E -dM src/Audacity.h | awk '/#define *AUDACITY_(VERSION|RELEASE|REVISION|MODLEVEL) /{print $2 "=" $3}')
case $CONFIGURATION in
Debug|Debug64)
AUDACITY_EXECUTABLE=Audacity;;
AUDACITY_EXECUTABLE=Wrapper;;
*)
AUDACITY_EXECUTABLE=Audacity;;
AUDACITY_EXECUTABLE=Wrapper;;
esac
cat >mac/build/Info.plist.h <<EOF
#define AUDACITY_EXECUTABLE ${AUDACITY_EXECUTABLE}

View File

@ -774,43 +774,6 @@ IMPLEMENT_WX_THEME_SUPPORT
int main(int argc, char *argv[])
{
// Give the user more control over where libraries such as 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 move DYLD_LIBRARY_PATH values to the beginning of DYLD_FALLBACK_LIBRARY_PATH
// and clear DYLD_LIBRARY_PATH, allowing the users choice to be the first one tried.
extern char **environ;
char *dyld_library_path = getenv("DYLD_LIBRARY_PATH");
if (dyld_library_path)
{
size_t len = strlen(dyld_library_path);
if (len)
{
std::string fallback(dyld_library_path);
char *dyld_fallback_library_path = getenv("DYLD_FALLBACK_LIBRARY_PATH");
if (dyld_fallback_library_path)
{
size_t fallback_len = strlen(dyld_fallback_library_path);
if (fallback_len)
{
fallback.push_back(':');
fallback.append(dyld_fallback_library_path);
}
}
fallback.append(":/usr/local/lib:/usr/lib");
setenv("DYLD_FALLBACK_LIBRARY_PATH", &fallback.front(), 1);
unsetenv("DYLD_LIBRARY_PATH");
execve(argv[0], argv, environ);
}
}
wxDISABLE_DEBUG_SUPPORT();
return wxEntry(argc, argv);