2021-01-25 08:26:54 +00:00
|
|
|
{ lib, fetchFromGitHub, rustPlatform, pkg-config, openssl, withRodio ? true
|
2021-06-10 03:57:09 +01:00
|
|
|
, withALSA ? true, alsa-lib ? null, withPulseAudio ? false, libpulseaudio ? null
|
2020-07-29 08:30:48 +01:00
|
|
|
, withPortAudio ? false, portaudio ? null }:
|
2020-06-18 13:27:37 +01:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "librespot";
|
2021-10-25 15:39:38 +01:00
|
|
|
version = "0.3.1";
|
2020-06-18 13:27:37 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "librespot-org";
|
|
|
|
repo = "librespot";
|
|
|
|
rev = "v${version}";
|
2021-10-25 15:39:38 +01:00
|
|
|
sha256 = "1fv2sk89rf1vraq823bxddlxj6b4gqhfpc36xr7ibz2405zickfv";
|
2020-06-18 13:27:37 +01:00
|
|
|
};
|
|
|
|
|
2021-10-25 15:39:38 +01:00
|
|
|
cargoSha256 = "1sal85gsbnrabxi39298w9njdc08csnwl40akd6k9fsc0fmpn1b0";
|
2020-06-18 13:27:37 +01:00
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-06-18 13:27:37 +01:00
|
|
|
|
2021-06-10 03:57:09 +01:00
|
|
|
buildInputs = [ openssl ] ++ lib.optional withALSA alsa-lib
|
2021-01-15 13:21:58 +00:00
|
|
|
++ lib.optional withPulseAudio libpulseaudio
|
|
|
|
++ lib.optional withPortAudio portaudio;
|
2020-06-18 13:27:37 +01:00
|
|
|
|
2021-11-16 00:06:51 +00:00
|
|
|
buildNoDefaultFeatures = true;
|
|
|
|
buildFeatures = lib.optional withRodio "rodio-backend"
|
|
|
|
++ lib.optional withALSA "alsa-backend"
|
|
|
|
++ lib.optional withPulseAudio "pulseaudio-backend"
|
|
|
|
++ lib.optional withPortAudio "portaudio-backend";
|
|
|
|
|
2020-06-18 13:27:37 +01:00
|
|
|
doCheck = false;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-06-18 13:27:37 +01:00
|
|
|
description = "Open Source Spotify client library and playback daemon";
|
|
|
|
homepage = "https://github.com/librespot-org/librespot";
|
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ bennofs ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|