2023-08-10 07:59:29 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, alsa-lib
|
|
|
|
, fetchpatch
|
|
|
|
, libpulseaudio
|
|
|
|
, audioBackend ? "pulseaudio"
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert lib.assertOneOf "audioBackend" audioBackend [ "alsa" "pulseaudio" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-12-29 15:07:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "flite";
|
|
|
|
version = "2.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-12-29 15:07:52 +00:00
|
|
|
owner = "festvox";
|
|
|
|
repo = "flite";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1n0p81jzndzc1rzgm66kw9ls189ricy5v1ps11y0p2fk1p56kbjf";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
buildInputs = lib.optional (stdenv.isLinux && audioBackend == "alsa") alsa-lib
|
|
|
|
++ lib.optional (stdenv.isLinux && audioBackend == "pulseaudio") libpulseaudio;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
# https://github.com/festvox/flite/pull/60.
|
|
|
|
# Replaces `ar` with `$(AR)` in config/common_make_rules.
|
|
|
|
# Improves cross-compilation compatibility.
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/festvox/flite/commit/54c65164840777326bbb83517568e38a128122ef.patch";
|
|
|
|
sha256 = "sha256-hvKzdX7adiqd9D+9DbnfNdqEULg1Hhqe1xElYxNM1B8=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--enable-shared"
|
2023-08-10 07:59:29 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [ "--with-audio=${audioBackend}" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
# 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
|
|
|
|
enableParallelBuilding = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Small, fast run-time speech synthesis engine";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://www.festvox.org/flite/";
|
2020-12-29 15:07:52 +00:00
|
|
|
license = licenses.bsdOriginal;
|
2023-08-10 07:59:29 +00:00
|
|
|
maintainers = with maintainers; [ getchoo ];
|
2020-12-29 15:07:52 +00:00
|
|
|
platforms = platforms.all;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|