git: 876d5f2119b2 - main - audio/piper: Update to 1.8.0

From: Baptiste Daroussin <bapt_at_FreeBSD.org>
Date: Fri, 25 Sep 2026 15:36:01 UTC
The branch main has been updated by bapt:

URL: https://cgit.FreeBSD.org/ports/commit/?id=876d5f2119b2d713764b2c86e46b4da82c95a45b

commit 876d5f2119b2d713764b2c86e46b4da82c95a45b
Author:     Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2026-09-17 07:42:50 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2026-09-25 15:35:28 +0000

    audio/piper: Update to 1.8.0
    
    - Track the rewritten upstream OHF-Voice/piper1-gpl (license GPLv3+)
    - Add a SONAME to libpiper
---
 audio/piper/Makefile                               |  36 ++--
 audio/piper/distinfo                               |   6 +-
 audio/piper/files/patch-CMakeLists.txt             | 139 ---------------
 audio/piper/files/patch-libpiper_CMakeLists.txt    | 198 +++++++++++++++++++++
 .../files/patch-libpiper_src_main_CMakeLists.txt   |  22 +++
 audio/piper/files/patch-libpiper_src_main_main.cpp |  33 ++++
 audio/piper/files/patch-src_cpp_piper.cpp          |  61 -------
 audio/piper/pkg-descr                              |   5 +-
 8 files changed, 280 insertions(+), 220 deletions(-)

diff --git a/audio/piper/Makefile b/audio/piper/Makefile
index e1992d2ea5d9..0c1b9c75afbf 100644
--- a/audio/piper/Makefile
+++ b/audio/piper/Makefile
@@ -1,28 +1,34 @@
 PORTNAME=	piper
-DISTVERSION=	2023.11.14
-DISTVERSIONSUFFIX=	-2
-PORTREVISION=	4
+DISTVERSIONPREFIX=	v
+DISTVERSION=	1.8.0
+PORTEPOCH=	1
 CATEGORIES=	audio
 
-MAINTAINER=	ports@FreeBSD.org
+MAINTAINER=	bapt@FreeBSD.org
 COMMENT=	Fast, local text to speech system
-WWW=		https://rhasspy.github.io/piper-samples/
+WWW=		https://github.com/OHF-Voice/piper1-gpl
 
-LICENSE=	MIT
-LICENSE_FILE=	${WRKSRC}/LICENSE.md
+LICENSE=	GPLv3+
+LICENSE_FILE=	${WRKSRC}/COPYING
 
 LIB_DEPENDS=	libespeak-ng.so:audio/espeak-ng \
-		libfmt.so:devel/libfmt \
-		libonnxruntime.so:misc/onnxruntime \
-		libpiper_phonemize.so:audio/piper-phonemize \
-		libspdlog.so:devel/spdlog
+		libonnxruntime.so:misc/onnxruntime
 
-USES=		compiler:c++17-lang cmake localbase pkgconfig tar:xz xorg
-USE_XORG=	x11
+USES=		cmake compiler:c++17-lang pkgconfig
 
 USE_GITHUB=	yes
-GH_ACCOUNT=	rhasspy
+GH_ACCOUNT=	OHF-Voice
+GH_PROJECT=	piper1-gpl
 
-PLIST_FILES=	bin/piper
+USE_LDCONFIG=	yes
+
+# Only the C++ library and command line interface are built.
+CMAKE_SOURCE_PATH=	${WRKSRC}/libpiper
+
+PLIST_FILES=	bin/piper \
+		include/piper.h \
+		lib/libpiper.so \
+		lib/libpiper.so.1 \
+		lib/libpiper.so.${PORTVERSION}
 
 .include <bsd.port.mk>
