1 { lib, stdenv, fetchurl, unzip, portaudio }:
3 stdenv.mkDerivation rec {
8 url = "mirror://sourceforge/espeak/espeak-${version}-source.zip";
9 sha256 = "0n86gwh9pw0jqqpdz7mxggllfr8k0r7pc67ayy7w5z6z79kig6mz";
12 nativeBuildInputs = [ unzip ];
13 buildInputs = [ portaudio ];
20 sed -e s,/bin/ln,ln,g -i src/Makefile
21 sed -e 's,^CXXFLAGS=-O2,CXXFLAGS=-O2 -D PATH_ESPEAK_DATA=\\\"$(DATADIR)\\\",' -i src/Makefile
22 '' + (lib.optionalString (portaudio.api_version == 19) ''
23 cp src/portaudio19.h src/portaudio.h
28 makeFlags="PREFIX=$out DATADIR=$out/share/espeak-data"
32 description = "Compact open source software speech synthesizer";
33 mainProgram = "espeak";
34 homepage = "https://espeak.sourceforge.net/";
35 license = licenses.gpl3Plus;
36 platforms = platforms.linux;