Skip to content
Will Stott edited this page Nov 1, 2019 · 41 revisions

Rust

Rust 1.30.0 or later is required to build librespot.
Please install rust using rustup

If you are building librespot on macOS, the homebrew provided rust may fail due to the way in which homebrew installs rust. In this case, uninstall the homebrew version of rust and use rustup, and librespot should then build.

A kernel version of 3.9 or higher is required, for versions below this please see here.

Dependencies

Default backend - Rodio

Rodio is a high-level audio library built on top of CPAL. It is the default as it does not require any non-rust dependencies on windows or MacOS, and is able to use the native audio engines.

Portaudio backend

Building requires a C compiler, with portaudio.

On debian / ubuntu, the following command will install these dependencies :

sudo apt install build-essential portaudio19-dev

On Fedora systems, the following command will install these dependencies :

sudo dnf install portaudio-devel make gcc

On macOS, using homebrew :

brew install portaudio

Alsa backend

Additionally requires pkg-config and alsa libs to be installed.

On debian / ubuntu, the following command will install these dependencies :

apt install libasound2-dev pkg-config

Build

Once you've cloned this repository you can build librespot using cargo.

cargo build --release

Addition features

The default for librespot is to build with rodio-backend, and to use lewton as the decoder (pure rust build with only cargo dependencies).

Flag Feature
rodio-backend Support for WASAPI, CoreAudio and alsa via Rodio.
alsa-backend Support for alsa.
portaudio-backend Support for PortAudio.
pulseaudio-backend Support for PulseAudio.
jackaudio-backend Support for JACK.
sdl-backend Support for SDL2.
with-tremor A fixed point Vorbis decoder.
with-vorbis Rust libvorbis bindings.
with-dns-sd Uses dns-sd instead of the default mDNS for LAN discovery.
Clone this wiki locally