espeak_1.48.04.bb 2.3 KB

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