
How to compile Sonic Visualiser from source
===========================================

(NOTE: Refer also to .github/workflows/linux.yml and .appveyor.yml to
see how the continuous-integration processes run a build)

From Sonic Visualiser v4.3 on, the Meson build system is used (see
https://mesonbuild.com).

On Windows and Mac it is easier to build from a repository clone (be
sure to checkout the appropriate tag if you need a specific release)
than it is to build from an official Sonic Visualiser source
package. This is because the repository build process will pull in
some required library builds before building, while the source package
contains only Sonic Visualiser code.

On Linux it's simpler to build from the official source package.


Windows
-------

The build is for 64-bit Windows and uses Visual Studio 2019 tools (but
run from a command prompt). It requires a repo checkout, not just the
source package - otherwise getting all the dependencies together is a
bit of a nightmare. Even from a checkout, the build is still a little
painful with plenty of potential points of failure.

 * Install the Meson and Ninja build tools (https://mesonbuild.com)
 * Install SML/NJ (https://smlnj.org) for use by Repoint
 * Install Qt open source edition (https://qt.io)
 * Edit the file `deploy\win64\build-64.bat` and adjust the QTDIR setting
   to match the location of your Qt install
 * Run `deploy\win64\build-64.bat` in a command prompt
 

MacOS
-----

Install Qt5, either via Homebrew or from the official installer.

If building from a repository checkout, install Poly/ML via Homebrew
(`brew install polyml`) and run `./repoint install` before proceeding.

Then run `meson build` and `ninja -C build`.


Linux
-----

If building from a repository checkout, install MLton from your
package manager and run `./repoint install` before proceeding.

Then run `meson build`, `ninja -C build`, and `meson install`.

The following additional libraries are required:

        Qt v5                   http://www.qt.io/
        Rubber Band Library     http://www.breakfastquay.com/rubberband/
        libsndfile              http://www.mega-nerd.com/libsndfile/
        libsamplerate           http://www.mega-nerd.com/SRC/
        FFTW3                   http://www.fftw.org/
        bzip2 library           http://www.bzip.org/
        Sord and Serd libraries http://drobilla.net/software/
        Cap'n Proto             http://capnproto.org/
        MAD mp3 decoder         http://www.underbit.com/products/mad/
        Oggz and fishsound      http://xiph.org/oggz/
        Opus                    http://www.opus-codec.org/
        liblo OSC library       http://www.plugin.org.uk/liblo/
        JACK                    http://www.jackaudio.org/
        PulseAudio              http://www.pulseaudio.org/
        PortAudio v19           http://www.portaudio.com/

You will also need the ALSA libraries (used for MIDI).

For Cap'n Proto you will need v0.6 or newer.

If you happen to be using a Debian-based Linux, you probably want to
apt install something like the following packages:

build-essential libbz2-dev libfftw3-dev libfishsound1-dev libid3tag0-dev liblo-dev liblrdf0-dev libmad0-dev liboggz2-dev libopus-dev libopusfile-dev libpulse-dev libsamplerate-dev libsndfile-dev libsord-dev libxml2-utils portaudio19-dev qt5-default libqt5svg5-dev raptor2-utils librubberband-dev capnproto libcapnp-dev git mercurial autoconf automake libtool mlton meson ninja-build

