12 stdenv.mkDerivation rec {
13 pname = "speech_tools";
17 url = "http://www.festvox.org/packed/festival/${lib.versions.majorMinor version}/speech_tools-${version}-release.tar.gz";
18 sha256 = "1k2xh13miyv48gh06rgsq2vj25xwj7z6vwq9ilsn8i7ig3nrgzg4";
22 # Fix build on Apple Silicon. Remove in the next release.
24 url = "https://github.com/festvox/speech_tools/commit/06141f69d21bf507a9becb5405265dc362edb0df.patch";
25 hash = "sha256-tRestCBuRhak+2ccsB6mvDxGm/TIYX4eZ3oppCOEP9s=";
31 ] ++ lib.optionals stdenv.isLinux [
33 ] ++ lib.optionals stdenv.isDarwin [
39 makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" "CXX=${stdenv.cc.targetPrefix}c++" ];
41 # Workaround build failure on -fno-common toolchains:
42 # ld: libestools.a(editline.o):(.bss+0x28): multiple definition of
43 # `editline_history_file'; libestools.a(siodeditline.o):(.data.rel.local+0x8): first defined here
44 env.NIX_CFLAGS_COMPILE = "-fcommon";
47 sed -e s@/usr/bin/@@g -i $( grep -rl '/usr/bin/' . )
48 sed -re 's@/bin/(rm|printf|uname)@\1@g' -i $( grep -rl '/bin/' . )
50 # c99 makes isnan valid for float and double
51 substituteInPlace include/EST_math.h \
52 --replace '__isnanf(X)' 'isnan(X)'
56 mkdir -p "$out"/{bin,lib}
59 test "$(basename "$i")" = "Makefile" ||
60 cp -r "$(readlink -f $i)" "$out/$d"
70 description = "Text-to-speech engine";
71 maintainers = with maintainers; [ raskin ];
72 platforms = platforms.unix;
73 license = licenses.free;
78 downloadPage = "http://www.festvox.org/packed/festival/";