nixpkgs/pkgs/development/libraries/speechd/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

121 lines
2.4 KiB
Nix
Raw Normal View History

{ stdenv
, lib
, substituteAll
, pkg-config
2020-01-30 18:02:04 +00:00
, fetchurl
, python3Packages
, 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
, 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
, withPico ? true, svox
}:
2017-12-20 22:52:42 +00:00
let
inherit (python3Packages) python pyxdg wrapPython;
in stdenv.mkDerivation rec {
pname = "speech-dispatcher";
2023-08-09 22:36:59 +00:00
version = "0.11.5";
src = fetchurl {
url = "https://github.com/brailcom/speechd/releases/download/${version}/${pname}-${version}.tar.gz";
2023-08-09 22:36:59 +00:00
sha256 = "sha256-HOR1n/q7rxrrQzpewHOb4Gdum9+66URKezvhsq8+wSs=";
};
patches = [
(substituteAll {
src = ./fix-paths.patch;
2020-11-24 15:29:28 +00:00
utillinux = util-linux;
})
] ++ lib.optionals (withEspeak && espeak.mbrolaSupport) [
2022-01-08 21:07:05 +00:00
# Replace FHS paths.
(substituteAll {
src = ./fix-mbrola-paths.patch;
inherit espeak mbrola;
})
];
2020-01-30 18:02:04 +00:00
nativeBuildInputs = [
pkg-config
2020-01-30 18:02:04 +00:00
autoreconfHook
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
alsa-lib
2020-01-30 18:02:04 +00:00
python
] ++ lib.optionals withEspeak [
2020-01-30 18:02:04 +00:00
espeak
sonic
pcaudiolib
] ++ lib.optionals withFlite [
flite
] ++ lib.optionals withPico [
svox
];
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\""
"--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
] ++ lib.optionals withPulse [
"--with-pulse"
] ++ lib.optionals withAlsa [
"--with-alsa"
] ++ lib.optionals withLibao [
"--with-libao"
] ++ lib.optionals withOss [
"--with-oss"
] ++ lib.optionals withEspeak [
"--with-espeak-ng"
] ++ lib.optionals withPico [
"--with-pico"
];
2017-12-20 22:52:42 +00:00
postPatch = ''
substituteInPlace src/modules/pico.c --replace "/usr/share/pico/lang" "${svox}/share/pico/lang"
'';
postInstall = ''
wrapPythonPrograms
'';
enableParallelBuilding = true;
meta = with lib; {
description = "Common interface to speech synthesis";
2020-01-30 18:02:04 +00:00
homepage = "https://devel.freebsoft.org/speechd";
license = licenses.gpl2Plus;
maintainers = with maintainers; [
berce
jtojnar
];
platforms = platforms.linux;
};
}