Skip to content

Commit

Permalink
Merge pull request NixOS#261272 from abathur/espeakng_darwin
Browse files Browse the repository at this point in the history
pcaudiolib, espeak-ng: fix darwin builds
  • Loading branch information
wegank authored Oct 16, 2023
2 parents d3ae415 + 7344f8d commit ed57521
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
18 changes: 16 additions & 2 deletions pkgs/applications/audio/espeak-ng/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
, pcaudiolib
, sonicSupport ? true
, sonic
, CoreAudio
, AudioToolbox
, AudioUnit
, alsa-plugins
, makeWrapper
}:
Expand Down Expand Up @@ -42,9 +45,20 @@ stdenv.mkDerivation rec {

buildInputs = lib.optional mbrolaSupport mbrola
++ lib.optional pcaudiolibSupport pcaudiolib
++ lib.optional sonicSupport sonic;
++ lib.optional sonicSupport sonic
++ lib.optionals stdenv.isDarwin [
CoreAudio
AudioToolbox
AudioUnit
];

preConfigure = "./autogen.sh";
# touch ChangeLog to avoid below error on darwin:
# Makefile.am: error: required file './ChangeLog.md' not found
preConfigure = lib.optionalString stdenv.isDarwin ''
touch ChangeLog
'' + ''
./autogen.sh
'';

configureFlags = [
"--with-mbrola=${if mbrolaSupport then "yes" else "no"}"
Expand Down
7 changes: 5 additions & 2 deletions pkgs/development/libraries/pcaudiolib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ stdenv.mkDerivation (finalAttrs: {
++ lib.optional stdenv.isLinux alsa-lib
++ lib.optional pulseaudioSupport libpulseaudio;

preConfigure = ''
# touch ChangeLog to avoid below error on darwin:
# Makefile.am: error: required file './ChangeLog.md' not found
preConfigure = lib.optionalString stdenv.isDarwin ''
touch ChangeLog
'' + ''
./autogen.sh
'';

Expand All @@ -48,6 +52,5 @@ stdenv.mkDerivation (finalAttrs: {
license = licenses.gpl3Plus;
maintainers = with maintainers; [ aske ];
platforms = platforms.unix;
badPlatforms = platforms.darwin;
};
})
4 changes: 3 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31377,7 +31377,9 @@ with pkgs;

espeak-classic = callPackage ../applications/audio/espeak { };

espeak-ng = callPackage ../applications/audio/espeak-ng { };
espeak-ng = callPackage ../applications/audio/espeak-ng {
inherit (darwin.apple_sdk.frameworks) AudioToolbox AudioUnit CoreAudio;
};
espeak = res.espeak-ng;

espeakedit = callPackage ../applications/audio/espeak/edit.nix { };
Expand Down

0 comments on commit ed57521

Please sign in to comment.