blob: 147a8069fa953bad014be2bcbde2289814f0710f [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 \
Andrew Geisslerc5535c92023-01-27 16:10:19 -06009 file://0001-Drop-using-register-keyword-for-storage-classifier.patch \
Brad Bishop19323692019-04-05 15:28:33 -040010"
11SRC_URI[md5sum] = "cadd7482eaafe9239546bdc09fa244c3"
12SRC_URI[sha256sum] = "bf9a17673adffcc28ff7ea18764f06136547e97bbd9edf2ec612f09b207f0659"
13
14S = "${WORKDIR}/espeak-${PV}-source"
15
16DEPENDS = "portaudio-v19 qemu-helper-native"
17inherit siteinfo qemu
18
Brad Bishopd7bf8c12018-02-25 22:55:05 -050019
20CXXFLAGS += "-DUSE_PORTAUDIO"
21TARGET_CC_ARCH += "${LDFLAGS}"
22
Patrick Williams213cb262021-08-07 19:21:33 -050023FILES:${PN} += "${datadir}/espeak-data"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050024
25do_configure() {
26 # "speak" binary, a TTS engine, uses portaudio in either APIs V18 or V19, use V19
Brad Bishop19323692019-04-05 15:28:33 -040027 install -m 0644 "${S}/src/portaudio19.h" "${S}/src/portaudio.h"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050028}
29
30do_compile() {
31 cd src
32 oe_runmake
Brad Bishop19323692019-04-05 15:28:33 -040033
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 "\$@"
39EOF
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 Bishopd7bf8c12018-02-25 22:55:05 -050051}
52
53do_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 Bishop1a4b7ee2018-12-16 17:11:34 -080065 cp -R --no-dereference --preserve=mode,links ${S}/espeak-data/* ${D}${datadir}/espeak-data
Brad Bishopd7bf8c12018-02-25 22:55:05 -050066}
Brad Bishop19323692019-04-05 15:28:33 -040067
Patrick Williams213cb262021-08-07 19:21:33 -050068RDEPENDS:${PN} = "portaudio-v19"