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 \ |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 9 | file://0001-Drop-using-register-keyword-for-storage-classifier.patch \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 10 | " |
| 11 | SRC_URI[md5sum] = "cadd7482eaafe9239546bdc09fa244c3" |
| 12 | SRC_URI[sha256sum] = "bf9a17673adffcc28ff7ea18764f06136547e97bbd9edf2ec612f09b207f0659" |
| 13 | |
| 14 | S = "${WORKDIR}/espeak-${PV}-source" |
| 15 | |
| 16 | DEPENDS = "portaudio-v19 qemu-helper-native" |
| 17 | inherit siteinfo qemu |
| 18 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 19 | |
| 20 | CXXFLAGS += "-DUSE_PORTAUDIO" |
| 21 | TARGET_CC_ARCH += "${LDFLAGS}" |
| 22 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 23 | FILES:${PN} += "${datadir}/espeak-data" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 24 | |
| 25 | do_configure() { |
| 26 | # "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] | 27 | install -m 0644 "${S}/src/portaudio19.h" "${S}/src/portaudio.h" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 28 | } |
| 29 | |
| 30 | do_compile() { |
| 31 | cd src |
| 32 | oe_runmake |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 33 | |
| 34 | cd "${S}/platforms/big_endian" |
| 35 | qemu_binary="${@qemu_wrapper_cmdline(d, '${STAGING_DIR_TARGET}', ['${S}/platforms/big_endian', '${STAGING_DIR_TARGET}${base_libdir}'])}" |
| 36 | cat >qemuwrapper <<EOF |
| 37 | #!/bin/sh |
| 38 | $qemu_binary "\$@" |
| 39 | EOF |
| 40 | chmod +x qemuwrapper |
| 41 | sed -i '/^ *CC *=/d' Makefile |
| 42 | # Fixing byte order of phoneme data files |
| 43 | if [ "${SITEINFO_ENDIANNESS}" = "be" ]; then |
| 44 | sed -i 's/\(.*BYTE_ORDER\)/#undef BYTE_ORDER\n#define BYTE_ORDER BIG_ENDIAN\n\1/' espeak-phoneme-data.c |
| 45 | else |
| 46 | sed -i 's/\(.*BYTE_ORDER\)/#undef BYTE_ORDER\n#define BYTE_ORDER LITTLE_ENDIAN\n\1/' espeak-phoneme-data.c |
| 47 | fi |
| 48 | oe_runmake |
| 49 | ./qemuwrapper ./espeak-phoneme-data "${S}/espeak-data" "." "${S}/espeak-data/phondata-manifest" |
| 50 | cp -f phondata phonindex phontab "${S}/espeak-data" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 51 | } |
| 52 | |
| 53 | do_install() { |
| 54 | install -d ${D}${bindir} |
| 55 | install -d ${D}${libdir} |
| 56 | install -d ${D}${includedir}/espeak |
| 57 | install -d ${D}${datadir}/espeak-data |
| 58 | |
| 59 | # we do not ship "speak" binary though. |
| 60 | install -m 0755 ${S}/src/espeak ${D}${bindir} |
| 61 | install -m 0644 ${S}/src/speak_lib.h ${D}${includedir}/espeak/ |
| 62 | ln -sf espeak/espeak.h ${D}${includedir}/ |
| 63 | oe_libinstall -so -C src libespeak ${D}${libdir} |
| 64 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 65 | 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] | 66 | } |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 67 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 68 | RDEPENDS:${PN} = "portaudio-v19" |