2021-02-05 17:12:51 +00:00
|
|
|
{ lib, fetchFromGitHub, rustPlatform, pkg-config, openssl, withRodio ? true
|
2021-06-28 23:13:55 +00:00
|
|
|
, withALSA ? true, alsa-lib ? null, withPulseAudio ? false, libpulseaudio ? null
|
2020-08-20 17:08:02 +00:00
|
|
|
, withPortAudio ? false, portaudio ? null }:
|
2020-06-15 15:56:04 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "librespot";
|
2021-05-03 20:48:10 +00:00
|
|
|
version = "0.1.6";
|
2020-06-15 15:56:04 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "librespot-org";
|
|
|
|
repo = "librespot";
|
|
|
|
rev = "v${version}";
|
2021-05-03 20:48:10 +00:00
|
|
|
sha256 = "153i9n3qwmmwc29f62cz8nbqrlry16iygvibm1sdnvpf0s6wk5f3";
|
2020-06-15 15:56:04 +00:00
|
|
|
};
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
cargoPatches = [ ./cargo-lock.patch ];
|
2021-05-03 20:48:10 +00:00
|
|
|
cargoSha256 = "11d64rpq4b5rdxk5wx0hhzgc6mvs6h2br0w3kfncfklp67vn3v4v";
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
cargoBuildFlags = with lib; [
|
2020-06-15 15:56:04 +00:00
|
|
|
"--no-default-features"
|
|
|
|
"--features"
|
|
|
|
(concatStringsSep "," (filter (x: x != "") [
|
|
|
|
(optionalString withRodio "rodio-backend")
|
|
|
|
(optionalString withALSA "alsa-backend")
|
|
|
|
(optionalString withPulseAudio "pulseaudio-backend")
|
|
|
|
(optionalString withPortAudio "portaudio-backend")
|
|
|
|
|
|
|
|
]))
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
buildInputs = [ openssl ] ++ lib.optional withALSA alsa-lib
|
2021-01-17 00:15:33 +00:00
|
|
|
++ lib.optional withPulseAudio libpulseaudio
|
|
|
|
++ lib.optional withPortAudio portaudio;
|
2020-06-15 15:56:04 +00:00
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-06-15 15:56:04 +00: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;
|
|
|
|
};
|
|
|
|
}
|