9 withALSA ? stdenv.hostPlatform.isLinux,
12 withPortAudio ? false,
14 withPulseAudio ? false,
19 rustPlatform.buildRustPackage rec {
23 src = fetchFromGitHub {
24 owner = "librespot-org";
27 sha256 = "sha256-dGQDRb7fgIkXelZKa+PdodIs9DxbgEMlVGJjK/hU3Mo=";
30 cargoHash = "sha256-GScAUqALoocqvsHz4XgPytI8cl0hiuWjqaO/ItNo4v4=";
37 ++ lib.optionals stdenv.hostPlatform.isDarwin [
38 rustPlatform.bindgenHook
43 ++ lib.optional withALSA alsa-lib
44 ++ lib.optional withPortAudio portaudio
45 ++ lib.optional withPulseAudio libpulseaudio;
47 buildNoDefaultFeatures = true;
49 lib.optional withRodio "rodio-backend"
50 ++ lib.optional withALSA "alsa-backend"
51 ++ lib.optional withPortAudio "portaudio-backend"
52 ++ lib.optional withPulseAudio "pulseaudio-backend";
54 postFixup = lib.optionalString withALSA ''
55 wrapProgram "$out/bin/librespot" \
56 --set ALSA_PLUGIN_DIR '${alsa-plugins}/lib/alsa-lib'
60 description = "Open Source Spotify client library and playback daemon";
61 mainProgram = "librespot";
62 homepage = "https://github.com/librespot-org/librespot";
63 changelog = "https://github.com/librespot-org/librespot/blob/v${version}/CHANGELOG.md";
64 license = with licenses; [ mit ];
65 maintainers = with maintainers; [ bennofs ];