1{ stdenv, lib, fetchFromGitHub, autoreconfHook, pkg-config, libpulseaudio, alsa-lib, libcap
2, CoreAudio, CoreServices, AudioUnit
3, usePulseAudio }:
4
5stdenv.mkDerivation rec {
6 version = "1.2.2";
7 pname = "libao";
8
9 # the github mirror is more up to date than downloads.xiph.org
10 src = fetchFromGitHub {
11 owner = "xiph";
12 repo = "libao";
13 rev = version;
14 sha256 = "0svgk4sc9kdhcsfyvbvgm5vpbg3sfr6z5rliflrw49v3x2i4vxq5";
15 };
16
17 configureFlags = [
18 "--disable-broken-oss"
19 "--enable-alsa-mmap"
20 ];
21
22 outputs = [ "out" "dev" "man" "doc" ];
23
24 buildInputs = [ ] ++
25 lib.optional usePulseAudio libpulseaudio ++
26 lib.optionals stdenv.isLinux [ alsa-lib libcap ] ++
27 lib.optionals stdenv.isDarwin [ CoreAudio CoreServices AudioUnit ];
28
29 nativeBuildInputs = [ autoreconfHook pkg-config ];
30
31 meta = with lib; {
32 longDescription = ''
33 Libao is Xiph.org's cross-platform audio library that allows
34 programs to output audio using a simple API on a wide variety of
35 platforms.
36 '';
37 homepage = "https://xiph.org/ao/";
38 license = licenses.gpl2;
39 maintainers = with maintainers; [ ];
40 platforms = with platforms; unix;
41 };
42}