diff --git a/pkgs/development/libraries/freetts/default.nix b/pkgs/development/libraries/freetts/default.nix index 06535c087dc6..698a7f6a28ac 100644 --- a/pkgs/development/libraries/freetts/default.nix +++ b/pkgs/development/libraries/freetts/default.nix @@ -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 '