Merge pull request #107773 from marsam/fix-sonic-darwin

espeak-ng: enable on darwin
This commit is contained in:
Mario Rodas 2020-12-28 06:58:43 -05:00 committed by GitHub
commit 814464a239
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 16 deletions

View file

@ -21,15 +21,16 @@ stdenv.mkDerivation rec {
preConfigure = "./autogen.sh"; preConfigure = "./autogen.sh";
postInstall = '' postInstall = lib.optionalString stdenv.isLinux ''
patchelf --set-rpath "$(patchelf --print-rpath $out/bin/espeak-ng)" $out/bin/speak-ng patchelf --set-rpath "$(patchelf --print-rpath $out/bin/espeak-ng)" $out/bin/speak-ng
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Open source speech synthesizer that supports over 70 languages, based on eSpeak"; description = "Open source speech synthesizer that supports over 70 languages, based on eSpeak";
homepage = src.meta.homepage; homepage = "https://github.com/espeak-ng/espeak-ng";
changelog = "https://github.com/espeak-ng/espeak-ng/blob/${version}/CHANGELOG.md";
license = licenses.gpl3; license = licenses.gpl3;
maintainers = with maintainers; [ aske ]; maintainers = with maintainers; [ aske ];
platforms = platforms.linux; platforms = platforms.all;
}; };
} }

View file

@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
version = "1.1"; version = "1.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "rhdunn"; owner = "espeak-ng";
repo = "pcaudiolib"; repo = "pcaudiolib";
rev = version; rev = version;
sha256 = "0c55hlqqh0m7bcb3nlgv1s4a22s5bgczr1cakjh3767rjb10khi0"; sha256 = "0c55hlqqh0m7bcb3nlgv1s4a22s5bgczr1cakjh3767rjb10khi0";
@ -16,15 +16,17 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ autoconf automake which libtool pkgconfig ]; nativeBuildInputs = [ autoconf automake which libtool pkgconfig ];
buildInputs = [ portaudio alsaLib ] ++ lib.optional pulseaudioSupport libpulseaudio; buildInputs = [ portaudio ]
++ lib.optionals stdenv.isLinux [ alsaLib ]
++ lib.optionals pulseaudioSupport [ libpulseaudio ];
preConfigure = "./autogen.sh"; preConfigure = "./autogen.sh";
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Provides a C API to different audio devices"; description = "Provides a C API to different audio devices";
homepage = "https://github.com/rhdunn/pcaudiolib"; homepage = "https://github.com/espeak-ng/pcaudiolib";
license = licenses.gpl3; license = licenses.gpl3;
maintainers = with maintainers; [ aske ]; maintainers = with maintainers; [ aske ];
platforms = platforms.linux; platforms = platforms.all;
}; };
} }

View file

@ -1,27 +1,33 @@
{ stdenv, fetchFromGitHub, fftw }: { stdenv, fetchFromGitHub, fftw, installShellFiles }:
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "sonic"; pname = "sonic-unstable";
version = "2018-07-06"; version = "2020-12-27";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "waywardgeek"; owner = "waywardgeek";
repo = "sonic"; repo = "sonic";
rev = "71c51195de71627d7443d05378c680ba756545e8"; rev = "4a052d9774387a9d9b4af627f6a74e1694419960";
sha256 = "1z9qdk3pk507hdg39v2z1hanlw2wv7mhn8br4cb8qry9z9qwi87i"; sha256 = "0ah54nizb6iwcx277w104wsfnx05vrp4sh56d2pfxhf8xghg54m6";
}; };
postPatch = '' makeFlags = [ "PREFIX=${placeholder "out"}" "CC=cc" ];
sed -i "s,^PREFIX=.*,PREFIX=$out," Makefile
''; nativeBuildInputs = [ installShellFiles ];
buildInputs = [ fftw ]; buildInputs = [ fftw ];
postInstall = ''
installManPage sonic.1
'' + stdenv.lib.optionalString stdenv.isDarwin ''
install_name_tool -id $out/lib/libsonic.so.0.3.0 $out/lib/libsonic.so.0.3.0
'';
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Simple library to speed up or slow down speech"; description = "Simple library to speed up or slow down speech";
homepage = "https://github.com/waywardgeek/sonic"; homepage = "https://github.com/waywardgeek/sonic";
license = licenses.asl20; license = licenses.asl20;
maintainers = with maintainers; [ aske ]; maintainers = with maintainers; [ aske ];
platforms = platforms.linux; platforms = platforms.all;
}; };
} }