Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | DESCRIPTION = "eSpeak is a compact open source software speech synthesizer" |
| 2 | SECTION = "base" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 3 | LICENSE = "GPL-3.0-only" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 4 | LIC_FILES_CHKSUM = "file://License.txt;md5=cb7a20edb4c9f5f478de6523dcd7362c" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 5 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 6 | SRC_URI = "http://downloads.sourceforge.net/espeak/espeak-1.48.04-source.zip \ |
| 7 | file://0001-Fix-build-of-shared-library-on-architectures-needing.patch \ |
| 8 | file://0002-tr_languages-cast-string_ordinal-init-values.patch \ |
| 9 | " |
| 10 | SRC_URI[md5sum] = "cadd7482eaafe9239546bdc09fa244c3" |
| 11 | SRC_URI[sha256sum] = "bf9a17673adffcc28ff7ea18764f06136547e97bbd9edf2ec612f09b207f0659" |
| 12 | |
| 13 | S = "${WORKDIR}/espeak-${PV}-source" |
| 14 | |
| 15 | DEPENDS = "portaudio-v19 qemu-helper-native" |
| 16 | inherit siteinfo qemu |
| 17 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 18 | |
| 19 | CXXFLAGS += "-DUSE_PORTAUDIO" |
| 20 | TARGET_CC_ARCH += "${LDFLAGS}" |
| 21 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 22 | FILES:${PN} += "${datadir}/espeak-data" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 23 | |
| 24 | do_configure() { |
| 25 | # "speak" binary, a TTS engine, uses portaudio in either APIs V18 or V19, use V19 |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 26 | install -m 0644 "${S}/src/portaudio19.h" "${S}/src/portaudio.h" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | do_compile() { |
| 30 | cd src |
| 31 | oe_runmake |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 32 | |
| 33 | cd "${S}/platforms/big_endian" |
| 34 | qemu_binary="${@qemu_wrapper_cmdline(d, '${STAGING_DIR_TARGET}', ['${S}/platforms/big_endian', '${STAGING_DIR_TARGET}${base_libdir}'])}" |
| 35 | cat >qemuwrapper <<EOF |
| 36 | #!/bin/sh |
| 37 | $qemu_binary "\$@" |
| 38 | EOF |
| 39 | chmod +x qemuwrapper |
| 40 | sed -i '/^ *CC *=/d' Makefile |
| 41 | # Fixing byte order of phoneme data files |
| 42 | if [ "${SITEINFO_ENDIANNESS}" = "be" ]; then |
| 43 | sed -i 's/\(.*BYTE_ORDER\)/#undef BYTE_ORDER\n#define BYTE_ORDER BIG_ENDIAN\n\1/' espeak-phoneme-data.c |
| 44 | else |
| 45 | sed -i 's/\(.*BYTE_ORDER\)/#undef BYTE_ORDER\n#define BYTE_ORDER LITTLE_ENDIAN\n\1/' espeak-phoneme-data.c |
| 46 | fi |
| 47 | oe_runmake |
| 48 | ./qemuwrapper ./espeak-phoneme-data "${S}/espeak-data" "." "${S}/espeak-data/phondata-manifest" |
| 49 | cp -f phondata phonindex phontab "${S}/espeak-data" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | do_install() { |
| 53 | install -d ${D}${bindir} |
| 54 | install -d ${D}${libdir} |
| 55 | install -d ${D}${includedir}/espeak |
| 56 | install -d ${D}${datadir}/espeak-data |
| 57 | |
| 58 | # we do not ship "speak" binary though. |
| 59 | install -m 0755 ${S}/src/espeak ${D}${bindir} |
| 60 | install -m 0644 ${S}/src/speak_lib.h ${D}${includedir}/espeak/ |
| 61 | ln -sf espeak/espeak.h ${D}${includedir}/ |
| 62 | oe_libinstall -so -C src libespeak ${D}${libdir} |
| 63 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 64 | cp -R --no-dereference --preserve=mode,links ${S}/espeak-data/* ${D}${datadir}/espeak-data |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 65 | } |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 66 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 67 | RDEPENDS:${PN} = "portaudio-v19" |