Merge pull request #256622 from hacker1024/fix/librespot-alsa-plugins

librespot: Set ALSA_PLUGIN_DIR
This commit is contained in:
Weijia Wang 2023-09-22 18:43:20 +02:00 committed by GitHub
commit 7d697156a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,11 +1,13 @@
{ lib
, rustPlatform
, fetchFromGitHub
, makeWrapper
, pkg-config
, stdenv
, openssl
, withALSA ? true
, withALSA ? stdenv.isLinux
, 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";