Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flite text-to-speech recipe #21976

Merged
merged 8 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions recipes/flite/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set -exou

./configure --with-vox=cmu_us_kal16 --enable-shared --prefix="$(pwd)/build"

make

ocefpaf marked this conversation as resolved.
Show resolved Hide resolved
make install
5 changes: 5 additions & 0 deletions recipes/flite/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set -exou

mkdir -p "${PREFIX}/lib"

cp -P build/lib/lib*.so.* "${PREFIX}/lib/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use SHLIB_EXT instead of .so to catch the macOS .dylib too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can check the latest build. It doesn't seem to build shared libs on Mac. There is even an open PR for that: festvox/flite#94 . But again, I'm not very much into maintaining unmerged PRs. So I'd suggest reverting the latest commit and distributing the shared libs only on linux.

6 changes: 6 additions & 0 deletions recipes/flite/install_bin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set -exou

mkdir -p "${PREFIX}/bin"

cp build/bin/flite* ${PREFIX}/bin/
cp bin/t2p ${PREFIX}/bin/
7 changes: 7 additions & 0 deletions recipes/flite/install_devel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set -exou

mkdir -p "${PREFIX}/include/"
mkdir -p "${PREFIX}/lib"

cp -a build/include/flite "${PREFIX}/include/"
cp -P build/lib/lib*.so "${PREFIX}/lib/"
peci1 marked this conversation as resolved.
Show resolved Hide resolved
89 changes: 89 additions & 0 deletions recipes/flite/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{% set name = "flite-tts" %}
{% set version = "2.3.0" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
url: https://github.com/festvox/flite/archive/6c9f20dc915b17f5619340069889db0aa007fcdc.tar.gz
sha256: 5d23a2c6248568708aff4996015baed49f02ccc2ec4de17de3b9e13b95491ce6

build:
skip: True # [win]
number: 0

requirements:
build:
- {{ compiler('c') }}
- make

outputs:

- name: libflite
script: install.sh
build:
skip: True # [not linux]
run_exports:
- {{ pin_subpackage('libflite', max_pin='x.x') }}
requirements:
build:
- {{ compiler('c') }}
test:
commands:
- test -f $PREFIX/lib/libflite.so.2.3 # [linux]
- test -f $PREFIX/lib/libflite_usenglish.so.2.3 # [linux]
peci1 marked this conversation as resolved.
Show resolved Hide resolved

- name: flite-dev
script: install_devel.sh
build:
skip: True # [not linux]
run_exports:
- {{ pin_subpackage('libflite', max_pin='x.x') }}
requirements:
build:
- {{ compiler('c') }}
run:
- {{ pin_subpackage("libflite", exact=True) }}
test:
commands:
- test -f $PREFIX/include/flite/flite.h # [linux]
- test -f $PREFIX/lib/libflite.so # [linux]
- test -f $PREFIX/lib/libflite_usenglish.so # [linux]
peci1 marked this conversation as resolved.
Show resolved Hide resolved

- name: flite
script: install_bin.sh # [not win]
requirements:
build:
- {{ compiler('c') }}
host:
- {{ pin_subpackage("libflite", exact=True) }} # [linux]
run:
- {{ pin_subpackage("libflite", exact=True) }} # [linux]
test:
commands:
- test -f $PREFIX/bin/flite # [not win]
- test -f $PREFIX/bin/flite_time # [not win]
- test -f $PREFIX/bin/t2p # [not win]
- flite -t test -o /dev/stdout # [not win]
- sh -c "flite -t test -o /dev/stdout | grep -vi error" # [not win]

about:
home: http://cmuflite.org
summary: 'A small fast portable speech synthesis system '
description: |
Flite is an open source small fast run-time text to speech engine. It is
the latest addition to the suite of free software synthesis tools
including University of Edinburgh's Festival Speech Synthesis System and
Carnegie Mellon University's FestVox project, tools, scripts and
documentation for building synthetic voices. However, flite itself does
not require either of these systems to compile and run.
license: BSD-4-Clause
license_family: BSD
license_file: COPYING
doc_url: http://cmuflite.org
dev_url: https://github.com/festvox/flite

extra:
recipe-maintainers:
- peci1