about summary refs log tree commit diff
path: root/pkgs/applications/audio/librespot
diff options
context:
space:
mode:
authorhacker1024 <hacker1024@users.sourceforge.net>2023-09-22 15:04:56 +1000
committerhacker1024 <hacker1024@users.sourceforge.net>2023-09-22 15:04:56 +1000
commitd80a9f0e211f443fc276b733da50f5906f280389 (patch)
tree6a13910c96eb745780e07cd4812f39cfc9639c0d /pkgs/applications/audio/librespot
parentc1b3bfba4f2993d8d789cc86b0cae13db75862c0 (diff)
librespot: Set ALSA_PLUGIN_DIR
Diffstat (limited to 'pkgs/applications/audio/librespot')
-rw-r--r--pkgs/applications/audio/librespot/default.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkgs/applications/audio/librespot/default.nix b/pkgs/applications/audio/librespot/default.nix
index f477b811d70f5..df7bfab74b94a 100644
--- a/pkgs/applications/audio/librespot/default.nix
+++ b/pkgs/applications/audio/librespot/default.nix
@@ -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";