Skip to content

Commit

Permalink
Merge pull request NixOS#261329 from abathur/speech_tools_darwin
Browse files Browse the repository at this point in the history
speech-tools: fix darwin build
  • Loading branch information
wegank authored Oct 16, 2023
2 parents 733302e + 1ee5ffc commit 905705a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
33 changes: 30 additions & 3 deletions pkgs/development/libraries/speech-tools/default.nix
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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
Expand Down Expand Up @@ -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;
};

Expand Down
4 changes: 3 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25111,7 +25111,9 @@ with pkgs;

speechd = callPackage ../development/libraries/speechd { };

speech-tools = callPackage ../development/libraries/speech-tools { };
speech-tools = callPackage ../development/libraries/speech-tools {
inherit (darwin.apple_sdk.frameworks) CoreServices AudioUnit Cocoa;
};

speex = callPackage ../development/libraries/speex {
fftw = fftwFloat;
Expand Down

0 comments on commit 905705a

Please sign in to comment.