# Copyright 1999-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 # OVERLAY NOTE -- WHY THIS IS HERE. # # A temporary mirror. app-text/calibre[piper] (the neural Read aloud engine, # Piper and Kokoro voices) calls espeak_TextToPhonemesWithTerminator(), which # no espeak-ng release has: ::gentoo's newest is 1.52.0 (2024-12), and calibre # itself pins commit a4ca101c (2025-07-12) in bypy/sources.json for that # reason. This snapshot is that exact commit, so the one combination upstream # tests is the one users get. # # The ebuild is ::gentoo's espeak-ng-9999, whose *_p* branch already exists; # the only changes are HASH_COMMIT and the KEYWORDS that branch lacks. Remove # this package once ::gentoo ships a release that has the function (1.53 or # later), then drop the floor on it in app-text/calibre. # # gentoo-parity.sh compares against ::gentoo's 1.52.0, which still builds with # autotools; upstream moved to CMake before a4ca101c, and so did ::gentoo's # 9999. Every axis below follows from that one change, carried verbatim: # BENTOO-DIVERGENCE: INHERIT - cmake toolchain-funcs instead of autotools. # BENTOO-DIVERGENCE: DEFINED_PHASES - src_compile, for the cross-build native # espeak-ng-bin that the CMake build needs to compile intonations. # BENTOO-DIVERGENCE: IUSE - sonic is new in the CMake build; async and man # were autotools switches with no CMake counterpart. # BENTOO-DIVERGENCE: DEPEND - sonic? ( media-libs/sonic:= ), same flag. # BENTOO-DIVERGENCE: RDEPEND - the same sonic dependency; media-sound/sox is # gone because the CMake build no longer shells out to it. # BENTOO-DIVERGENCE: BDEPEND - cmake/ninja via the eclass, instead of the # autotools chain, ronn-ng (man page is prebuilt, see MAN_VERS) and which. # BENTOO-DIVERGENCE: metadata.xml - this overlay as maintainer, a # longdescription saying why the mirror exists, and no async/man flags. CMAKE_QA_COMPAT_SKIP=1 #android/jni/CMakeLists.txt inherit cmake toolchain-funcs MAN_VERS="1.51" DESCRIPTION="Software speech synthesizer for English, and some other languages" HOMEPAGE="https://github.com/espeak-ng/espeak-ng" if [[ ${PV} == *9999* ]]; then EGIT_REPO_URI="https://github.com/espeak-ng/espeak-ng.git" inherit git-r3 elif [[ ${PV} == *_p* ]]; then HASH_COMMIT="a4ca101c99de35345f89df58195b2159748b7092" SRC_URI="https://github.com/espeak-ng/espeak-ng/archive/${HASH_COMMIT}.tar.gz -> ${P}.tar.gz" S="${WORKDIR}/${PN}-${HASH_COMMIT}" # BENTOO-DIVERGENCE: KEYWORDS - ::gentoo's *_p* branch sets none (it has # no snapshot in the tree); same list as its release branch below. KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86" else SRC_URI="https://github.com/espeak-ng/espeak-ng/archive/${PV}.tar.gz -> ${P}.tar.gz" KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86" fi LICENSE="GPL-3+ unicode" SLOT="0" IUSE="+klatt mbrola sonic +sound test" IUSE+=" l10n_ru l10n_zh" # BENTOO-DIVERGENCE: REQUIRED_USE - media-libs/sonic has no ~loong keyword, # which ::gentoo's 9999 never meets because it sets no KEYWORDS at all. The # flag is off by default; pkgcheck's solver ignores REQUIRED_USE and still # reports NonsolvableDeps for loong, and an overlay cannot mask a flag per arch. REQUIRED_USE="loong? ( !sonic )" RESTRICT="!test? ( test )" DEPEND=" mbrola? ( app-accessibility/mbrola ) sonic? ( media-libs/sonic:= ) sound? ( media-libs/pcaudiolib ) " RDEPEND="${DEPEND} !app-accessibility/espeak " BDEPEND="virtual/pkgconfig" if [[ ${PV} == *9999* ]]; then BDEPEND+=" app-text/ronn-ng" fi DOCS=( ChangeLog.md README.md docs ) # BENTOO-DIVERGENCE: PATCHES - ::gentoo's 9999 builds master, which already # has these two upstream commits; a4ca101c predates them, and without them # espeak-ng.pc lands in /usr/lib/pkgconfig with libdir=/usr/lib on lib64 # systems, so pkg-config stops finding espeak-ng for every reverse dependency. PATCHES=( "${FILESDIR}/${PN}-cmake-gnuinstalldirs.patch" ) src_prepare() { cmake_src_prepare if [[ ${PV} != *9999* ]]; then cp "${FILESDIR}"/${PN}.1-${MAN_VERS} "${S}"/docs/${PN}.1 || die fi # BENTOO-DIVERGENCE: src_prepare - drop the SSML