Skip to content
Permalink
Browse files

speechd: 0.8.5 -> 0.8.7

Add systemd units as well.
  • Loading branch information
peterhoeg committed Oct 26, 2017
1 parent 4068703 commit d766ec8c82082839ac800e185cc57f9aaa03473f
Showing with 43 additions and 14 deletions.
  1. +43 −14 pkgs/development/libraries/speechd/default.nix
@@ -1,39 +1,68 @@
{ fetchurl, lib, stdenv, intltool, libtool, pkgconfig, glib, dotconf, libsndfile
, libao, python3Packages
{ stdenv, lib, fetchurl, autoreconfHook, intltool, pkgconfig, texinfo, writeText
, glib, dotconf, libsndfile
, alsaLib, libao, libpulseaudio, python3Packages
, withEspeak ? false, espeak
, withPico ? true, svox
}:

stdenv.mkDerivation rec {
let
service = writeText "speechd.service" ''
[Unit]
Description=Speech-Dispatcher a high-level device independent layer for speech synthesis
[Service]
Type=forking
RuntimeDirectory=speech-dispatcher
# We set --log-dir to something which isn't a directory so speechd is forced to log to stdout
ExecStart=@out@/bin/speech-dispatcher --run-daemon --timeout 0 --pid-file %t/speech-dispatcher/pid --log-dir /dev/stdout
PIDFile=%t/speech-dispatcher/pid
Restart=on-failure
PrivateTmp=true
'';

in stdenv.mkDerivation rec {
name = "speech-dispatcher-${version}";
version = "0.8.5";
version = "0.8.7";

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

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

nativeBuildInputs = [ autoreconfHook pkgconfig python3Packages.wrapPython texinfo ];

hardeningDisable = [ "format" ];
enableParallelBuilding = true;

# hardeningDisable = [ "format" ];

pythonPath = with python3Packages; [ pyxdg ];

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

postInstall = ''
mkdir -p $out/lib/systemd/{system,user}
wrapPythonPrograms
for d in system user ; do
substitute ${service} $out/lib/systemd/$d/speechd.service \
--subst-var out
done
'';

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

0 comments on commit d766ec8

Please sign in to comment.
You can’t perform that action at this time.