summary refs log tree commit diff
path: root/pkgs/development/libraries/speechd/default.nix
blob: 613fee3c6d6388cc17e65fec4b7566ed25ea1ce9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ fetchurl, lib, stdenv, intltool, libtool, pkgconfig, glib, dotconf, libsndfile
, libao, python3Packages
, withEspeak ? false, espeak
, withPico ? true, svox
}:

stdenv.mkDerivation rec {
  name = "speech-dispatcher-${version}";
  version = "0.8.3";

  src = fetchurl {
    url = "http://www.freebsoft.org/pub/projects/speechd/${name}.tar.gz";
    sha256 = "0kqy7z4l59n2anc7xn588w4rkacig1hajx8c53qrh90ypar978ln";
  };

  buildInputs = [ intltool libtool glib dotconf libsndfile libao python3Packages.python ]
             ++ lib.optional withEspeak espeak
             ++ lib.optional withPico svox;
  nativeBuildInputs = [ pkgconfig python3Packages.wrapPython ];

  pythonPath = with python3Packages; [ pyxdg ];

  postPatch = lib.optionalString withPico ''
    sed -i 's,/usr/share/pico/lang/,${svox}/share/pico/lang/,g' src/modules/pico.c
  '';

  postInstall = ''
    wrapPythonPrograms
  '';

  meta = with stdenv.lib; {
    description = "Common interface to speech synthesis";
    homepage = http://www.freebsoft.org/speechd;
    license = licenses.gpl2Plus;
    platforms = platforms.linux;
  };
}