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-01-13 20:06:32 +00:00
|
|
|
version = "0.11.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/brailcom/speechd/releases/download/${version}/${pname}-${version}.tar.gz";
|
2022-01-13 20:06:32 +00:00
|
|
|
sha256 = "sha256-0doS7T2shPE3mbai7Dm6LTyiGoST9E3BhVvQupbC3cY=";
|
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-01-13 20:06:32 +00:00
|
|
|
] ++ lib.optionals espeak.mbrolaSupport [
|
|
|
|
# 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-01-13 20:06:32 +00:00
|
|
|
] ++ lib.optional withFlite [
|
|
|
|
flite
|
|
|
|
] ++ lib.optional withPico [
|
|
|
|
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-01-13 20:06:32 +00:00
|
|
|
] ++ lib.optional withPulse [
|
|
|
|
"--with-pulse"
|
|
|
|
] ++ lib.optional withAlsa [
|
|
|
|
"--with-alsa"
|
|
|
|
] ++ lib.optional withLibao [
|
|
|
|
"--with-libao"
|
|
|
|
] ++ lib.optional withOss [
|
|
|
|
"--with-oss"
|
|
|
|
] ++ lib.optional withEspeak [
|
|
|
|
"--with-espeak-ng"
|
|
|
|
] ++ lib.optional withPico [
|
|
|
|
"--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;
|
|
|
|
};
|
|
|
|
}
|