Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c1756dd
Adds lib-network-manager
crsib Apr 9, 2021
ea9bb00
Adds lib-string-utils
crsib Apr 16, 2021
2dfae48
Adds lib-uuid
crsib Apr 16, 2021
5938ee7
Adds lib-timer
crsib Apr 20, 2021
4b403a6
Adds lib-telemetry with GA back-end
crsib Apr 20, 2021
e420e0f
lib-telemetry is intgrated. Only sessions reporting
crsib Apr 20, 2021
7b7565d
ReportEvent renamed to ReportBuiltinEvent, as Windows has a ReportEve…
crsib Apr 22, 2021
85cd79b
Support reporting for the built in events
crsib Apr 22, 2021
2c14a12
Adds a telemetry permission dialog
crsib Apr 23, 2021
5563b06
Adds preference page about the app analytics
crsib Apr 23, 2021
18dc655
Adds implementation for the YandexMetrica
crsib Apr 23, 2021
dc7c736
Fixes XCode 12.5 build
crsib May 1, 2021
d54cf6f
Updates the privacy policy URL
crsib May 4, 2021
df67a7a
Allow reading telemetry configuration from the GH secrets
crsib May 4, 2021
0af77de
Attempt to fix macOS workflow
crsib May 4, 2021
6a8065a
Really truly fix CURL build
crsib May 4, 2021
ba83cb1
Report SQL errors to the telemetry
crsib May 4, 2021
5f54e4d
Report MessageBox exceptions to the telemetry
crsib May 4, 2021
434fa25
Fixes workflow for Ubuntu
crsib May 4, 2021
cb91c67
Fixes Ubuntu build for PR
crsib May 4, 2021
4d0eaab
Fixes a crash if UserTrackingService was not set
crsib May 4, 2021
ac88a4f
Updates the information about the libraries used
crsib May 4, 2021
0f608d1
Adds doxygen documentation for the newly added files
crsib May 5, 2021
07ca990
Fix for incorrect flag being used to detect if TelemetryDialog was shown
crsib May 5, 2021
fefeb2a
Change the default value for the Telemetry preference
crsib May 5, 2021
28f8016
Force legacy build system on xcode builds
crsib May 5, 2021
111ae79
Force legacy build system on xcode builds
crsib May 5, 2021
d477605
Fixes a typo in DataStreamSeek
crsib May 6, 2021
c9264d2
Yet another DataStreamSeek fix
crsib May 6, 2021
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
9 changes: 6 additions & 3 deletions .github/workflows/cmake_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ env:
# it has a bug in the install_name_tool. So explicitly use 12.3
# instead.
DEVELOPER_DIR: /Applications/Xcode_12.3.app/Contents/Developer
GOOGLE_UA_TRACKING_ID: ${{ secrets.GOOGLE_UA_TRACKING_ID }}
METRICA_TRACKING_ID: ${{ secrets.METRICA_TRACKING_ID }}

#
# Define our job(s)
Expand Down Expand Up @@ -214,7 +216,7 @@ jobs:
--with-libjpeg=builtin \
--with-libpng=builtin \
--with-libtiff=builtin \
--with-macosx-version-min="10.7" \
--with-macosx-version-min="10.9" \
--with-regex=builtin \
--with-zlib=builtin \
--without-liblzma
Expand All @@ -234,6 +236,7 @@ jobs:
cmake -S . \
-B build \
-G "${{matrix.config.generator}}" \
-T buildsystem=1 \
-D audacity_use_pch=no

# Build Audacity
Expand Down Expand Up @@ -261,7 +264,7 @@ jobs:

# Install required packages
sudo apt-get update -y
sudo apt-get install -y libgtk2.0-dev libasound2-dev gettext
sudo apt-get install -y libgtk2.0-dev libasound2-dev gettext uuid-dev
sudo apt-get remove -y ccache

# Build wxWidgets if needed
Expand Down Expand Up @@ -293,7 +296,7 @@ jobs:
-D audacity_use_pch=no

# Build Audacity
cmake --build build --config Release
cmake --build build --config Release -- -j$(nproc)

