diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:36 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:47 +0000 |
commit | 36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch) | |
tree | b3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/libraries/speechd/default.nix | |
parent | 4e31070265257dc67d120c27e0f75c2344fdfa9a (diff) | |
parent | abf060725d7614bd3b9f96764262dfbc2f9c2199 (diff) | |
download | nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2 nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip |
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/speechd/default.nix')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/speechd/default.nix | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/speechd/default.nix b/nixpkgs/pkgs/development/libraries/speechd/default.nix new file mode 100644 index 000000000000..b27fd0843bc0 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/speechd/default.nix @@ -0,0 +1,81 @@ +{ stdenv, pkgconfig, fetchurl, python3Packages +, intltool, itstool, libtool, texinfo, autoreconfHook +, 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 +# , withIvona ? false, libdumbtts +}: + +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}"; + version = "0.8.8"; + + src = fetchurl { + url = "http://www.freebsoft.org/pub/projects/speechd/${name}.tar.gz"; + sha256 = "1wvck00w9ixildaq6hlhnf6wa576y02ac96lp6932h3k1n08jaiw"; + }; + + nativeBuildInputs = [ pkgconfig autoreconfHook intltool libtool itstool texinfo wrapPython ]; + + 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 = [ pyxdg ]; + + configureFlags = [ + # 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 = '' + wrapPythonPrograms + ''; + + meta = with stdenv.lib; { + description = "Common interface to speech synthesis"; + homepage = https://devel.freebsoft.org/speechd; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ berce ]; + platforms = platforms.linux; + }; +} |