blob: 0dc61c1c30e4eae1594b23cb8e720633be68acdf [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001DESCRIPTION = "eSpeak is a compact open source software speech synthesizer"
2SECTION = "base"
Andrew Geissler9aee5002022-03-30 16:27:02 +00003LICENSE = "GPL-3.0-only"
Brad Bishop19323692019-04-05 15:28:33 -04004LIC_FILES_CHKSUM = "file://License.txt;md5=cb7a20edb4c9f5f478de6523dcd7362c"
Brad Bishopd7bf8c12018-02-25 22:55:05 -05005
Brad Bishop19323692019-04-05 15:28:33 -04006SRC_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"
10SRC_URI[md5sum] = "cadd7482eaafe9239546bdc09fa244c3"
11SRC_URI[sha256sum] = "bf9a17673adffcc28ff7ea18764f06136547e97bbd9edf2ec612f09b207f0659"
12
13S = "${WORKDIR}/espeak-${PV}-source"
14
15DEPENDS = "portaudio-v19 qemu-helper-native"
16inherit siteinfo qemu
17
Brad Bishopd7bf8c12018-02-25 22:55:05 -050018
19CXXFLAGS += "-DUSE_PORTAUDIO"
20TARGET_CC_ARCH += "${LDFLAGS}"
21
Patrick Williams213cb262021-08-07 19:21:33 -050022FILES:${PN} += "${datadir}/espeak-data"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050023
24do_configure() {
25 # "speak" binary, a TTS engine, uses portaudio in either APIs V18 or V19, use V19
Brad Bishop19323692019-04-05 15:28:33 -040026 install -m 0644 "${S}/src/portaudio19.h" "${S}/src/portaudio.h"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050027}
28
29do_compile() {
30 cd src
31 oe_runmake
Brad Bishop19323692019-04-05 15:28:33 -040032
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 "\$@"
38EOF
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 Bishopd7bf8c12018-02-25 22:55:05 -050050}
51
52do_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 Bishop1a4b7ee2018-12-16 17:11:34 -080064 cp -R --no-dereference --preserve=mode,links ${S}/espeak-data/* ${D}${datadir}/espeak-data
Brad Bishopd7bf8c12018-02-25 22:55:05 -050065}
Brad Bishop19323692019-04-05 15:28:33 -040066
Patrick Williams213cb262021-08-07 19:21:33 -050067RDEPENDS:${PN} = "portaudio-v19"