about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/freetts/default.nix
blob: ec948f1fdccc93eef33c4c76da9ffacacec9a409 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{ lib
, stdenv
, fetchzip
, ant
, jdk8
, sharutils
, stripJavaArchivesHook
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "freetts";
  version = "1.2.2";

  src = fetchzip {
    url = "mirror://sourceforge/freetts/${finalAttrs.pname}-${finalAttrs.version}-src.zip";
    hash = "sha256-+bhM0ErEZVnmcz5CBqn/AeGaOhKnCjZzGeqgO/89wms=";
    stripRoot = false;
  };

  nativeBuildInputs = [
    ant
    jdk8
    sharutils
    stripJavaArchivesHook
  ];

  sourceRoot = "${finalAttrs.src.name}/freetts-${finalAttrs.version}";

  buildPhase = ''
    runHook preBuild

    pushd lib
    sed -i -e "s/more/cat/" jsapi.sh
    echo y | sh jsapi.sh
    popd

    ln -s . src
    ant

    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall
    install -Dm644 lib/*.jar -t $out/lib
    runHook postInstall
  '';

  meta = {
    description = "Text to speech system based on Festival written in Java";
    longDescription = ''
      Text to speech system based on Festival written in Java.
      Can be used in combination with KDE accessibility.
    '';
    homepage = "http://freetts.sourceforge.net";
    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
    ];
  };
})