16 , withLibao ? true, libao
17 , withPulse ? false, libpulseaudio
18 , withAlsa ? false, alsa-lib
20 , withFlite ? true, flite
21 , withEspeak ? true, espeak, sonic, pcaudiolib
23 , withPico ? true, svox
27 inherit (python3Packages) python pyxdg wrapPython;
28 in stdenv.mkDerivation rec {
29 pname = "speech-dispatcher";
33 url = "https://github.com/brailcom/speechd/releases/download/${version}/${pname}-${version}.tar.gz";
34 sha256 = "sha256-i0ZJkl5oy+GntMCge7BBznc4s1yQamAr+CmG2xqg82Q=";
39 src = ./fix-paths.patch;
40 utillinux = util-linux;
42 ] ++ lib.optionals espeak.mbrolaSupport [
45 src = ./fix-mbrola-paths.patch;
46 inherit espeak mbrola;
68 ] ++ lib.optionals withEspeak [
72 ] ++ lib.optionals withFlite [
74 ] ++ lib.optionals withPico [
83 # Audio method falls back from left to right.
84 "--with-default-audio-method=\"libao,pulse,alsa,oss\""
85 "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
86 ] ++ lib.optionals withPulse [
88 ] ++ lib.optionals withAlsa [
90 ] ++ lib.optionals withLibao [
92 ] ++ lib.optionals withOss [
94 ] ++ lib.optionals withEspeak [
96 ] ++ lib.optionals withPico [
101 substituteInPlace src/modules/pico.c --replace "/usr/share/pico/lang" "${svox}/share/pico/lang"
108 enableParallelBuilding = true;
111 description = "Common interface to speech synthesis";
112 homepage = "https://devel.freebsoft.org/speechd";
113 license = licenses.gpl2Plus;
114 maintainers = with maintainers; [
118 platforms = platforms.linux;