about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/speech-tools
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-10-20 22:09:03 +0000
committerAlyssa Ross <hi@alyssa.is>2023-10-20 22:09:03 +0000
commit50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e (patch)
treef2556b911180125ccbb7ed0e78a54e92da89adce /nixpkgs/pkgs/development/libraries/speech-tools
parent4c16d4548a98563c9d9ad76f4e5b2202864ccd54 (diff)
parentcfc75eec4603c06503ae750f88cf397e00796ea8 (diff)
downloadnixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.gz
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.bz2
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.lz
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.xz
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.zst
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.zip
Merge commit 'cfc75eec4603c06503ae750f88cf397e00796ea8'
Conflicts:
	nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/speech-tools')
-rw-r--r--nixpkgs/pkgs/development/libraries/speech-tools/default.nix33
1 files changed, 30 insertions, 3 deletions
diff --git a/nixpkgs/pkgs/development/libraries/speech-tools/default.nix b/nixpkgs/pkgs/development/libraries/speech-tools/default.nix
index 3b34ab928295..8bee16fef753 100644
--- a/nixpkgs/pkgs/development/libraries/speech-tools/default.nix
+++ b/nixpkgs/pkgs/development/libraries/speech-tools/default.nix
@@ -1,4 +1,13 @@
-{ lib, stdenv, fetchurl, alsa-lib, ncurses }:
+{ lib
+, stdenv
+, fetchurl
+, fetchpatch
+, ncurses
+, alsa-lib
+, CoreServices
+, AudioUnit
+, Cocoa
+}:
 
 stdenv.mkDerivation rec {
   pname = "speech_tools";
@@ -9,7 +18,25 @@ stdenv.mkDerivation rec {
     sha256 = "1k2xh13miyv48gh06rgsq2vj25xwj7z6vwq9ilsn8i7ig3nrgzg4";
   };
 
-  buildInputs = [ alsa-lib ncurses ];
+  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++" ];
 
   # Workaround build failure on -fno-common toolchains:
   #   ld: libestools.a(editline.o):(.bss+0x28): multiple definition of
@@ -42,7 +69,7 @@ stdenv.mkDerivation rec {
   meta = with lib; {
     description = "Text-to-speech engine";
     maintainers = with maintainers; [ raskin ];
-    platforms = platforms.linux;
+    platforms = platforms.unix;
     license = licenses.free;
   };