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