diff --git a/pkgs/applications/audio/espeak-ng/default.nix b/pkgs/applications/audio/espeak-ng/default.nix index 46d13ff6910ee..e8ad860026a21 100644 --- a/pkgs/applications/audio/espeak-ng/default.nix +++ b/pkgs/applications/audio/espeak-ng/default.nix @@ -41,10 +41,17 @@ stdenv.mkDerivation rec { hash = "sha256-KfzqnRyQfz6nuMKnsHoUzb9rn9h/Pg54mupW1Cr+Zx0="; }) ] ++ lib.optionals mbrolaSupport [ - # Hardcode correct mbrola paths. + # Hardcode correct mbrola path. (substituteAll { src = ./mbrola.patch; - mbrola = mbrola.combined; + inherit mbrola; + }) + + # Pick up mbrola voices from XDG_DATA_DIRS to reduce closure size. + # https://github.com/espeak-ng/espeak-ng/pull/1948 + (fetchpatch { + url = "https://github.com/espeak-ng/espeak-ng/commit/7d31736c04e1bdd86f59e158a15be5e0f4a5b0cd.patch"; + hash = "sha256-phVQeEjhm8gCZta3TARPleDtTKPGqXGUMaTQsjc9zlw="; }) ]; diff --git a/pkgs/applications/audio/espeak-ng/mbrola.patch b/pkgs/applications/audio/espeak-ng/mbrola.patch index c88c814b791cc..32919fdba73f8 100644 --- a/pkgs/applications/audio/espeak-ng/mbrola.patch +++ b/pkgs/applications/audio/espeak-ng/mbrola.patch @@ -9,14 +9,3 @@ voice_path, "-", "-.wav", (char *)NULL); /* if execution reaches this point then the exec() failed */ snprintf(mbr_errorbuf, sizeof(mbr_errorbuf), ---- a/src/libespeak-ng/synth_mbrola.c -+++ b/src/libespeak-ng/synth_mbrola.c -@@ -85,7 +85,7 @@ - if (!load_MBR()) - return ENS_MBROLA_NOT_FOUND; - -- sprintf(path, "%s/mbrola/%s", path_home, mbrola_voice); -+ sprintf(path, "@mbrola@/share/mbrola/%s/%s", mbrola_voice, mbrola_voice); - #ifdef PLATFORM_POSIX - // if not found, then also look in - // usr/share/mbrola/xx, /usr/share/mbrola/xx/xx, /usr/share/mbrola/voices/xx diff --git a/pkgs/by-name/mb/mbrola/package.nix b/pkgs/by-name/mb/mbrola/package.nix index 8a3062ecd455e..20ea3ceba32c8 100644 --- a/pkgs/by-name/mb/mbrola/package.nix +++ b/pkgs/by-name/mb/mbrola/package.nix @@ -2,8 +2,6 @@ lib, stdenv, fetchFromGitHub, - mbrola-voices, - runCommandLocal, }: stdenv.mkDerivation (finalAttrs: { @@ -28,14 +26,6 @@ stdenv.mkDerivation (finalAttrs: { runHook postInstall ''; - passthru = { - combined = runCommandLocal "mbrola-combined-${finalAttrs.version}" { inherit (finalAttrs) meta; } '' - mkdir -p "$out/" - ln -s '${mbrola-voices}/share' "$out/" - ln -s '${finalAttrs.finalPackage}/bin' "$out/" - ''; - }; - meta = with lib; { description = "Speech synthesizer based on the concatenation of diphones"; homepage = "https://github.com/numediart/MBROLA";