Building Audacity 2.3.3 on Debian / Ubuntu

These instructions have been tested on the current Debian Stable.
I think they should also work with Ubuntu 16.04 or later. In the event of problems, please start a new topic.

Instructions for Building on Linux

Note that for Audacity 2.3.3, “Mod Script Pipe” should be considered to be
a standard part of an Audacity release, rather than as an optional extra.
FFmpeg support should also be enabled if available in the distribution.

Note that only the current release version of the manual is available on-line. It is
therefore highly recommended to fetch the correct version of the manual and install it
on the local machine to ensure that the correct version of the manual is availabel for the
end user. See notes below for details.


Prerequisites:

  1. Repository sources (sources.list) must include source code sources.
  2. For MP3 / FFmpeg support, “non-free” repositories may need to be enabled.
  3. Root access is required for installation (usually via “sudo”).

Required dependencies:
(The package names below are those used by Debian based distributions.)

For Debian / Ubuntu based distributions, these packages may be installed from the
command line with:

sudo apt install <package-name>

build-essential (g++, gcc, libc6-dev, libc-dev, make)
cmake
gcc 4.9 or later (gcc-7 recommended for Debian / Ubuntu)
libsndfile1
libasound2-dev
libgtk2.0-dev
gettext
libid3tag0-dev
libmad0-dev
libsoundtouch-dev
libogg-dev
libvorbis-dev
libflac-dev
libmp3lame0

WxWidgets 3.0 or 3.1 (see note below)

For FFmpeg support (see note below):
libavformat-dev

For Jack Audio System (see note below):
jackd2
libjack-jackd2-dev


Recommended for developers:
git
autoconf
automake
pkg-config
patch
diff-tools
gdb


WxWidgets:
Audacity requires wxWidgets 3.0 or 3.1.
Wxwidgets 3.1.1 source code is available from: https://github.com/audacity/wxWidgets

For Debian / Ubuntu based distributions, the required wxWidgets packages may all be
pulled in with apt at the command line:

sudo apt install libwxgtk3.0

FFmpeg:
The FFmpeg headers included in the Audacity source are rather old. Audacity may be built
with a more recent version if libavformat-dev is installed on the system (recommended),
but dynamic loading must be disabled (see configuration options below).


Jack Audio System:
Audacity can work with either jackd or jackd2.
Unless your Linux distribution runs Jack as the default sound system, it is recommended
to install QJackCtl to provide a convenient way to manage Jack.
End users are advised to read up on Jack if they wish to install it.


Getting the Audacity source code:

The latest release version of Audacity is available from:
https://www.fosshub.com/Audacity.html
This is the recommended version for end users.

For developers, the current development code is available from Github.
Cloning the repository is recommended so that the source tree may easily be kept up to date.
https://github.com/audacity/audacity


Building Audacity:

After cloning or extracting the downloaded source code, open a terminal window and navigate
to the root of the source folder (the folder that contains the ‘README.md’ file).

Create a build folder and navigate into it

mkdir build
cd build

Configure the build:
For a comprehensive list of configure options, run

../configure -h

To configure with all standard release features enabled:

../configure --with-lib-preference="local system" --with-ffmpeg="system" --disable-dynamic-loading --with-mod-script-pipe

Note that additional steps are required for building and installing Mod Script Pipe (see below).


Enabling FFmpeg (included in the “standard” options above):
Most Linux distributions provide a newer version of FFmpeg than is supported by Audacity’s
dynamic loading. For FFmpeg support it is therefore necessary to disable dynamic loading:

../configure --with-lib-preference="local system" --with-ffmpeg="system" --disable-dynamic-loading

Assuming that configure completes without error, you can now build Audacity:

make

If your processor has multiple cores, you may use the -j switch, set to the number of
available cores. This will considerably speed up the build time.
For example, with an 8 core CPU:

make -j8

Building Mod Script Pipe:

Mod Script Pipe provides an API for external scripting languages such as Python, to communicate with Audacity.
Mod Script Pipe may be used with any scripting language that supports named pipes. For more information,
see: https://manual.audacityteam.org/man/scripting.html

IMPORTANT: Modules for Audacity must be built on the same day as Audacity is built.
Audacity must be built with the --with-mod-script-pipe option.

After building Audacity, navigate to the build/lib-src/mod-script-pipe directory:

cd lib-src/mod-script-pipe

Then build Mod Script Pipe (the “-j” switch is available for multi-core CPUs):

make

Fetching the manual:

The Audacity manual is html, and is identical for Windows, Mac and Linux.
For release versions of Audacity, the manual may be downloaded as a ZIP archive from:
Current version: https://www.fosshub.com/Audacity.html
Old versions: https://www.fosshub.com/Audacity-old.html


Pre-installation test:

Create a local folder for Audacity’s settings. This folder will be only used for testing and will
not be installed.

mkdir "Portable Settings"

Then launch Audacity

./audacity

Installing Audacity:

To install the main application, from the build directory:

sudo make install

To install Mod Script Pipe:
Assuming that Audacity has been installed to /usr/local/ (default)

sudo mkdir /usr/local/share/audacity/modules
sudo cp lib-src/mod-script-pipe/.libs/mod-script-pipe.so /usr/local/share/audacity/modules/mod-script-pipe.so
sudo cp lib-src/mod-script-pipe/.libs/mod-script-pipe.so.0.0.0 /usr/local/share/audacity/modules/mod-script-pipe.so.0.0.0

The module will now be available for enabling in Preferences (https://manual.audacityteam.org/man/modules_preferences.html)

Note that it is also possible to install Mod Script Pipe for a single user by copying these two files to:

~/.audacity-files/modules

To install the manual:
Assuming that Audacity has been installed to /usr/local/ (default).
From the directory constaining the manual ZIP archive:

sudo unzip audacity-manual-2.3.3.zip -d /usr/local/share/audacity/help