1{
2 config,
3 lib,
4 stdenv,
5 fetchFromGitHub,
6 alsa-lib,
7 autoconf,
8 automake,
9 libpulseaudio,
10 libtool,
11 pkg-config,
12 portaudio,
13 which,
14 pulseaudioSupport ? config.pulseaudio or stdenv.hostPlatform.isLinux,
15}:
16
17stdenv.mkDerivation (finalAttrs: {
18 pname = "pcaudiolib";
19 version = "1.3";
20
21 src = fetchFromGitHub {
22 owner = "espeak-ng";
23 repo = "pcaudiolib";
24 rev = finalAttrs.version;
25 hash = "sha256-bBiGvAySEwAv6Qj2iSawb9oZfMCGBDCDIP8AYdbtQQc=";
26 };
27
28 nativeBuildInputs = [
29 autoconf
30 automake
31 libtool
32 pkg-config
33 which
34 ];
35
36 buildInputs = [
37 portaudio
38 ]
39 ++ lib.optional stdenv.hostPlatform.isLinux alsa-lib
40 ++ lib.optional pulseaudioSupport libpulseaudio;
41
42 # touch ChangeLog to avoid below error on darwin:
43 # Makefile.am: error: required file './ChangeLog.md' not found
44 preConfigure =
45 lib.optionalString stdenv.hostPlatform.isDarwin ''
46 touch ChangeLog
47 ''
48 + ''
49 ./autogen.sh
50 '';
51
52 meta = with lib; {
53 homepage = "https://github.com/espeak-ng/pcaudiolib";
54 description = "Provides a C API to different audio devices";
55 license = licenses.gpl3Plus;
56 maintainers = with maintainers; [ aske ];
57 platforms = platforms.unix;
58 };
59})