2022-01-13 20:06:32 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, substituteAll
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchurl
|
|
|
|
, python3Packages
|
|
|
|
, gettext
|
|
|
|
, itstool
|
|
|
|
, libtool
|
|
|
|
, texinfo
|
2020-11-24 20:58:05 +00:00
|
|
|
, util-linux
|
2020-04-24 23:36:52 +00:00
|
|
|
, autoreconfHook
|
|
|
|
, glib
|
|
|
|
, dotconf
|
|
|
|
, libsndfile
|
|
|
|
, withLibao ? true, libao
|
|
|
|
, withPulse ? false, libpulseaudio
|
2021-06-28 23:13:55 +00:00
|
|
|
, withAlsa ? false, alsa-lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, withOss ? false
|
|
|
|
, withFlite ? true, flite
|
|
|
|
, withEspeak ? true, espeak, sonic, pcaudiolib
|
2022-01-13 20:06:32 +00:00
|
|
|
, mbrola
|
2020-04-24 23:36:52 +00:00
|
|
|
, withPico ? true, svox
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (python3Packages) python pyxdg wrapPython;
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "speech-dispatcher";
|
2022-09-09 14:08:57 +00:00
|
|
|
version = "0.11.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/brailcom/speechd/releases/download/${version}/${pname}-${version}.tar.gz";
|
2022-09-09 14:08:57 +00:00
|
|
|
sha256 = "sha256-i0ZJkl5oy+GntMCge7BBznc4s1yQamAr+CmG2xqg82Q=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./fix-paths.patch;
|
2020-11-24 20:58:05 +00:00
|
|
|
utillinux = util-linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|
2022-12-17 10:02:37 +00:00
|
|
|
] ++ lib.optionals (withEspeak && espeak.mbrolaSupport) [
|
2022-01-13 20:06:32 +00:00
|
|
|
# Replace FHS paths.
|
|
|
|
(substituteAll {
|
|
|
|
src = ./fix-mbrola-paths.patch;
|
|
|
|
inherit espeak mbrola;
|
2021-05-20 23:08:51 +00:00
|
|
|
})
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
autoreconfHook
|
|
|
|
gettext
|
|
|
|
libtool
|
|
|
|
itstool
|
|
|
|
texinfo
|
|
|
|
wrapPython
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
glib
|
|
|
|
dotconf
|
|
|
|
libsndfile
|
|
|
|
libao
|
|
|
|
libpulseaudio
|
2021-06-28 23:13:55 +00:00
|
|
|
alsa-lib
|
2020-04-24 23:36:52 +00:00
|
|
|
python
|
2022-01-13 20:06:32 +00:00
|
|
|
] ++ lib.optionals withEspeak [
|
2020-04-24 23:36:52 +00:00
|
|
|
espeak
|
|
|
|
sonic
|
|
|
|
pcaudiolib
|
2022-10-30 15:09:59 +00:00
|
|
|
] ++ lib.optionals withFlite [
|
2022-01-13 20:06:32 +00:00
|
|
|
flite
|
2022-10-30 15:09:59 +00:00
|
|
|
] ++ lib.optionals withPico [
|
2022-01-13 20:06:32 +00:00
|
|
|
svox
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
pythonPath = [
|
|
|
|
pyxdg
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
# Audio method falls back from left to right.
|
|
|
|
"--with-default-audio-method=\"libao,pulse,alsa,oss\""
|
2021-02-05 17:12:51 +00:00
|
|
|
"--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
|
2022-10-30 15:09:59 +00:00
|
|
|
] ++ lib.optionals withPulse [
|
2022-01-13 20:06:32 +00:00
|
|
|
"--with-pulse"
|
2022-10-30 15:09:59 +00:00
|
|
|
] ++ lib.optionals withAlsa [
|
2022-01-13 20:06:32 +00:00
|
|
|
"--with-alsa"
|
2022-10-30 15:09:59 +00:00
|
|
|
] ++ lib.optionals withLibao [
|
2022-01-13 20:06:32 +00:00
|
|
|
"--with-libao"
|
2022-10-30 15:09:59 +00:00
|
|
|
] ++ lib.optionals withOss [
|
2022-01-13 20:06:32 +00:00
|
|
|
"--with-oss"
|
2022-10-30 15:09:59 +00:00
|
|
|
] ++ lib.optionals withEspeak [
|
2022-01-13 20:06:32 +00:00
|
|
|
"--with-espeak-ng"
|
2022-10-30 15:09:59 +00:00
|
|
|
] ++ lib.optionals withPico [
|
2022-01-13 20:06:32 +00:00
|
|
|
"--with-pico"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/modules/pico.c --replace "/usr/share/pico/lang" "${svox}/share/pico/lang"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapPythonPrograms
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Common interface to speech synthesis";
|
|
|
|
homepage = "https://devel.freebsoft.org/speechd";
|
|
|
|
license = licenses.gpl2Plus;
|
2022-01-13 20:06:32 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
berce
|
|
|
|
jtojnar
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|