1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-20 17:41:13 +02:00

First stab at notarization

The distribution will be signed and notarized during an "install" build
and is handled by mac/scripts/build_dist.sh.

The wrapper scripts, mac/Audacity.sh, is no longer needed as it's function
has been integrated into AudacityApp.cpp/main().

Initially, all "hardened entitlements" have been enabled since we don't
know which ones plug-ins will need.

On Mac and Windows, system sleep will be disabled when recording starts
and re-enabled when it ends.
This commit is contained in:
Leland Lucius
2019-12-13 23:43:01 -06:00
parent b53b5e54fe
commit 5fe89c6498
9 changed files with 371 additions and 84 deletions

View File

@@ -769,6 +769,43 @@ 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);

View File

@@ -16,6 +16,10 @@ Paul Licameli split from ProjectManager.cpp
#include <wx/frame.h>
#include <wx/statusbr.h>
#if defined(__WXMAC__) || defined(__WXMSW__)
#include <wx/power.h>
#endif
#include "AudioIO.h"
#include "AutoRecovery.h"
#include "CommonCommandFlags.h"
@@ -806,6 +810,11 @@ void ProjectAudioManager::OnAudioIORate(int rate)
void ProjectAudioManager::OnAudioIOStartRecording()
{
#if defined(__WXMAC__) || defined(__WXMSW__)
// Don't want the system to sleep while recording
wxPowerResource::Acquire(wxPOWER_RESOURCE_SCREEN, _("Audacity recording"));
#endif
auto &projectFileIO = ProjectFileIO::Get( mProject );
// Before recording is started, auto-save the file. The file will have
// empty tracks at the bottom where the recording will be put into
@@ -815,6 +824,11 @@ void ProjectAudioManager::OnAudioIOStartRecording()
// This is called after recording has stopped and all tracks have flushed.
void ProjectAudioManager::OnAudioIOStopRecording()
{
#if defined(__WXMAC__) || defined(__WXMSW__)
// Done recording, so allow sleeping again
wxPowerResource::Release(wxPOWER_RESOURCE_SCREEN);
#endif
auto &project = mProject;
auto &dirManager = DirManager::Get( project );
auto &projectAudioIO = ProjectAudioIO::Get( project );