2021-01-25 08:26:54 +00:00
|
|
|
{ lib, fetchFromGitHub, rustPlatform, pkg-config, openssl, withRodio ? true
|
2021-06-10 02:57:09 +00:00
|
|
|
, withALSA ? true, alsa-lib ? null, withPulseAudio ? false, libpulseaudio ? null
|
2020-07-29 07:30:48 +00:00
|
|
|
, withPortAudio ? false, portaudio ? null }:
|
2020-06-18 12:27:37 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "librespot";
|
2021-05-02 12:26:40 +00:00
|
|
|
version = "0.1.6";
|
2020-06-18 12:27:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "librespot-org";
|
|
|
|
repo = "librespot";
|
|
|
|
rev = "v${version}";
|
2021-05-02 12:26:40 +00:00
|
|
|
sha256 = "153i9n3qwmmwc29f62cz8nbqrlry16iygvibm1sdnvpf0s6wk5f3";
|
2020-06-18 12:27:37 +00:00
|
|
|
};
|
|
|
|
|
2020-07-29 07:30:48 +00:00
|
|
|
cargoPatches = [ ./cargo-lock.patch ];
|
2021-05-02 12:26:40 +00:00
|
|
|
cargoSha256 = "11d64rpq4b5rdxk5wx0hhzgc6mvs6h2br0w3kfncfklp67vn3v4v";
|
2020-06-18 12:27:37 +00:00
|
|
|
|
2021-01-15 13:21:58 +00:00
|
|
|
cargoBuildFlags = with lib; [
|
2020-06-18 12:27:37 +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-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-06-18 12:27:37 +00:00
|
|
|
|
2021-06-10 02:57:09 +00: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 12:27:37 +00:00
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-06-18 12:27:37 +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;
|
|
|
|
};
|
|
|
|
}
|