speechd: 0.8.5 -> 0.8.8, refactored
This commit is contained in:
parent
e0a356d1c7
commit
857a71cbc5
@ -1,29 +1,70 @@
|
|||||||
{ fetchurl, lib, stdenv, intltool, libtool, pkgconfig, glib, dotconf, libsndfile
|
{ stdenv, pkgconfig, fetchurl, python3Packages
|
||||||
, libao, python3Packages
|
, intltool, itstool, libtool, texinfo, autoreconfHook
|
||||||
, withEspeak ? false, espeak
|
, glib, dotconf, libsndfile
|
||||||
|
, withLibao ? true, libao
|
||||||
|
, withPulse ? false, libpulseaudio
|
||||||
|
, withAlsa ? false, alsaLib
|
||||||
|
, withOss ? false
|
||||||
|
, withFlite ? true, flite
|
||||||
|
# , withFestival ? false, festival-freebsoft-utils
|
||||||
|
, withEspeak ? true, espeak, sonic, pcaudiolib
|
||||||
, withPico ? true, svox
|
, withPico ? true, svox
|
||||||
|
# , withIvona ? false, libdumbtts
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
let
|
||||||
|
inherit (stdenv.lib) optional optionals;
|
||||||
|
inherit (python3Packages) python pyxdg wrapPython;
|
||||||
|
|
||||||
|
# speechd hard-codes espeak, even when built without support for it.
|
||||||
|
selectedDefaultModule =
|
||||||
|
if withEspeak then
|
||||||
|
"espeak-ng"
|
||||||
|
else if withPico then
|
||||||
|
"pico"
|
||||||
|
else if withFlite then
|
||||||
|
"flite"
|
||||||
|
else
|
||||||
|
throw "You need to enable at least one output module.";
|
||||||
|
in stdenv.mkDerivation rec {
|
||||||
name = "speech-dispatcher-${version}";
|
name = "speech-dispatcher-${version}";
|
||||||
version = "0.8.5";
|
version = "0.8.8";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "http://www.freebsoft.org/pub/projects/speechd/${name}.tar.gz";
|
url = "http://www.freebsoft.org/pub/projects/speechd/${name}.tar.gz";
|
||||||
sha256 = "18jlxnhlahyi6njc6l6576hfvmzivjjgfjyd2n7vvrvx9inphjrb";
|
sha256 = "1wvck00w9ixildaq6hlhnf6wa576y02ac96lp6932h3k1n08jaiw";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ intltool libtool glib dotconf libsndfile libao python3Packages.python ]
|
nativeBuildInputs = [ pkgconfig autoreconfHook intltool libtool itstool texinfo wrapPython ];
|
||||||
++ lib.optional withEspeak espeak
|
|
||||||
++ lib.optional withPico svox;
|
|
||||||
nativeBuildInputs = [ pkgconfig python3Packages.wrapPython ];
|
|
||||||
|
|
||||||
hardeningDisable = [ "format" ];
|
buildInputs = [ glib dotconf libsndfile libao libpulseaudio alsaLib python ]
|
||||||
|
++ optionals withEspeak [ espeak sonic pcaudiolib ]
|
||||||
|
++ optional withFlite flite
|
||||||
|
++ optional withPico svox
|
||||||
|
# TODO: add flint/festival support with festival-freebsoft-utils package
|
||||||
|
# ++ optional withFestival festival-freebsoft-utils
|
||||||
|
# TODO: add Ivona support with libdumbtts package
|
||||||
|
# ++ optional withIvona libdumbtts
|
||||||
|
;
|
||||||
|
|
||||||
pythonPath = with python3Packages; [ pyxdg ];
|
pythonPath = [ pyxdg ];
|
||||||
|
|
||||||
postPatch = lib.optionalString withPico ''
|
configureFlags = [
|
||||||
sed -i 's,/usr/share/pico/lang/,${svox}/share/pico/lang/,g' src/modules/pico.c
|
# Audio method falls back from left to right.
|
||||||
|
"--with-default-audio-method=\"libao,pulse,alsa,oss\""
|
||||||
|
] ++ optional withPulse "--with-pulse"
|
||||||
|
++ optional withAlsa "--with-alsa"
|
||||||
|
++ optional withLibao "--with-libao"
|
||||||
|
++ optional withOss "--with-oss"
|
||||||
|
++ optional withEspeak "--with-espeak-ng"
|
||||||
|
++ optional withPico "--with-pico"
|
||||||
|
# ++ optional withFestival "--with-flint"
|
||||||
|
# ++ optional withIvona "--with-ivona"
|
||||||
|
;
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace config/speechd.conf --replace "DefaultModule espeak" "DefaultModule ${selectedDefaultModule}"
|
||||||
|
substituteInPlace src/modules/pico.c --replace "/usr/share/pico/lang" "${svox}/share/pico/lang"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
@ -32,8 +73,9 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Common interface to speech synthesis";
|
description = "Common interface to speech synthesis";
|
||||||
homepage = http://www.freebsoft.org/speechd;
|
homepage = https://devel.freebsoft.org/speechd;
|
||||||
license = licenses.gpl2Plus;
|
license = licenses.gpl2Plus;
|
||||||
|
maintainers = with maintainers; [ berce ];
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user