diff --git a/audio/piper/distinfo b/audio/piper/distinfo
index 9f8fb736b6a0..70e1b09b0c39 100644
--- a/audio/piper/distinfo
+++ b/audio/piper/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1750142677
-SHA256 (rhasspy-piper-2023.11.14-2_GH0.tar.gz) = 8b684e102cfe23af097830db9555a8641f17735725853c531a1daeb34b6ed1a8
-SIZE (rhasspy-piper-2023.11.14-2_GH0.tar.gz) = 25602353
+TIMESTAMP = 1789632040
+SHA256 (OHF-Voice-piper1-gpl-v1.8.0_GH0.tar.gz) = 0a22987a6157f14e2fb7cf4aa702b547467fd0448bea9f233abd503c3ff4a0e1
+SIZE (OHF-Voice-piper1-gpl-v1.8.0_GH0.tar.gz) = 24738865
diff --git a/audio/piper/files/patch-CMakeLists.txt b/audio/piper/files/patch-CMakeLists.txt
deleted file mode 100644
index 8c8041a0c750..000000000000
--- a/audio/piper/files/patch-CMakeLists.txt
+++ /dev/null
@@ -1,139 +0,0 @@
---- CMakeLists.txt.orig	2023-11-14 17:55:22 UTC
-+++ CMakeLists.txt
-@@ -13,7 +13,7 @@ if(MSVC)
-   add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
- elseif(NOT APPLE)
-   # Linux flags
--  string(APPEND CMAKE_CXX_FLAGS " -Wall -Wextra -Wl,-rpath,'$ORIGIN'")
-+  string(APPEND CMAKE_CXX_FLAGS " -Wall -Wextra")
-   string(APPEND CMAKE_C_FLAGS " -Wall -Wextra")
- endif()
- 
-@@ -25,7 +25,7 @@ add_executable(test_piper src/cpp/test.cpp src/cpp/piper.cpp)
- 
- # ---- fmt ---
- 
--if(NOT DEFINED FMT_DIR)
-+if(FALSE)
-   set(FMT_VERSION "10.0.0")
-   set(FMT_DIR "${CMAKE_CURRENT_BINARY_DIR}/fi")
- 
-@@ -43,7 +43,7 @@ endif()
- 
- # ---- spdlog ---
- 
--if(NOT DEFINED SPDLOG_DIR)
-+if(FALSE)
-   set(SPDLOG_DIR "${CMAKE_CURRENT_BINARY_DIR}/si")
-   set(SPDLOG_VERSION "1.12.0")
-   ExternalProject_Add(
-@@ -58,7 +58,13 @@ endif()
- 
- # ---- piper-phonemize ---
- 
--if(NOT DEFINED PIPER_PHONEMIZE_DIR)
-+find_package(PkgConfig)
-+pkg_check_modules(FMT REQUIRED fmt)
-+pkg_check_modules(ONNXRUNTIME REQUIRED libonnxruntime)
-+pkg_check_modules(PIPER_PHONEMIZE REQUIRED piper_phonemize)
-+pkg_check_modules(SPDLOG REQUIRED spdlog)
-+
-+if(FALSE)
-   set(PIPER_PHONEMIZE_DIR "${CMAKE_CURRENT_BINARY_DIR}/pi")
-   ExternalProject_Add(
-     piper_phonemize_external
-@@ -74,9 +80,8 @@ endif()
- 
- if((NOT MSVC) AND (NOT APPLE))
-   # Linux flags
--  string(APPEND CMAKE_CXX_FLAGS " -Wall -Wextra -Wl,-rpath,'$ORIGIN'")
-+  string(APPEND CMAKE_CXX_FLAGS " -Wall -Wextra")
-   string(APPEND CMAKE_C_FLAGS " -Wall -Wextra")
--  target_link_libraries(piper -static-libgcc -static-libstdc++)
- 
-   set(PIPER_EXTRA_LIBRARIES "pthread")
- endif()
-@@ -91,18 +96,18 @@ target_link_libraries(piper
- )
- 
- target_link_directories(piper PUBLIC
--  ${FMT_DIR}/lib
--  ${SPDLOG_DIR}/lib
--  ${PIPER_PHONEMIZE_DIR}/lib
-+  ${FMT_LIBRARY_DIRS}
-+  ${SPDLOG_LIBRARY_DIRS}
-+  ${ONNXRUNTIME_LIBRARY_DIRS}
- )
- 
- target_include_directories(piper PUBLIC
--  ${FMT_DIR}/include
--  ${SPDLOG_DIR}/include
--  ${PIPER_PHONEMIZE_DIR}/include
-+  ${FMT_INCLUDE_DIRS}
-+  ${SPDLOG_INCLUDE_DIRS}
-+  ${ONNXRUNTIME_INCLUDE_DIRS}
- )
- 
--target_compile_definitions(piper PUBLIC _PIPER_VERSION=${piper_version})
-+target_compile_definitions(piper PUBLIC _PIPER_VERSION="${piper_version}")
- 
- # ---- Declare test ----
- include(CTest)
-@@ -116,16 +121,16 @@ target_compile_features(test_piper PUBLIC cxx_std_17)
- 
- target_include_directories(
-   test_piper PUBLIC
--  ${FMT_DIR}/include
--  ${SPDLOG_DIR}/include
--  ${PIPER_PHONEMIZE_DIR}/include
-+  ${FMT_INCLUDE_DIRS}
-+  ${SPDLOG_INCLUDE_DIRS}
-+  ${ONNXRUNTIME_INCLUDE_DIRS}
- )
- 
- target_link_directories(
-   test_piper PUBLIC
--  ${FMT_DIR}/lib
--  ${SPDLOG_DIR}/lib
--  ${PIPER_PHONEMIZE_DIR}/lib
-+  ${FMT_LIBRARY_DIRS}
-+  ${SPDLOG_LIBRARY_DIRS}
-+  ${ONNXRUNTIME_LIBRARY_DIRS}
- )
- 
- target_link_libraries(test_piper PUBLIC
-@@ -140,33 +145,5 @@ target_link_libraries(test_piper PUBLIC
- 
- install(
-   TARGETS piper
--  DESTINATION ${CMAKE_INSTALL_PREFIX})
--
--# Dependencies
--install(
--  DIRECTORY ${PIPER_PHONEMIZE_DIR}/bin/
--  DESTINATION ${CMAKE_INSTALL_PREFIX}
--  USE_SOURCE_PERMISSIONS  # keep +x
--  FILES_MATCHING
--  PATTERN "piper_phonemize"
--  PATTERN "espeak-ng"
--  PATTERN "*.dll"
--)
--
--install(
--  DIRECTORY ${PIPER_PHONEMIZE_DIR}/lib/
--  DESTINATION ${CMAKE_INSTALL_PREFIX}
--  FILES_MATCHING
--  PATTERN "*.dll"
--  PATTERN "*.so*"
--)
--
--install(
--  DIRECTORY ${PIPER_PHONEMIZE_DIR}/share/espeak-ng-data
--  DESTINATION ${CMAKE_INSTALL_PREFIX}
--)
--
--install(
--  FILES ${PIPER_PHONEMIZE_DIR}/share/libtashkeel_model.ort
--  DESTINATION ${CMAKE_INSTALL_PREFIX}
-+  DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
- )
diff --git a/audio/piper/files/patch-libpiper_CMakeLists.txt b/audio/piper/files/patch-libpiper_CMakeLists.txt
new file mode 100644
index 000000000000..e9743da620ee
--- /dev/null
+++ b/audio/piper/files/patch-libpiper_CMakeLists.txt
@@ -0,0 +1,198 @@
+--- libpiper/CMakeLists.txt.orig	2026-09-04 16:40:50 UTC
++++ libpiper/CMakeLists.txt	2026-09-04 16:40:50 UTC
+@@ -5,138 +5,15 @@
+ set(CMAKE_CXX_STANDARD 17)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
+ 
+-include(ExternalProject)
++# ---- espeak-ng (system) ----
+ 
+-# Install location for espeak-ng
+-set(ESPEAKNG_BUILD_DIR ${CMAKE_BINARY_DIR}/espeak_ng)
+-set(ESPEAKNG_INSTALL_DIR ${CMAKE_BINARY_DIR}/espeak_ng-install)
++find_package(PkgConfig REQUIRED)
++pkg_check_modules(ESPEAKNG REQUIRED IMPORTED_TARGET espeak-ng)
+ 
+-# ucd-tools is built (not installed) by espeak-ng, so we reference its static
+-# library directly from the build tree. Multi-config generators (e.g. Visual
+-# Studio) place the output in a per-config subdirectory whose name is only
+-# known at build time, so resolve it with a $<CONFIG> generator expression.
+-# Single-config generators (Unix Makefiles, Ninja) write directly into the
+-# build directory with no subdirectory.
+-get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+-if(IS_MULTI_CONFIG)
+-    set(UCD_CONFIG_SUBDIR "$<CONFIG>/")
+-else()
+-    set(UCD_CONFIG_SUBDIR "")
+-endif()
++# ---- onnxruntime (system) ----
+ 
+-set(UCD_TOOLS_DIR ${ESPEAKNG_BUILD_DIR}/src/espeak_ng_external-build/src/ucd-tools)
++find_package(onnxruntime REQUIRED)
+ 
+-if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+-    # MSVC emits .lib files (espeak-ng is re-exported from piper.dll)
+-    set(ESPEAKNG_STATIC_LIB ${ESPEAKNG_INSTALL_DIR}/lib/espeak-ng.lib)
+-    set(UCD_STATIC_LIB ${UCD_TOOLS_DIR}/${UCD_CONFIG_SUBDIR}ucd.lib)
+-else()
+-    set(ESPEAKNG_STATIC_LIB ${ESPEAKNG_INSTALL_DIR}/lib/libespeak-ng.a)
+-    set(UCD_STATIC_LIB ${UCD_TOOLS_DIR}/${UCD_CONFIG_SUBDIR}libucd.a)
+-endif()
+-
+-ExternalProject_Add(espeak_ng_external
+-    GIT_REPOSITORY https://github.com/espeak-ng/espeak-ng.git
+-    GIT_TAG 212928b394a96e8fd2096616bfd54e17845c48f6  # 2025-Mar-22
+-    PREFIX ${ESPEAKNG_BUILD_DIR}
+-    CMAKE_ARGS
+-        -DCMAKE_INSTALL_PREFIX=${ESPEAKNG_INSTALL_DIR}
+-        -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+-        -DBUILD_SHARED_LIBS:BOOL=OFF
+-        -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
+-        -DUSE_ASYNC:BOOL=OFF
+-        -DUSE_MBROLA:BOOL=OFF
+-        -DUSE_LIBSONIC:BOOL=OFF
+-        -DUSE_LIBPCAUDIO:BOOL=OFF
+-        -DUSE_KLATT:BOOL=OFF
+-        -DUSE_SPEECHPLAYER:BOOL=OFF
+-        -DEXTRA_cmn:BOOL=ON
+-        -DEXTRA_ru:BOOL=ON
+-        # Need to explicitly add ucd include directory for CI
+-        "-DCMAKE_C_FLAGS=-D_FILE_OFFSET_BITS=64 -I${ESPEAKNG_BUILD_DIR}/src/espeak_ng_external/src/ucd-tools/src/include"
+-        "-DCMAKE_CXX_FLAGS=-D_FILE_OFFSET_BITS=64 -I${ESPEAKNG_BUILD_DIR}/src/espeak_ng_external/src/ucd-tools/src/include"
+-    BUILD_BYPRODUCTS
+-        ${ESPEAKNG_STATIC_LIB}
+-        ${UCD_STATIC_LIB}
+-    UPDATE_DISCONNECTED TRUE
+-)
+-
+-include_directories(
+-    ${ESPEAKNG_INSTALL_DIR}/include
+-)
+-
+-# ---- onnxruntime ---
+-
+-find_package(onnxruntime QUIET)
+-
+-# Look for onnxruntime files in <root>/lib
+-if(NOT TARGET onnxruntime::onnxruntime AND NOT DEFINED ONNXRUNTIME_DIR)
+-    if(NOT DEFINED ONNXRUNTIME_VERSION)
+-        set(ONNXRUNTIME_VERSION "1.22.0")
+-    endif()
+-
+-    if(WIN32)
+-        # Windows x86-64
+-        set(ONNXRUNTIME_PREFIX "onnxruntime-win-x64-${ONNXRUNTIME_VERSION}")
+-        set(ONNXRUNTIME_EXT "zip")
+-    elseif (APPLE)
+-        if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
+-            # MacOS x86-64
+-            set(ONNXRUNTIME_PREFIX "onnxruntime-osx-x86_64-${ONNXRUNTIME_VERSION}")
+-        elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL arm64)
+-            # MacOS Apple Silicon
+-            set(ONNXRUNTIME_PREFIX "onnxruntime-osx-arm64-${ONNXRUNTIME_VERSION}")
+-        else()
+-            message(FATAL_ERROR "Unsupported architecture for onnxruntime")
+-        endif()
+-
+-        set(ONNXRUNTIME_EXT "tgz")
+-    else()
+-        if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
+-            # Linux x86-64
+-            set(ONNXRUNTIME_PREFIX "onnxruntime-linux-x64-${ONNXRUNTIME_VERSION}")
+-        elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64)
+-            # Linux ARM 64-bit
+-            set(ONNXRUNTIME_PREFIX "onnxruntime-linux-aarch64-${ONNXRUNTIME_VERSION}")
+-        elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL armv7l)
+-            # Linux ARM 32-bit
+-            set(ONNXRUNTIME_PREFIX "onnxruntime-linux-arm32-${ONNXRUNTIME_VERSION}")
+-            set(ONNXRUNTIME_URL "https://github.com/synesthesiam/prebuilt-apps/releases/download/v1.0/onnxruntime-linux-arm32-${ONNXRUNTIME_VERSION}.tgz")
+-        else()
+-            message(FATAL_ERROR "Unsupported architecture for onnxruntime")
+-        endif()
+-
+-        set(ONNXRUNTIME_EXT "tgz")
+-    endif()
+-
+-    if(NOT DEFINED ONNXRUNTIME_URL)
+-        set(ONNXRUNTIME_URL "https://github.com/microsoft/onnxruntime/releases/download/v${ONNXRUNTIME_VERSION}/${ONNXRUNTIME_PREFIX}.${ONNXRUNTIME_EXT}")
+-    endif()
+-
+-    set(ONNXRUNTIME_FILENAME "${ONNXRUNTIME_PREFIX}.${ONNXRUNTIME_EXT}")
+-    set(ONNXRUNTIME_DIR "${CMAKE_CURRENT_LIST_DIR}/lib/${ONNXRUNTIME_PREFIX}")
+-
+-    if(NOT EXISTS "${ONNXRUNTIME_DIR}")
+-        if(NOT EXISTS "download/${ONNXRUNTIME_FILENAME}")
+-            # Download onnxruntime release
+-            message("Downloading ${ONNXRUNTIME_URL}")
+-            file(DOWNLOAD "${ONNXRUNTIME_URL}" "download/${ONNXRUNTIME_FILENAME}")
+-        endif()
+-
+-        # Extract .zip or .tgz to a directory like lib/onnxruntime-linux-x64-1.22.0/
+-        file(ARCHIVE_EXTRACT INPUT "download/${ONNXRUNTIME_FILENAME}" DESTINATION "${CMAKE_CURRENT_LIST_DIR}/lib")
+-    endif()
+-endif()
+-
+-if(DEFINED ONNXRUNTIME_DIR)
+-    find_library(ONNXRUNTIME_LIB NAMES onnxruntime PATHS ${ONNXRUNTIME_DIR}/lib REQUIRED)
+-    add_library(onnxruntime::onnxruntime UNKNOWN IMPORTED)
+-    set_target_properties(onnxruntime::onnxruntime PROPERTIES
+-        IMPORTED_LOCATION ${ONNXRUNTIME_LIB}
+-        INTERFACE_INCLUDE_DIRECTORIES ${ONNXRUNTIME_DIR}/include
+-    )
+-endif()
+-
+ # ---- linting ----
+ include(ClangTidy.cmake)
+ # ---- libpiper ---
+@@ -147,14 +24,11 @@
+ )
+ enable_clang_tidy(piper)
+ 
+-add_dependencies(piper espeak_ng_external)
+ target_include_directories(piper PUBLIC
+-    ${ESPEAKNG_INSTALL_DIR}/include
+     ${CMAKE_CURRENT_SOURCE_DIR}/include
+ )
+ target_link_libraries(piper
+-    ${ESPEAKNG_STATIC_LIB}
+-    ${UCD_STATIC_LIB}
++    PkgConfig::ESPEAKNG
+     onnxruntime::onnxruntime
+ )
+ 
+@@ -169,6 +43,11 @@
+ if(PIPER_VERSION)
+   message(STATUS "Parsed Piper Version: ${PIPER_VERSION}")
+   target_compile_definitions(piper PRIVATE PIPER_VERSION="${PIPER_VERSION}")
++
++  string(REGEX MATCH "^([0-9]+)" PIPER_SOVERSION "${PIPER_VERSION}")
++  set_target_properties(piper PROPERTIES
++      VERSION ${PIPER_VERSION}
++      SOVERSION ${PIPER_SOVERSION})
+ else()
+   message(WARNING "Could not parse version from setup.py")
+ endif()
+@@ -190,23 +69,6 @@
+     DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+ )
+ 
+-if(DEFINED ONNXRUNTIME_DIR)
+-    install(
+-        DIRECTORY ${ONNXRUNTIME_DIR}/lib/
+-        DESTINATION ${CMAKE_INSTALL_LIBDIR}
+-        PATTERN "cmake" EXCLUDE
+-        PATTERN "pkgconfig" EXCLUDE
+-    )
+-endif()
+-
+-# Copy espeak-ng-data
+-set(ESPEAKNG_DATA_SRC ${CMAKE_BINARY_DIR}/espeak_ng-install/share/espeak-ng-data)
+-
+-install(
+-    DIRECTORY ${ESPEAKNG_DATA_SRC}
+-    DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}
+-)
+-
+ # ----------------
+ # Testing
+ # ----------------
diff --git a/audio/piper/files/patch-libpiper_src_main_CMakeLists.txt b/audio/piper/files/patch-libpiper_src_main_CMakeLists.txt
new file mode 100644
index 000000000000..638a4ca1da6e
--- /dev/null
+++ b/audio/piper/files/patch-libpiper_src_main_CMakeLists.txt
@@ -0,0 +1,22 @@
+--- libpiper/src/main/CMakeLists.txt.orig	2026-09-04 16:40:50 UTC
++++ libpiper/src/main/CMakeLists.txt	2026-09-04 16:40:50 UTC
+@@ -1,6 +1,8 @@
+ cmake_minimum_required(VERSION 3.26)
+ 
+ add_executable(piper_exe main.cpp)
++
++set_target_properties(piper_exe PROPERTIES OUTPUT_NAME piper)
+ enable_clang_tidy(piper_exe)
+ 
+ add_library(main_utils
+@@ -26,6 +28,10 @@
+ 
+ target_link_libraries(piper_exe PRIVATE piper main_utils)
+ 
++target_compile_definitions(
++  piper_exe
++  PRIVATE PIPER_ESPEAK_DATA_DIR="${CMAKE_INSTALL_PREFIX}/share/espeak-ng/espeak-ng-data")
++
+ install(
+   TARGETS piper_exe
+   RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
diff --git a/audio/piper/files/patch-libpiper_src_main_main.cpp b/audio/piper/files/patch-libpiper_src_main_main.cpp
new file mode 100644
index 000000000000..648f16d49b03
--- /dev/null
+++ b/audio/piper/files/patch-libpiper_src_main_main.cpp
@@ -0,0 +1,33 @@
+--- libpiper/src/main/main.cpp.orig	2026-09-04 16:40:50 UTC
++++ libpiper/src/main/main.cpp	2026-09-04 16:40:50 UTC
+@@ -44,6 +44,7 @@
+ 
+     // Get the path to the piper executable so we can locate espeak-ng-data,
+     // etc. next to it.
++#ifndef PIPER_ESPEAK_DATA_DIR
+ #ifdef _MSC_VER
+     auto exePath = []() -> filesystem::path {
+       wchar_t moduleFileName[MAX_PATH] = {0};
+@@ -63,16 +64,22 @@
+     auto exePath = filesystem::canonical("/proc/self/exe");
+ #endif
+ #endif
++#endif
+ 
+     if (runConfig.eSpeakDataPath) {
+       // User provided path
+       // No change needed, it's already a path
+     } else {
++#ifdef PIPER_ESPEAK_DATA_DIR
++      // Use the espeak-ng data directory installed by the system package
++      runConfig.eSpeakDataPath = PIPER_ESPEAK_DATA_DIR;
++#else
+       // Assume next to piper executable
+       runConfig.eSpeakDataPath =
+           std::filesystem::absolute(
+               exePath.parent_path().append("espeak-ng-data"))
+               .string();
++#endif
+     }
+     if (!runConfig.eSpeakDataPath.has_value()) {
+       throw std::runtime_error("eSpeak data path not set");
diff --git a/audio/piper/files/patch-src_cpp_piper.cpp b/audio/piper/files/patch-src_cpp_piper.cpp
deleted file mode 100644
index 51f672629560..000000000000
--- a/audio/piper/files/patch-src_cpp_piper.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
---- src/cpp/piper.cpp.orig
-+++ src/cpp/piper.cpp
-@@ -6,7 +6,7 @@
- #include <stdexcept>
- 
- #include <espeak-ng/speak_lib.h>
--#include <onnxruntime_cxx_api.h>
-+#include <onnxruntime/onnxruntime_cxx_api.h>
- #include <spdlog/spdlog.h>
- 
- #include "json.hpp"
-@@ -229,22 +229,6 @@ void initialize(PiperConfig &config) {
-     spdlog::debug("Initialized eSpeak");
-   }
- 
--  // Load onnx model for libtashkeel
--  // https://github.com/mush42/libtashkeel/
--  if (config.useTashkeel) {
--    spdlog::debug("Using libtashkeel for diacritization");
--    if (!config.tashkeelModelPath) {
--      throw std::runtime_error("No path to libtashkeel model");
--    }
--
--    spdlog::debug("Loading libtashkeel model from {}",
--                  config.tashkeelModelPath.value());
--    config.tashkeelState = std::make_unique<tashkeel::State>();
--    tashkeel::tashkeel_load(config.tashkeelModelPath.value(),
--                            *config.tashkeelState);
--    spdlog::debug("Initialized libtashkeel");
--  }
--
-   spdlog::info("Initialized piper");
- }
- 
-@@ -447,15 +431,6 @@ void textToAudio(PiperConfig &config, Voice &voice, std::string text,
-         voice.synthesisConfig.sampleRate * voice.synthesisConfig.channels);
-   }
- 
--  if (config.useTashkeel) {
--    if (!config.tashkeelState) {
--      throw std::runtime_error("Tashkeel model is not loaded");
--    }
--
--    spdlog::debug("Diacritizing text with libtashkeel: {}", text);
--    text = tashkeel::tashkeel_run(text, *config.tashkeelState);
--  }
--
-   // Phonemes for each sentence
-   spdlog::debug("Phonemizing text: {}", text);
-   std::vector<std::vector<Phoneme>> phonemes;
---- src/cpp/piper.hpp.orig
-+++ src/cpp/piper.hpp
-@@ -8,7 +8,7 @@
- #include <string>
- #include <vector>
- 
--#include <onnxruntime_cxx_api.h>
-+#include <onnxruntime/onnxruntime_cxx_api.h>
- #include <piper-phonemize/phoneme_ids.hpp>
- #include <piper-phonemize/phonemize.hpp>
- #include <piper-phonemize/tashkeel.hpp>
diff --git a/audio/piper/pkg-descr b/audio/piper/pkg-descr
index cad20f548b02..46b1a1dcd867 100644
--- a/audio/piper/pkg-descr
+++ b/audio/piper/pkg-descr
@@ -1,2 +1,3 @@
-A fast, local neural text to speech system that sounds great and is optimized
-for the Raspberry Pi 4. Piper is used in a variety of projects.
+Piper is a fast and local neural text-to-speech engine that embeds espeak-ng
+for phonemization. It is used in a variety of projects and runs well on
+single-board computers.