# "Install" Audacity
cmake --install build --config Release --prefix "${DEST}"
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,5 @@ win/xaudacity.ico
#other files that get in the way
*/not-for-git/*
*.dll

.idea/
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if( APPLE )

# Define the OSX compatibility parameters
set( CMAKE_OSX_ARCHITECTURES x86_64 CACHE INTERNAL "" )
set( CMAKE_OSX_DEPLOYMENT_TARGET 10.7 CACHE INTERNAL "" )
set( CMAKE_OSX_DEPLOYMENT_TARGET 10.9 CACHE INTERNAL "" )
set( CMAKE_OSX_SYSROOT macosx CACHE INTERNAL "" )
set( CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "" CACHE INTERNAL "" )

Expand Down Expand Up @@ -427,6 +427,7 @@ add_subdirectory( "cmake-proxies" )
add_subdirectory( "help" )
add_subdirectory( "images" )
add_subdirectory( "locale" )
add_subdirectory( "libraries" )
add_subdirectory( "modules" )
add_subdirectory( "nyquist" )
add_subdirectory( "plug-ins" )
Expand Down
9 changes: 9 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ our web site at:

https://www.audacityteam.org/download/source

The Audacity source code is located in all the locations within the source tree
except for lib-src.

Audacity is built upon other free libraries; some of these libraries may have
come with Audacity in the lib-src directory. Others you are expected to install
first if you want Audacity to have certain capabilities. Most of these libraries
Expand Down Expand Up @@ -210,6 +213,12 @@ GPL-compatible license. Specifically:
wxWidgets: wxWindows license (based on LGPL)
Cross-platform GUI library - must be downloaded and
compiled separately.

libcurl: MIT/X like license
Cross-platform library for transferring data with URLs.

ThreadPool: zlib License
C++11 thread pool.


For more information, see the documentation inside each library's
Expand Down
3 changes: 2 additions & 1 deletion audacity.dox.in
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,8 @@ WARN_LOGFILE =
INPUT = src/ \
dox2-src/ \
include/ \
lib-src/FileDialog/
lib-src/FileDialog/ \
libraries/

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down
1 change: 1 addition & 0 deletions cmake-proxies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ addlib( libsndfile sndfile SNDFILE YES YES "sndfile >= 1.0.2
addlib( libsoxr soxr SOXR YES YES "soxr >= 0.1.1" )
addlib( portaudio-v19 portaudio PORTAUDIO YES YES "" )
addlib( sqlite sqlite SQLITE YES YES "sqlite3 >= 3.32.0" )
addlib( libcurl curl CURL YES YES "libcurl >= 7.76.0" )

# Optional libraries
#
Expand Down
27 changes: 24 additions & 3 deletions cmake-proxies/cmake-modules/CopyLibs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ function( execute )
set( ${outlist} ${cmd_out} PARENT_SCOPE )
endfunction()

get_filename_component(SRC_DIR ${SRC} DIRECTORY)

function( gather_libs src )
if( CMAKE_HOST_SYSTEM_NAME MATCHES "Windows" )
execute( output cmd /k dumpbin /dependents ${src} )
Expand All @@ -45,6 +47,14 @@ function( gather_libs src )
list( APPEND libs ${lib} )

gather_libs( ${lib} )
elseif (line MATCHES "^ *libcurl.*\\.dll")
set( lib ${CURL_PATH}/${line} )

list( APPEND libs ${lib} )

gather_libs( ${lib} )
elseif (line MATCHES "^ *lib-.*\\.dll")
gather_libs( "${SRC_DIR}/${line}" )
endif()
endforeach()
elseif( CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin" )
Expand All @@ -59,7 +69,18 @@ function( gather_libs src )
endif()

foreach( line ${output} )
if( line MATCHES "^.*libwx.*\\.dylib " )
if( line MATCHES "@rpath/libcurl.*\\.dylib ")
message(STATUS "Matched ${line}")

string( REGEX REPLACE "dylib .*" "dylib" line "${line}" )

get_filename_component( refname "${line}" NAME )

set (lib "${CURL_PATH}/${refname}")
list( APPEND libs ${lib} )

list( APPEND postcmds "sh -c 'install_name_tool -change @rpath/${refname} @executable_path/../Frameworks/${refname} ${libname}'" )
elseif( line MATCHES "^.*(libwx|lib-).*\\.dylib " )
string( REGEX REPLACE "dylib .*" "dylib" line "${line}" )
if( NOT line STREQUAL "${src}" AND NOT line MATCHES "@executable" )
set( lib ${line} )
Expand All @@ -74,12 +95,12 @@ function( gather_libs src )
endif()
endforeach()
elseif( CMAKE_HOST_SYSTEM_NAME MATCHES "Linux" )
execute( output sh -c "LD_LIBRARY_PATH='${WXWIN}' ldd ${src}" )
execute( output sh -c "LD_LIBRARY_PATH='${WXWIN}:${CURL_PATH}' ldd ${src}" )

get_filename_component( libname "${src}" NAME )

foreach( line ${output} )
if( line MATCHES ".*libwx.*" )
if( line MATCHES ".*lib(wx|lib-).*" )

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

liblib-foo?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Over 9000!

string( REGEX REPLACE ".* => (.*) \\(.*$" "\\1" line "${line}" )

set( lib ${line} )
Expand Down
82 changes: 82 additions & 0 deletions cmake-proxies/libcurl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
include(ExternalProject)

def_vars()

set( CURL_DIR "${_INTDIR}/libcurl" )
set( CURL_TAG "curl-7_76_0")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean you will now create a release of audacity whenever curl has another CVE? Have you considered the security implications that you open the door for in this scenario?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vendoring curl?! Of all dependencies? 😱

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the original curl release is used, why not simply take the one installed on the system?


set(CURL_CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:STRING=${CURL_DIR}
-DHTTP_ONLY:BOOL=On
-DBUILD_CURL_EXE:BOOL=Off
-DCMAKE_USE_LIBSSH2:BOOL=Off
)

if( CMAKE_SYSTEM_NAME MATCHES "Windows" )
set(CURL_CMAKE_ARGS ${CURL_CMAKE_ARGS}
-DCMAKE_USE_SCHANNEL:BOOL=On
)
elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
set(CURL_CMAKE_ARGS ${CURL_CMAKE_ARGS}
-DCMAKE_USE_SECTRANSP:BOOL=On
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.9
-DCMAKE_OSX_ARCHITECTURES:STRING=x86_64
)
elseif( CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD" )

endif()

ExternalProject_Add(curl

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work on some Linux distributions as it downloads sources during build (build systems do not allow internet connection during build).

Apart from that, this suffers from the same issue as the custom wxwidgets fork: Including custom sources where in reality you should build against a system provided version of the library

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, my. This story gets weirder the deeper one crawls.

  • Some days ago, "Muse Group buys Audacity" -> 😕
  • a few days - nothing happens -> 😰
  • fefe blogs about this PR -> 😱
  • It's about "embedding" G**gle -> 😠
  • You start digging and find friends already all over it -> 😩
  • They dig out stuff like THIS -> 😡 🤯 💥 🍖 🍤 🦴

I am very, very disappointed, Muse Group. And sad. Very sad, too.


In other recognition, thanks @dvzrv for pointing it out! It's pretty telling of the whole thing, I'd say....

@Be-ing Be-ing May 7, 2021

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be fair, Audacity had a problematic practice of vendoring dependencies long before Muse Group got invovled.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A NixOS package maintainer here: side effects like downloading sources during build are problematic indeed for many build systems. I'd kindly ask you to reconsider this, otherwise several distributions need to patch this downstream.

PREFIX "${CURL_DIR}"
INSTALL_DIR "${CURL_DIR}"
GIT_REPOSITORY https://github.com/curl/curl
GIT_TAG ${CURL_TAG}
GIT_SHALLOW Yes
CMAKE_CACHE_ARGS ${CURL_CMAKE_ARGS}
)

add_library(AUDACITY::libcurl SHARED IMPORTED GLOBAL)

file(MAKE_DIRECTORY "${CURL_DIR}/include")

set_target_properties(AUDACITY::libcurl PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${CURL_DIR}/include"
)

if (WIN32)
set_target_properties(AUDACITY::libcurl PROPERTIES
INTERFACE_LINK_LIBRARIES "winmm;ws2_32;advapi32;crypt32"
)

set_property(TARGET AUDACITY::libcurl APPEND PROPERTY IMPORTED_CONFIGURATIONS "Debug;Release")

set_target_properties(AUDACITY::libcurl PROPERTIES
IMPORTED_IMPLIB_DEBUG "${CURL_DIR}/lib/libcurl-d_imp.lib"
IMPORTED_LOCATION_DEBUG "${CURL_DIR}/bin/libcurl-d.dll"

IMPORTED_IMPLIB_RELEASE "${CURL_DIR}/lib/libcurl_imp.lib"
IMPORTED_LOCATION_RELEASE "${CURL_DIR}/bin/libcurl.dll"
)
elseif(APPLE)
if(XCODE)
set_property(TARGET AUDACITY::libcurl APPEND PROPERTY IMPORTED_CONFIGURATIONS "Debug;Release")

set_target_properties(AUDACITY::libcurl PROPERTIES
IMPORTED_LOCATION_RELEASE "${CURL_DIR}/lib/libcurl.dylib"
IMPORTED_LOCATION_DEBUG "${CURL_DIR}/lib/libcurl-d.dylib"
)
else()
set_property(TARGET AUDACITY::libcurl APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)

set_target_properties(AUDACITY::libcurl PROPERTIES
IMPORTED_LOCATION_NOCONFIG "${CURL_DIR}/lib/libcurl.dylib"
)
endif()
elseif(UNIX)
set_property(TARGET AUDACITY::libcurl APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)

set_target_properties(AUDACITY::libcurl PROPERTIES
IMPORTED_LOCATION_NOCONFIG "${CURL_DIR}/lib/libcurl.so"
IMPORTED_SONAME_NOCONFIG "libcurl.so"
)
endif()
13 changes: 13 additions & 0 deletions images/Telemetry/TelemetryEmojii.h

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions lib-src/ThreadPool/COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2012 Jakob Progsch, Václav Zeman

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.

3. This notice may not be removed or altered from any source
distribution.
17 changes: 17 additions & 0 deletions lib-src/ThreadPool/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ThreadPool
==========

A simple C++11 Thread Pool implementation.

Basic usage:
```c++
// create thread pool with 4 worker threads
ThreadPool pool(4);

// enqueue and store future
auto result = pool.enqueue([](int answer) { return answer; }, 42);

// get result from future
std::cout << result.get() << std::endl;

```
98 changes: 98 additions & 0 deletions lib-src/ThreadPool/ThreadPool.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#ifndef THREAD_POOL_H
#define THREAD_POOL_H

#include <vector>
#include <queue>
#include <memory>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <future>
#include <functional>
#include <stdexcept>

class ThreadPool {
public:
ThreadPool(size_t);
template<class F, class... Args>
auto enqueue(F&& f, Args&&... args)
-> std::future<typename std::result_of<F(Args...)>::type>;
~ThreadPool();
private:
// need to keep track of threads so we can join them
std::vector< std::thread > workers;
// the task queue
std::queue< std::function<void()> > tasks;

// synchronization
std::mutex queue_mutex;
std::condition_variable condition;
bool stop;
};

// the constructor just launches some amount of workers
inline ThreadPool::ThreadPool(size_t threads)
: stop(false)
{
for(size_t i = 0;i<threads;++i)
workers.emplace_back(
[this]
{
for(;;)
{
std::function<void()> task;

{
std::unique_lock<std::mutex> lock(this->queue_mutex);
this->condition.wait(lock,
[this]{ return this->stop || !this->tasks.empty(); });
if(this->stop && this->tasks.empty())
return;
task = std::move(this->tasks.front());
this->tasks.pop();
}

task();
}
}
);
}

// add new work item to the pool
template<class F, class... Args>
auto ThreadPool::enqueue(F&& f, Args&&... args)
-> std::future<typename std::result_of<F(Args...)>::type>
{
using return_type = typename std::result_of<F(Args...)>::type;

auto task = std::make_shared< std::packaged_task<return_type()> >(
std::bind(std::forward<F>(f), std::forward<Args>(args)...)
);

std::future<return_type> res = task->get_future();
{
std::unique_lock<std::mutex> lock(queue_mutex);

// don't allow enqueueing after stopping the pool
if(stop)
throw std::runtime_error("enqueue on stopped ThreadPool");

tasks.emplace([task](){ (*task)(); });
}
condition.notify_one();
return res;
}

// the destructor joins all threads
inline ThreadPool::~ThreadPool()
{
{
std::unique_lock<std::mutex> lock(queue_mutex);
stop = true;
}
condition.notify_all();
for(std::thread &worker: workers)
worker.join();
}

#endif
Loading