Commit 48068224 authored by Damien Cassou's avatar Damien Cassou Committed by Anderson Torres
Browse files

alsa-utils: make `aplay` find pipewire's ALSA library



Co-authored-by: default avatarSandro <sandro.jaeckel@gmail.com>
parent f6e4992c
Loading
Loading
Loading
Loading
+30 −1
Original line number Diff line number Diff line
{lib, stdenv, fetchurl, fetchpatch, alsa-lib, gettext, makeWrapper, ncurses, libsamplerate, pciutils, which, fftw}:
{ lib
, stdenv
, fetchurl
, fetchpatch
, alsa-lib
, alsa-plugins
, gettext
, makeWrapper
, ncurses
, libsamplerate
, pciutils
, which
, fftw
, pipewire
, withPipewireLib ? true
, symlinkJoin
}:

let
  plugin-packages = [ alsa-plugins ] ++ lib.optional withPipewireLib pipewire.lib;

  # Create a directory containing symlinks of all ALSA plugins.
  # This is necessary because ALSA_PLUGIN_DIR must reference only one directory.
  plugin-dir = symlinkJoin {
    name = "all-plugins";
    paths = map
      (path: "${path}/lib/alsa-lib")
      plugin-packages;
  };
in
stdenv.mkDerivation rec {
  pname = "alsa-utils";
  version = "1.2.10";
@@ -30,6 +58,7 @@ stdenv.mkDerivation rec {
  postFixup = ''
    mv $out/bin/alsa-info.sh $out/bin/alsa-info
    wrapProgram $out/bin/alsa-info --prefix PATH : "${lib.makeBinPath [ which pciutils ]}"
    wrapProgram $out/bin/aplay --set-default ALSA_PLUGIN_DIR ${plugin-dir}
  '';

  meta = with lib; {