2023-10-19 13:55:26 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, fetchpatch
|
|
|
|
, ncurses
|
|
|
|
, alsa-lib
|
|
|
|
, CoreServices
|
|
|
|
, AudioUnit
|
|
|
|
, Cocoa
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2022-03-05 16:20:37 +00:00
|
|
|
pname = "speech_tools";
|
|
|
|
version = "2.5.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-03-05 16:20:37 +00:00
|
|
|
url = "http://www.festvox.org/packed/festival/${lib.versions.majorMinor version}/speech_tools-${version}-release.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "1k2xh13miyv48gh06rgsq2vj25xwj7z6vwq9ilsn8i7ig3nrgzg4";
|
|
|
|
};
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
patches = [
|
|
|
|
# Fix build on Apple Silicon. Remove in the next release.
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/festvox/speech_tools/commit/06141f69d21bf507a9becb5405265dc362edb0df.patch";
|
|
|
|
hash = "sha256-tRestCBuRhak+2ccsB6mvDxGm/TIYX4eZ3oppCOEP9s=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
ncurses
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
alsa-lib
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
CoreServices
|
|
|
|
AudioUnit
|
|
|
|
Cocoa
|
|
|
|
];
|
|
|
|
|
|
|
|
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" "CXX=${stdenv.cc.targetPrefix}c++" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
# Workaround build failure on -fno-common toolchains:
|
|
|
|
# ld: libestools.a(editline.o):(.bss+0x28): multiple definition of
|
|
|
|
# `editline_history_file'; libestools.a(siodeditline.o):(.data.rel.local+0x8): first defined here
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-fcommon";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
preConfigure = ''
|
|
|
|
sed -e s@/usr/bin/@@g -i $( grep -rl '/usr/bin/' . )
|
|
|
|
sed -re 's@/bin/(rm|printf|uname)@\1@g' -i $( grep -rl '/bin/' . )
|
|
|
|
|
|
|
|
# c99 makes isnan valid for float and double
|
|
|
|
substituteInPlace include/EST_math.h \
|
|
|
|
--replace '__isnanf(X)' 'isnan(X)'
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out"/{bin,lib}
|
|
|
|
for d in bin lib; do
|
|
|
|
for i in ./$d/*; do
|
|
|
|
test "$(basename "$i")" = "Makefile" ||
|
|
|
|
cp -r "$(readlink -f $i)" "$out/$d"
|
|
|
|
done
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkTarget = "test";
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Text-to-speech engine";
|
|
|
|
maintainers = with maintainers; [ raskin ];
|
2023-10-19 13:55:26 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.free;
|
|
|
|
};
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
updateInfo = {
|
|
|
|
downloadPage = "http://www.festvox.org/packed/festival/";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|