Merge pull request #239194 from getchoo/flite-pulse

This commit is contained in:
Sandro
2023-07-24 17:37:49 +02:00
committed by GitHub
+14 -3
View File
@@ -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;
};
}