Merge pull request #294631 from TomaSajt/freetts

freetts: clean up and make deterministic
This commit is contained in:
Pol Dellaiera 2024-03-10 14:28:38 +01:00 committed by GitHub
commit c38b6d6cef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 45 additions and 19 deletions

View file

@ -1,29 +1,53 @@
{stdenv, fetchurl, apacheAnt, unzip, sharutils, lib, jdk}:
{ lib
, stdenv
, fetchzip
, ant
, jdk8
, sharutils
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "freetts";
version = "1.2.2";
src = fetchurl {
url = "mirror://sourceforge/freetts/${pname}-${version}-src.zip";
sha256 = "0mnikqhpf4f4jdr0irmibr8yy0dnffx1i257y22iamxi7a6by2r7";
src = fetchzip {
url = "mirror://sourceforge/freetts/${finalAttrs.pname}-${finalAttrs.version}-src.zip";
hash = "sha256-+bhM0ErEZVnmcz5CBqn/AeGaOhKnCjZzGeqgO/89wms=";
stripRoot = false;
};
nativeBuildInputs = [ unzip ];
buildInputs = [ apacheAnt sharutils jdk ];
unpackPhase = ''
unzip $src -x META-INF/*
nativeBuildInputs = [
ant
jdk8
sharutils
];
sourceRoot = "${finalAttrs.src.name}/freetts-${finalAttrs.version}";
postPatch = ''
# Fix jar timestamps for reproducibility
substituteInPlace build.xml demo.xml \
--replace-fail '<jar ' '<jar modificationtime="0" '
'';
buildPhase = ''
cd */lib
runHook preBuild
pushd lib
sed -i -e "s/more/cat/" jsapi.sh
echo y | sh jsapi.sh
cd ..
popd
ln -s . src
ant
runHook postBuild
'';
installPhase = ''
install -v -m755 -d $out/{lib,docs/{audio,images}}
install -v -m644 lib/*.jar $out/lib
runHook preInstall
install -Dm644 lib/*.jar -t $out/lib
runHook postInstall
'';
meta = {
@ -32,8 +56,12 @@ stdenv.mkDerivation rec {
Text to speech system based on Festival written in Java.
Can be used in combination with KDE accessibility.
'';
license = "GPL";
homepage = "http://freetts.sourceforge.net";
maintainers = [ lib.maintainers.sander ];
license = lib.licenses.bsdOriginal;
maintainers = with lib.maintainers; [ sander ];
sourceProvenance = with lib.sourceTypes; [
fromSource
binaryBytecode # jsapi.jar is bundled in a self-extracting shell-script
];
};
}
})

View file

@ -21099,9 +21099,7 @@ with pkgs;
};
};
freetts = callPackage ../development/libraries/freetts {
jdk = jdk8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731
};
freetts = callPackage ../development/libraries/freetts { };
frog = res.languageMachines.frog;