summary refs log tree commit diff
path: root/pkgs/development/libraries/flite
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/flite')
-rw-r--r--pkgs/development/libraries/flite/default.nix36
1 files changed, 23 insertions, 13 deletions
diff --git a/pkgs/development/libraries/flite/default.nix b/pkgs/development/libraries/flite/default.nix
index f9e4720f643..cd8eb538462 100644
--- a/pkgs/development/libraries/flite/default.nix
+++ b/pkgs/development/libraries/flite/default.nix
@@ -1,28 +1,38 @@
-{ stdenv, fetchFromGitHub, alsaLib }:
+{ lib, stdenv, fetchFromGitHub, alsa-lib, fetchpatch }:
 
-stdenv.mkDerivation {
-  name = "flite-2.1.0";
+stdenv.mkDerivation rec {
+  pname = "flite";
+  version = "2.2";
 
   src = fetchFromGitHub {
-    owner  = "festvox";
-    repo   = "flite";
-    rev    = "d673f65b2c4a8cd3da7447079309a6dc4bcf1a5e";
-    sha256 = "1kx43jvdln370590gfjhxxz3chxfi6kq18504wmdpljib2l0grjq";
+    owner = "festvox";
+    repo = "flite";
+    rev = "v${version}";
+    sha256 = "1n0p81jzndzc1rzgm66kw9ls189ricy5v1ps11y0p2fk1p56kbjf";
   };
 
-  buildInputs = [ alsaLib ];
+  buildInputs = lib.optionals stdenv.isLinux [ alsa-lib ];
+
+  # https://github.com/festvox/flite/pull/60.
+  # Replaces `ar` with `$(AR)` in config/common_make_rules.
+  # Improves cross-compilation compatibility.
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/festvox/flite/commit/54c65164840777326bbb83517568e38a128122ef.patch";
+      sha256 = "sha256-hvKzdX7adiqd9D+9DbnfNdqEULg1Hhqe1xElYxNM1B8=";
+    })
+  ];
 
   configureFlags = [
     "--enable-shared"
-    "--with-audio=alsa"
-  ];
+  ] ++ lib.optionals stdenv.isLinux [ "--with-audio=alsa" ];
 
   enableParallelBuilding = true;
 
-  meta = {
+  meta = with lib; {
     description = "A small, fast run-time speech synthesis engine";
     homepage = "http://www.festvox.org/flite/";
-    license = stdenv.lib.licenses.free;
-    platforms = stdenv.lib.platforms.linux;
+    license = licenses.bsdOriginal;
+    platforms = platforms.all;
   };
 }