librespot: Set ALSA_PLUGIN_DIR

This commit is contained in:
hacker1024 2023-09-22 15:04:56 +10:00
parent c1b3bfba4f
commit d80a9f0e21

View File

@ -1,11 +1,13 @@
{ lib
, rustPlatform
, fetchFromGitHub
, makeWrapper
, pkg-config
, stdenv
, openssl
, withALSA ? true
, alsa-lib
, alsa-plugins
, withPortAudio ? false
, portaudio
, withPulseAudio ? false
@ -26,7 +28,7 @@ rustPlatform.buildRustPackage rec {
cargoSha256 = "sha256-tbDlWP0sUIa0W9HhdYNOvo9cGeqFemclhA7quh7f/Rw=";
nativeBuildInputs = [ pkg-config ] ++ lib.optionals stdenv.isDarwin [
nativeBuildInputs = [ pkg-config makeWrapper ] ++ lib.optionals stdenv.isDarwin [
rustPlatform.bindgenHook
];
@ -41,6 +43,11 @@ rustPlatform.buildRustPackage rec {
++ lib.optional withPortAudio "portaudio-backend"
++ lib.optional withPulseAudio "pulseaudio-backend";
postFixup = lib.optionalString withALSA ''
wrapProgram "$out/bin/librespot" \
--set ALSA_PLUGIN_DIR '${alsa-plugins}/lib/alsa-lib'
'';
meta = with lib; {
description = "Open Source Spotify client library and playback daemon";
homepage = "https://github.com/librespot-org/librespot";