2021-01-25 08:26:54 +00:00
|
|
|
{ lib, fetchFromGitHub, rustPlatform, pkg-config, openssl, withRodio ? true
|
2020-07-29 08:30:48 +01:00
|
|
|
, withALSA ? true, alsaLib ? null, withPulseAudio ? false, libpulseaudio ? null
|
|
|
|
, withPortAudio ? false, portaudio ? null }:
|
2020-06-18 13:27:37 +01:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "librespot";
|
2020-07-29 08:30:48 +01:00
|
|
|
version = "0.1.3";
|
2020-06-18 13:27:37 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "librespot-org";
|
|
|
|
repo = "librespot";
|
|
|
|
rev = "v${version}";
|
2020-07-29 08:30:48 +01:00
|
|
|
sha256 = "1ixh47yvaamrpzagqsiimc3y6bi4nbym95843d23am55zkrgnmy5";
|
2020-06-18 13:27:37 +01:00
|
|
|
};
|
|
|
|
|
2020-07-29 08:30:48 +01:00
|
|
|
cargoSha256 = "1csls8kzzx28ng6w9vdwhnnav5sqp2m5fj430db5z306xh5acg3d";
|
|
|
|
|
|
|
|
cargoPatches = [ ./cargo-lock.patch ];
|
2020-06-18 13:27:37 +01:00
|
|
|
|
2021-01-15 13:21:58 +00:00
|
|
|
cargoBuildFlags = with lib; [
|
2020-06-18 13:27:37 +01: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 13:27:37 +01:00
|
|
|
|
2021-01-15 13:21:58 +00:00
|
|
|
buildInputs = [ openssl ] ++ lib.optional withALSA alsaLib
|
|
|
|
++ lib.optional withPulseAudio libpulseaudio
|
|
|
|
++ lib.optional withPortAudio portaudio;
|
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;
|
|
|
|
};
|
|
|
|
}
|