about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/flite
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/flite')
-rw-r--r--nixpkgs/pkgs/development/libraries/flite/default.nix17
1 files changed, 14 insertions, 3 deletions
diff --git a/nixpkgs/pkgs/development/libraries/flite/default.nix b/nixpkgs/pkgs/development/libraries/flite/default.nix
index f4eac39919f2..59ab572762ee 100644
--- a/nixpkgs/pkgs/development/libraries/flite/default.nix
+++ b/nixpkgs/pkgs/development/libraries/flite/default.nix
@@ -1,4 +1,13 @@
-{ lib, stdenv, fetchFromGitHub, alsa-lib, fetchpatch }:
+{ lib
+, stdenv
+, fetchFromGitHub
+, alsa-lib
+, fetchpatch
+, libpulseaudio
+, audioBackend ? "pulseaudio"
+}:
+
+assert lib.assertOneOf "audioBackend" audioBackend [ "alsa" "pulseaudio" ];
 
 stdenv.mkDerivation rec {
   pname = "flite";
@@ -11,7 +20,8 @@ stdenv.mkDerivation rec {
     sha256 = "1n0p81jzndzc1rzgm66kw9ls189ricy5v1ps11y0p2fk1p56kbjf";
   };
 
-  buildInputs = lib.optionals stdenv.isLinux [ alsa-lib ];
+  buildInputs = lib.optional (stdenv.isLinux && audioBackend == "alsa") alsa-lib
+    ++ lib.optional (stdenv.isLinux && audioBackend == "pulseaudio") libpulseaudio;
 
   # https://github.com/festvox/flite/pull/60.
   # Replaces `ar` with `$(AR)` in config/common_make_rules.
@@ -25,7 +35,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [
     "--enable-shared"
-  ] ++ lib.optionals stdenv.isLinux [ "--with-audio=alsa" ];
+  ] ++ lib.optionals stdenv.isLinux [ "--with-audio=${audioBackend}" ];
 
   # main/Makefile creates and removes 'flite_voice_list.c' from multiple targets:
   # make[1]: *** No rule to make target 'flite_voice_list.c', needed by 'all'.  Stop
@@ -35,6 +45,7 @@ stdenv.mkDerivation rec {
     description = "A small, fast run-time speech synthesis engine";
     homepage = "http://www.festvox.org/flite/";
     license = licenses.bsdOriginal;
+    maintainers = with maintainers; [ getchoo ];
     platforms = platforms.all;
   };
 }