Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ On Windows, please use the [prebuilt binaries](https://cmake.org/download/). Ens

On macOS, the easiest way to install CMake is `brew install cmake`.

On Linux, `cmake` is usually available from the system package manager.
On Linux, `cmake` is usually available from the system package manager. Alternatively, `sudo pip3 install cmake` can be used to install the latest version of CMake.

### Windows

We build Audacity using [Microsoft Visual Studio 2019](https://visualstudio.microsoft.com/vs/community/). In order to build Audacity **Desktop development with C++** workload is required.
We build Audacity using [Microsoft Visual Studio](https://visualstudio.microsoft.com/vs/community/) 2019 and 2022. In order to build Audacity **Desktop development with C++** workload is required.

As we require only C++17 - MSVC 2017 should work just fine too.

### MacOS
### macOS

We build Audacity using XCode 12. However, it is likely possible to build it with XCode 7.
We build Audacity using XCode versions 12 and 13. However, it is likely possible to build it with XCode 7.

### Linux

Expand Down Expand Up @@ -206,6 +206,32 @@ This option implies `-Daudacity_obey_system_dependencies=On` and disables `local
It is possible to force Conan to build all the dependencies from the source code without using the pre-built binaries. To do so, please pass `-Daudaicity_conan_allow_prebuilt_binaries=Off` to CMake during the configuration. This option will trigger rebuild every
time CMake configuration changes.

### Troubleshooting Conan issues

To fix errors, similar to the following:

```
ERROR: HTTPSConnectionPool(host='center.conan.io', port=443): Max retries exceeded with url: /v1/ping (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1131)
```

please, update your Conan version. Alternatively, the problem can be fixed using:

```
$ conan config install https://github.com/conan-io/conanclientcert.git
```

For errors like:

```
Unable to connect to conan-center=https://conan.bintray.com
```

please run

```
conan remote remove conan-center
```

### Reducing Conan cache size

In order to reduce the space used by Conan cache, please run:
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ include( AudacityFunctions )

set_from_env(AUDACITY_ARCH_LABEL) # e.g. x86_64

cmd_option( ${_OPT}bundle_gplv3
"Bundle GPLv3 license instead of GPLv2 with the resulting binary."
On)

# Allow user to globally set the library preference
cmd_option( ${_OPT}conan_enabled
"Use Conan package manager for 3d party dependencies"
Expand Down
1,023 changes: 1,012 additions & 11 deletions LICENSE.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions cmake-proxies/cmake-modules/AudacityInnoSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ if( INNO_SETUP_COMPILER )
-DWINDOWS_CERTIFICATE=${WINDOWS_CERTIFICATE}
-D WINDOWS_CERTIFICATE_PASSWORD=${WINDOWS_CERTIFICATE_PASSWORD}
-D CONFIG=$<CONFIG>
-D USE_GPL3=${${_OPT}bundle_gplv3}
-P "${CMAKE_SOURCE_DIR}/win/Inno_Setup_Wizard/BuildInnoSetupInstaller.cmake"
VERBATIM
)
Expand Down
2 changes: 1 addition & 1 deletion libraries/lib-audio-devices/DeviceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Created by Michael Chinen (mchinen) on 2/12/11
Audacity(R) is copyright (c) 1999-2011 Audacity Team.
License: GPL v2. See License.txt.
License: GPL v2 or later. See License.txt.

******************************************************************//**

Expand Down
41 changes: 26 additions & 15 deletions libraries/lib-ffmpeg-support/FFmpegFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ struct EnvSetter final
static const wxString VariableName;
static const wxString Separator;

EnvSetter()
explicit EnvSetter(bool fromUserPathOnly)
{
ValueExisted = wxGetEnv(VariableName, &OldValue);

wxString value;

for (const wxString& path : FFmpegFunctions::GetSearchPaths())
for (const wxString& path : FFmpegFunctions::GetSearchPaths(fromUserPathOnly))
{
if (!value.empty())
value += Separator;
Expand Down Expand Up @@ -148,7 +148,7 @@ struct FFmpegFunctions::Private final
AVCodecFactories CodecFactories;
AVUtilFactories UtilFactories;

std::shared_ptr<wxDynamicLibrary> LibraryWithSymbol(const char* symbol) const
std::shared_ptr<wxDynamicLibrary> LibraryWithSymbol(const char* symbol, bool fromUserPathOnly) const
{
if (AVFormatLibrary->HasSymbol(symbol))
return AVFormatLibrary;
Expand All @@ -163,21 +163,21 @@ struct FFmpegFunctions::Private final
if (path.empty())
return nullptr;

return LoadLibrary(wxFileNameFromPath(path));
return LoadLibrary(wxFileNameFromPath(path), fromUserPathOnly);
}

bool Load(FFmpegFunctions& functions, const wxString& path)
bool Load(FFmpegFunctions& functions, const wxString& path, bool fromUserPathOnly)
{
// We start by loading AVFormat
AVFormatLibrary = LoadLibrary(path);
AVFormatLibrary = LoadLibrary(path, fromUserPathOnly);

if (AVFormatLibrary == nullptr)
return false;

if ((AVCodecLibrary = LibraryWithSymbol("avcodec_version")) == nullptr)
if ((AVCodecLibrary = LibraryWithSymbol("avcodec_version", fromUserPathOnly)) == nullptr)
return false;

if ((AVUtilLibrary = LibraryWithSymbol("avutil_version")) == nullptr)
if ((AVUtilLibrary = LibraryWithSymbol("avutil_version", fromUserPathOnly)) == nullptr)
return false;

if (
Expand Down Expand Up @@ -218,12 +218,12 @@ struct FFmpegFunctions::Private final
return true;
}

std::shared_ptr<wxDynamicLibrary> LoadLibrary(const wxString& libraryName) const
std::shared_ptr<wxDynamicLibrary> LoadLibrary(const wxString& libraryName, bool fromUserPathOnly) const
{
#if defined(__WXMAC__)
// On macOS dyld reads environment only when application starts.
// Let's emulate the process manually
for(const wxString& path : FFmpegFunctions::GetSearchPaths())
for (const wxString& path : FFmpegFunctions::GetSearchPaths(fromUserPathOnly))
{
const wxString fullName = wxFileName(path, libraryName).GetFullPath();

Expand Down Expand Up @@ -259,7 +259,7 @@ FFmpegFunctions::~FFmpegFunctions()
{
}

std::shared_ptr<FFmpegFunctions> FFmpegFunctions::Load()
std::shared_ptr<FFmpegFunctions> FFmpegFunctions::Load(bool fromUserPathOnly)
{
static std::weak_ptr<FFmpegFunctions> weakFunctions;

Expand All @@ -275,14 +275,14 @@ std::shared_ptr<FFmpegFunctions> FFmpegFunctions::Load()
FFmpegAPIResolver::Get().GetSuportedAVFormatVersions();

#if !defined(__WXMAC__)
EnvSetter envSetter;
EnvSetter envSetter(fromUserPathOnly);
#endif

for (int version : supportedVersions)
{
for (const wxString& path : BuildAVFormatPaths(version))
{
if (ffmpeg->mPrivate->Load(*ffmpeg, path))
if (ffmpeg->mPrivate->Load(*ffmpeg, path, fromUserPathOnly))
{
weakFunctions = ffmpeg;
return ffmpeg;
Expand All @@ -295,14 +295,25 @@ std::shared_ptr<FFmpegFunctions> FFmpegFunctions::Load()

StringSetting AVFormatPath { L"/FFmpeg/FFmpegLibPath", L"" };

std::vector<wxString> FFmpegFunctions::GetSearchPaths()
std::vector<wxString> FFmpegFunctions::GetSearchPaths(bool fromUserPathOnly)
{
std::vector<wxString> paths;

const wxString userAVFormatFullPath = AVFormatPath.Read();

if (!userAVFormatFullPath.empty())
paths.emplace_back(wxPathOnly(userAVFormatFullPath));
{
// For some directories, wxPathOnly will fail.
// For example, if path is `c:\ffmpeg-4.4`
// wxPathOnly will return `c:\`
if (wxDirExists(userAVFormatFullPath))
paths.emplace_back(userAVFormatFullPath);
else
paths.emplace_back(wxPathOnly(userAVFormatFullPath));
}

if (fromUserPathOnly)
return paths;

#if defined(__WXMSW__)
wxRegKey reg(wxT("HKEY_LOCAL_MACHINE\\Software\\FFmpeg for Audacity"));
Expand Down
4 changes: 2 additions & 2 deletions libraries/lib-ffmpeg-support/FFmpegFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ struct FFMPEG_SUPPORT_API FFmpegFunctions :
FFmpegFunctions();
~FFmpegFunctions();

static std::shared_ptr<FFmpegFunctions> Load();
static std::shared_ptr<FFmpegFunctions> Load(bool fromUserPathOnly = false);

AVCodecIDFwd (*GetAVCodecID)(AudacityAVCodecID) = nullptr;
AudacityAVCodecID (*GetAudacityCodecID)(AVCodecIDFwd) = nullptr;

static std::vector<wxString> GetSearchPaths();
static std::vector<wxString> GetSearchPaths(bool fromUserPathOnly);

std::unique_ptr<AVIOContextWrapper> CreateAVIOContext() const;
std::unique_ptr<AVFormatContextWrapper> CreateAVFormatContext() const;
Expand Down
2 changes: 1 addition & 1 deletion libraries/lib-math/Resample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Audacity: A Digital Audio Editor
Audacity(R) is copyright (c) 1999-2012 Audacity Team.
License: GPL v2. See License.txt.
License: GPL v2 or later. See License.txt.

Resample.cpp
Dominic Mazzoni, Rob Sykes, Vaughan Johnson
Expand Down
2 changes: 1 addition & 1 deletion libraries/lib-math/Resample.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Audacity: A Digital Audio Editor
Audacity(R) is copyright (c) 1999-2012 Audacity Team.
License: GPL v2. See License.txt.
License: GPL v2 or later. See License.txt.

Resample.cpp
Dominic Mazzoni, Rob Sykes, Vaughan Johnson
Expand Down
2 changes: 1 addition & 1 deletion libraries/lib-theme/AllThemeResources.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
James Crook

Audacity is free software.
License: GPL v2 - see LICENSE.txt
License: GPL v2 or later - see LICENSE.txt

********************************************************************//**

Expand Down
2 changes: 1 addition & 1 deletion mac/Wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Wrapper.c

Audacity(R) is copyright (c) 2020-2020 Audacity Team.
License: GPL v2. See License.txt.
License: GPL v2 or later. See License.txt.

*******************************************************************//**

Expand Down
Loading