From b7c2758651f69ab23c3c993ec075bc6e98153fcb Mon Sep 17 00:00:00 2001 From: Brian McGillion Date: Thu, 25 Sep 2025 10:27:02 +0400 Subject: [PATCH 1/2] espeak-ng: 1.52.0 -> 1.52.0.1-unstable-2025-09-09 Update to the latest version, as it has the flags to guard and enable cross-compiled versions of Intonations. Signed-off-by: Brian McGillion --- pkgs/applications/audio/espeak-ng/default.nix | 24 ++++------- .../audio/espeak-ng/libsonic.patch | 41 ------------------- 2 files changed, 8 insertions(+), 57 deletions(-) delete mode 100644 pkgs/applications/audio/espeak-ng/libsonic.patch diff --git a/pkgs/applications/audio/espeak-ng/default.nix b/pkgs/applications/audio/espeak-ng/default.nix index ae5fb257cbbc..77e7df1e8549 100644 --- a/pkgs/applications/audio/espeak-ng/default.nix +++ b/pkgs/applications/audio/espeak-ng/default.nix @@ -31,13 +31,13 @@ }: let - version = "1.52.0"; + version = "1.52.0.1-unstable-2025-09-09"; src = fetchFromGitHub { owner = "espeak-ng"; repo = "espeak-ng"; - tag = version; - hash = "sha256-mmh5QPSVD5YQ0j16R+bEL5vcyWLtTNOJ/irBNzWY3ro="; + rev = "0d451f8c1c6ae837418b823bd9c4cbc574ea9ff5"; + hash = "sha256-wpPi+YjSLhsEWfE3KEbL4A7o48qtz9fLRZ/u4xGOM2g="; }; ucd-tools = stdenv.mkDerivation { @@ -59,22 +59,14 @@ in stdenv.mkDerivation rec { pname = "espeak-ng"; - version = "1.52.0"; - - src = fetchFromGitHub { - owner = "espeak-ng"; - repo = "espeak-ng"; - tag = version; - hash = "sha256-mmh5QPSVD5YQ0j16R+bEL5vcyWLtTNOJ/irBNzWY3ro="; - }; + inherit version src; patches = [ # https://github.com/espeak-ng/espeak-ng/pull/2274 - ./libsonic.patch (fetchpatch { - name = "espeak-ng-text-to-phonemes-with-terminator.patch"; - url = "https://github.com/espeak-ng/espeak-ng/commit/2108b1e8ae02f49cc909894a1024efdfde6682fd.patch"; - hash = "sha256-XjEc1r7F88xZOfeUey0R6Xv6vu4Wy8GtWxXFG2NTf9g="; + name = "libsonic.patch"; + url = "https://github.com/espeak-ng/espeak-ng/commit/83e646e711af608fafa8c01dd812cd29e073f644.patch"; + hash = "sha256-UHuURyqRy/JVYYJH5EI5J2cpBfCNeTE24sMmheb+D2Q="; }) ] ++ lib.optionals mbrolaSupport [ @@ -127,7 +119,7 @@ stdenv.mkDerivation rec { meta = { description = "Speech synthesizer that supports more than hundred languages and accents"; homepage = "https://github.com/espeak-ng/espeak-ng"; - changelog = "https://github.com/espeak-ng/espeak-ng/blob/${src.tag}/ChangeLog.md"; + changelog = "https://github.com/espeak-ng/espeak-ng/blob/${src.rev}/ChangeLog.md"; license = lib.licenses.gpl3Plus; maintainers = with lib.maintainers; [ aske ]; platforms = lib.platforms.all; diff --git a/pkgs/applications/audio/espeak-ng/libsonic.patch b/pkgs/applications/audio/espeak-ng/libsonic.patch deleted file mode 100644 index 32346e91101a..000000000000 --- a/pkgs/applications/audio/espeak-ng/libsonic.patch +++ /dev/null @@ -1,41 +0,0 @@ -diff --git a/cmake/deps.cmake b/cmake/deps.cmake -index b63ced21..2cd1727b 100644 ---- a/cmake/deps.cmake -+++ b/cmake/deps.cmake -@@ -13,20 +13,22 @@ endif(PTHREAD_LIB) - if (MBROLA_BIN) - set(HAVE_MBROLA ON) - endif(MBROLA_BIN) --if (SONIC_LIB AND SONIC_INC) -- set(HAVE_LIBSONIC ON) --else() -- FetchContent_Declare(sonic-git -- GIT_REPOSITORY https://github.com/waywardgeek/sonic.git -- GIT_TAG fbf75c3d6d846bad3bb3d456cbc5d07d9fd8c104 -- ) -- FetchContent_MakeAvailable(sonic-git) -- FetchContent_GetProperties(sonic-git) -- add_library(sonic OBJECT ${sonic-git_SOURCE_DIR}/sonic.c) -- target_include_directories(sonic PUBLIC ${sonic-git_SOURCE_DIR}) -- set(HAVE_LIBSONIC ON) -- set(SONIC_LIB sonic) -- set(SONIC_INC ${sonic-git_SOURCE_DIR}) -+if (USE_LIBSONIC) -+ if (SONIC_LIB AND SONIC_INC) -+ set(HAVE_LIBSONIC ON) -+ else() -+ FetchContent_Declare(sonic-git -+ GIT_REPOSITORY https://github.com/waywardgeek/sonic.git -+ GIT_TAG fbf75c3d6d846bad3bb3d456cbc5d07d9fd8c104 -+ ) -+ FetchContent_MakeAvailable(sonic-git) -+ FetchContent_GetProperties(sonic-git) -+ add_library(sonic OBJECT ${sonic-git_SOURCE_DIR}/sonic.c) -+ target_include_directories(sonic PUBLIC ${sonic-git_SOURCE_DIR}) -+ set(HAVE_LIBSONIC ON) -+ set(SONIC_LIB sonic) -+ set(SONIC_INC ${sonic-git_SOURCE_DIR}) -+ endif() - endif() - if (PCAUDIO_LIB AND PCAUDIO_INC) - set(HAVE_LIBPCAUDIO ON) From 517223133936e3715d61f8d6b8ebd918077fd981 Mon Sep 17 00:00:00 2001 From: Brian McGillion Date: Thu, 25 Sep 2025 10:31:42 +0400 Subject: [PATCH 2/2] espeak-ng: fix cross compiling issue Fixes: #445853 Fix the cross compilation issues that came from intonations being built by the native version of espeak-ng Signed-off-by: Brian McGillion --- pkgs/applications/audio/espeak-ng/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/applications/audio/espeak-ng/default.nix b/pkgs/applications/audio/espeak-ng/default.nix index 77e7df1e8549..71aa235bd663 100644 --- a/pkgs/applications/audio/espeak-ng/default.nix +++ b/pkgs/applications/audio/espeak-ng/default.nix @@ -28,6 +28,7 @@ sonicSupport ? true, speechPlayerSupport ? true, ucdSupport ? false, + buildPackages, }: let @@ -90,6 +91,10 @@ stdenv.mkDerivation rec { ronn makeWrapper which + ] + # Provide a native espeak-ng when cross compiling so intonations can be built + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + buildPackages.espeak-ng ]; buildInputs = @@ -105,6 +110,10 @@ stdenv.mkDerivation rec { (lib.cmakeBool "USE_LIBSONIC" sonicSupport) (lib.cmakeBool "USE_MBROLA" mbrolaSupport) (lib.cmakeBool "USE_SPEECHPLAYER" speechPlayerSupport) + ] + # Point CMake to the native build’s binary dir when cross compiling + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DNativeBuild_DIR=${buildPackages.espeak-ng}/bin/" ]; postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''