I've reworked the festival port a bit and would appreciate
testing and feedback.  Here's a list of the changes:

- Install the Edinburgh Speech Tools 

They're being built anyway, and they don't take much more space.
The festival documentation refers to these tools and dependent
programs will rely on them.

- Build shared libraries when possible

- Add a regress target, and allow the tests to run

- Fix the examples directory location in several places so that
  they may run.  

festival> (intro) 
festival> (intro-spanish)

work now.

- Add the email_filter script so that email mode works.

- Fix the speech tools location in generated scripts

The regress target depends on a number of voices and their
lexicons and dictionaries, so doing 'make regress' in
festival/core should be enough to get the festival system up and
running.  The tests don't use or check audio output, so if you'd
like to try that, just enter the test commands into the festival
interpreter, ie:

$ festival
festival> (tts "/usr/local/share/examples/festival/example2.sable" nil)
festival> (tts "/usr/local/share/examples/festival/ex1.ogi" 'ogimarkup)
festival> (tts "/usr/local/share/examples/festival/ex1.email" nil)
festival> (tts "/usr/local/share/examples/festival/songs/daisy.xml" 'singing)


Index: Makefile
===================================================================
RCS file: /cvs/ports/audio/festival/core/Makefile,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile
--- Makefile    3 Feb 2006 19:42:44 -0000       1.8
+++ Makefile    25 Dec 2006 19:28:36 -0000
@@ -3,7 +3,7 @@
 COMMENT=       "general multi-lingual speech synthesis system"
 V=             1.95
 DISTNAME=      festival-${V}-beta
-PKGNAME=       ${DISTNAME:S/-beta/beta/}p1
+PKGNAME=       ${DISTNAME:S/-beta/beta/}p2
 CATEGORIES=    audio
 MASTER_SITES=  http://www.cstr.ed.ac.uk/downloads/festival/${V}/ \
                http://festvox.org/packed/festival/${V}/
@@ -21,6 +21,9 @@ USE_GMAKE=    Yes
 SPEECH=                ${WRKSRC}/speech_tools
 FESTIVAL=      ${WRKSRC}/festival
 
+SHARED_LIBS=   eststring 1.2 \
+               estbase   1.2
+
 MAKE_ENV+=     CC="${CC}" \
                CXX="${CXX}" \
                CFLAGS="${CFLAGS}" \
@@ -36,6 +39,16 @@ MODGNU_CONFIG_GUESS_DIRS=${SPEECH} ${FES
 EXAMPLEDIR=    ${PREFIX}/share/examples/festival
 SHAREDIR=      ${PREFIX}/lib/festival
 
+REGRESS_DEPENDS=::audio/festival/core \
+               ::audio/festival/festvox/festvox_rablpc16k \
+               ::audio/festival/festvox/festvox_don \
+               ::audio/festival/festvox/festvox_kedlpc16k \
+               ::audio/festival/festvox/festvox_kallpc16k \
+               ::audio/festival/arctic/festvox_cmu_us_awb_arctic_hts \
+               ::audio/festival/arctic/festvox_cmu_us_bdl_arctic_hts \
+               ::audio/festival/arctic/festvox_cmu_us_jmk_arctic_hts \
+               ::audio/festival/arctic/festvox_cmu_us_slt_arctic_hts
+
 FLAVORS=       ogi
 FLAVOR?=
 
@@ -51,11 +64,28 @@ PERMIT_DISTFILES_CDROM?=Yes
 PERMIT_DISTFILES_FTP=  Yes
 PERMIT_PACKAGE_CDROM?= Yes
 PERMIT_PACKAGE_FTP=    Yes
+
 WANTLIB=               c m ossaudio stdc++ termcap
 
-post-patch:
+EST_BIN=               align bcat ch_lab ch_track ch_utt ch_wave \
+                       design_filter dp fringe_client na_play na_record \
+                       ngram_build ngram_test ols ols_test pda pitchmark \
+                       scfg_make scfg_parse scfg_test scfg_train sig2fv \
+                       sigfilter siod spectgen tilt_analysis tilt_synthesis \
+                       viterbi wagon wagon_test wfst_build wfst_run \
+                       wfst_train xml_parser
+
+pre-configure:
        @cp ${FILESDIR}/OpenBSD.mak 
${WRKSRC}/speech_tools/config/systems/OpenBSD.mak
        @cp ${FILESDIR}/Makefile ${WRKSRC}
+.if ${MACHINE_ARCH} != "m88k" && ${MACHINE_ARCH} != "vax"
+       @printf "SHARED=1\n" >> ${WRKSRC}/speech_tools/config/config.in
+.endif
+       @perl -pi -e "s,!!PREFIX!!,${PREFIX}," ${FESTIVAL}/config/config.in
+       @perl -pi -e "s,!!EXAMPLEDIR!!,${EXAMPLEDIR},g" 
${FESTIVAL}/lib/festival.scm \
+       ${FESTIVAL}/testsuite/data/modes.scm
+       @perl -pi -e "s,!!FESTIVAL!!,${FESTIVAL}/src/main/festival," 
${FESTIVAL}/src/scripts/shared_script
+       @perl -pi -e "s,!!EST!!,${PREFIX}," 
${FESTIVAL}/src/scripts/{festival_server.sh,festival_server_control.sh}
 
 do-configure:
        @cd ${FESTIVAL} && ${SETENV} ${CONFIGURE_ENV} ./configure 
${CONFIGURE_ARGS}
@@ -64,9 +94,6 @@ do-configure:
        @printf "ALSO_INCLUDE += OGIcommon\nALSO_INCLUDE += 
OGIdbase\nALSO_INCLUDE += OGIresLPC\n" >> ${FESTIVAL}/config/config
 .endif
 
-post-build:
-       @perl -pi -e s,'/bin/festival','${PREFIX}/bin/festival', 
${WRKBUILD}/festival/bin/text2wave
-
 do-install:
 .if ${FLAVOR:L:Mogi}
        ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/festival-ogi
@@ -76,12 +103,15 @@ do-install:
        ${INSTALL_DATA_DIR} ${EXAMPLEDIR}
        ${INSTALL_DATA_DIR} ${EXAMPLEDIR}/songs
        ${INSTALL_DATA_DIR} ${SHAREDIR}/multisyn
+       ${INSTALL_DATA_DIR} ${SHAREDIR}/etc
+
 .for EXT in dtd el ent gram ngrambin properties scm
        ${INSTALL_DATA} ${WRKSRC}/festival/lib/*.${EXT} ${SHAREDIR}
 .endfor
        ${INSTALL_DATA} ${WRKSRC}/festival/lib/multisyn/*.scm \
                ${SHAREDIR}/multisyn
        ${INSTALL_PROGRAM} ${FESTIVAL}/lib/etc/OpenBSD/audsp ${PREFIX}/bin
+       ${INSTALL_SCRIPT} ${FESTIVAL}/lib/etc/email_filter ${SHAREDIR}/etc/
        ${INSTALL_PROGRAM} ${FESTIVAL}/src/main/festival ${PREFIX}/bin
        ${INSTALL_PROGRAM} ${FESTIVAL}/src/main/festival_client ${PREFIX}/bin
        ${INSTALL_SCRIPT} ${FESTIVAL}/bin/festival_server ${PREFIX}/bin
@@ -97,5 +127,15 @@ do-install:
        ${INSTALL_DATA} ${FESTIVAL}/examples/festival_client.* ${EXAMPLEDIR}
        ${INSTALL_SCRIPT} 
${FESTIVAL}/examples/{dumpfeats,durmeanstd,latest,make_utts,saytime,scfg_parse_text,text2pos,text2wave}
 ${EXAMPLEDIR}
        ${INSTALL_DATA} ${FESTIVAL}/examples/songs/*.xml ${EXAMPLEDIR}/songs
+.for BIN in ${EST_BIN}
+       ${INSTALL_PROGRAM} ${SPEECH}/main/${BIN} ${PREFIX}/bin
+.endfor
+.if ${MACHINE_ARCH} != "m88k" && ${MACHINE_ARCH} != "vax"
+       ${INSTALL_DATA} ${SPEECH}/lib/*.so* ${PREFIX}/lib
+.endif
+
+do-regress:
+       cd ${SPEECH} && gmake test
+       cd ${FESTIVAL} && gmake test
 
 .include <bsd.port.mk>
Index: patches/patch-festival_config_config_in
===================================================================
RCS file: 
/cvs/ports/audio/festival/core/patches/patch-festival_config_config_in,v
retrieving revision 1.1
diff -u -p -r1.1 patch-festival_config_config_in
--- patches/patch-festival_config_config_in     11 Jul 2004 06:27:07 -0000      
1.1
+++ patches/patch-festival_config_config_in     25 Dec 2006 19:28:36 -0000
@@ -1,12 +1,12 @@
 $OpenBSD: patch-festival_config_config_in,v 1.1 2004/07/11 06:27:07 jolan Exp $
---- festival/config/config.in.orig     2001-04-04 08:12:35.000000000 -0500
-+++ festival/config/config.in  2004-05-06 15:33:21.000000000 -0500
+--- festival/config/config.in.orig     Mon Jun 21 16:52:42 2004
++++ festival/config/config.in  Wed Oct  4 21:58:23 2006
 @@ -20,7 +20,7 @@ EST=$(TOP)/../speech_tools
  ## You may need to set this explicitly if automounter or NFS
  ## side effects cause problems
  
 -FESTIVAL_HOME := $(shell (cd $(TOP); pwd))
-+FESTIVAL_HOME := $(PKG_FESTIVAL_HOME)
++FESTIVAL_HOME = !!PREFIX!!
  
  ###########################################################################
  ## Feature selection.
Index: patches/patch-festival_doc_Makefile
===================================================================
RCS file: /cvs/ports/audio/festival/core/patches/patch-festival_doc_Makefile,v
retrieving revision 1.1
diff -u -p -r1.1 patch-festival_doc_Makefile
--- patches/patch-festival_doc_Makefile 11 Jul 2004 06:27:07 -0000      1.1
+++ patches/patch-festival_doc_Makefile 25 Dec 2006 19:28:36 -0000
@@ -1,24 +1,12 @@
-$OpenBSD: patch-festival_doc_Makefile,v 1.1 2004/07/11 06:27:07 jolan Exp $
---- festival/doc/Makefile.orig 2001-04-04 06:55:21.000000000 -0500
-+++ festival/doc/Makefile      2004-05-06 16:04:24.000000000 -0500
+$OpenBSD$
+--- festival/doc/Makefile.orig Wed Oct  4 20:56:44 2006
++++ festival/doc/Makefile      Wed Oct  4 21:02:43 2006
 @@ -44,7 +44,7 @@ MAIN_TO_DOCUMENT=
  
  EXAMPLE_TO_DOCUMENT=
  
 -FESTIVAL=$(TOP)/bin/festival --libdir $(TOP)/lib
-+FESTIVAL=$(TOP)/src/main/festival --libdir $(TOP)/lib
++#FESTIVAL=$(TOP)/bin/festival --libdir $(TOP)/lib
  
  # Include some of EST documentation.
  DOCXX_EXTRA_FILES = 
-@@ -72,9 +72,9 @@ include $(EST)/config/rules/doc.mak
- %.1 : %.head %.options %.tail 
-       cat $^ >$@
- %.options : $(TOP)/src/main/%
--      $(TOP)/bin/$* -man_options >$@
-+      $(FESTIVAL)$* -man_options >$@
- %.options : $(TOP)/src/main/%.exe
--      $(TOP)/bin/$* -man_options >$@
-+      $(FESTIVAL)$* -man_options >$@
- 
- festival.info: festival.texi festfunc.texi festvars.texi festfeat.texi
-       @ if [ ! -d info ] ; \
Index: patches/patch-festival_lib_festival_scm
===================================================================
RCS file: patches/patch-festival_lib_festival_scm
diff -N patches/patch-festival_lib_festival_scm
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-festival_lib_festival_scm     25 Dec 2006 19:28:36 -0000
@@ -0,0 +1,19 @@
+$OpenBSD$
+--- festival/lib/festival.scm.orig     Mon May 24 16:17:05 2004
++++ festival/lib/festival.scm  Wed Oct  4 23:35:58 2006
+@@ -547,13 +547,13 @@ Doing stuff
+ (define (intro)
+ "(intro)
+  Synthesize an introduction to the Festival Speech Synthesis System."
+-  (tts (path-append libdir "../examples/intro.text") nil))
++  (tts "!!EXAMPLEDIR!!/intro.text" nil))
+ 
+ (define (intro-spanish)
+ "(intro-spanish)
+  Synthesize an introduction to the Festival Speech Synthesis System
+  in spanish.  Spanish voice must already be selected for this."
+-  (tts (path-append libdir "../examples/spintro.text") nil))
++  (tts "!!EXAMPLEDIR!!/spintro.text" nil))
+ 
+ (define (na_play FILENAME)
+ "(play_wave FILENAME)
Index: patches/patch-festival_src_scripts_festival_server_control_sh
===================================================================
RCS file: patches/patch-festival_src_scripts_festival_server_control_sh
diff -N patches/patch-festival_src_scripts_festival_server_control_sh
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-festival_src_scripts_festival_server_control_sh       25 Dec 
2006 19:28:36 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- festival/src/scripts/festival_server_control.sh.orig       Thu Oct  5 
02:05:46 2006
++++ festival/src/scripts/festival_server_control.sh    Thu Oct  5 02:06:01 2006
+@@ -37,7 +37,7 @@
+ ###########################################################################
+ 
+ TOP=__TOP__
+-EST=__EST__
++EST=!!EST!!
+ 
+ #__SHARED_SETUP__
+ 
Index: patches/patch-festival_src_scripts_festival_server_sh
===================================================================
RCS file: patches/patch-festival_src_scripts_festival_server_sh
diff -N patches/patch-festival_src_scripts_festival_server_sh
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-festival_src_scripts_festival_server_sh       25 Dec 2006 
19:28:36 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- festival/src/scripts/festival_server.sh.orig       Thu Oct  5 02:05:14 2006
++++ festival/src/scripts/festival_server.sh    Thu Oct  5 02:05:28 2006
+@@ -37,7 +37,7 @@
+ ###########################################################################
+ 
+ TOP=__TOP__
+-EST=__EST__
++EST=!!EST!!
+ 
+ #__SHARED_SETUP__
+ 
Index: patches/patch-festival_src_scripts_shared_script
===================================================================
RCS file: patches/patch-festival_src_scripts_shared_script
diff -N patches/patch-festival_src_scripts_shared_script
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-festival_src_scripts_shared_script    25 Dec 2006 19:28:36 
-0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- festival/src/scripts/shared_script.orig    Wed Apr  4 07:55:20 2001
++++ festival/src/scripts/shared_script Thu Oct  5 01:13:04 2006
+@@ -19,7 +19,7 @@ extend() {
+ 
+ extend LD_LIBRARY_PATH "__EST__/lib:__LDPATH__"
+ 
+-exec __MAIN__/__PROGRAM__ "$@"
++exec !!FESTIVAL!! "$@"
+ 
+ exit 0
+ 
Index: patches/patch-festival_testsuite_data_modes_scm
===================================================================
RCS file: patches/patch-festival_testsuite_data_modes_scm
diff -N patches/patch-festival_testsuite_data_modes_scm
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-festival_testsuite_data_modes_scm     25 Dec 2006 19:28:36 
-0000
@@ -0,0 +1,25 @@
+$OpenBSD$
+--- festival/testsuite/data/modes.scm.orig     Mon Dec 25 12:58:37 2006
++++ festival/testsuite/data/modes.scm  Mon Dec 25 13:02:26 2006
+@@ -42,17 +42,17 @@
+ 
+ (format t "\n\nSABLE mode\n")
+ (unwind-protect
+- (tts (string-append libdir "/../examples/example2.sable") nil))
++ (tts "!!EXAMPLEDIR!!/example2.sable" nil))
+ (format t "\n\nOGI's mark up mode\n")
+ (unwind-protect 
+- (tts (string-append libdir "/../examples/ex1.ogi") 'ogimarkup))
++ (tts "!!EXAMPLEDIR!!/ex1.ogi" 'ogimarkup))
+ (format t "\n\nAn email mode\n")
+ (unwind-protect
+- (tts (string-append libdir "/../examples/ex1.email") nil))
++ (tts "!!EXAMPLEDIR!!/ex1.email" nil))
+ 
+ (voice_kal_diphone)
+ (format t "\n\nA singing mode\n")
+ (unwind-protect
+- (tts (string-append libdir "/../examples/songs/doremi.xml") 'singing))
++ (tts "!!EXAMPLEDIR!!/songs/doremi.xml" 'singing))
+ 
+ 
Index: patches/patch-speech_tools_config_compilers_gcc32_mak
===================================================================
RCS file: patches/patch-speech_tools_config_compilers_gcc32_mak
diff -N patches/patch-speech_tools_config_compilers_gcc32_mak
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-speech_tools_config_compilers_gcc32_mak       25 Dec 2006 
19:28:36 -0000
@@ -0,0 +1,13 @@
+$OpenBSD$
+--- speech_tools/config/compilers/gcc32.mak.orig       Mon Dec 25 12:31:18 2006
++++ speech_tools/config/compilers/gcc32.mak    Mon Dec 25 12:31:40 2006
+@@ -46,9 +46,6 @@ ifndef GCC32
+     GCC32 = gcc
+ endif
+ 
+-CC= $(GCC32)
+-CXX = g++
+-
+ WARN_CXXFLAGS  +=  -Wno-non-template-friend -Wno-deprecated
+ 
+ STATIC_LINKFLAGS = -Dstatic
Index: patches/patch-speech_tools_config_project_mak
===================================================================
RCS file: patches/patch-speech_tools_config_project_mak
diff -N patches/patch-speech_tools_config_project_mak
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-speech_tools_config_project_mak       25 Dec 2006 19:28:36 
-0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- speech_tools/config/project.mak.orig       Wed Oct  4 21:49:32 2006
++++ speech_tools/config/project.mak    Wed Oct  4 21:50:00 2006
+@@ -104,7 +104,7 @@ PROJECT_LIBRARY_USES_estbase = eststring
+ PROJECT_LIBRARY_USES_estjava = estbase eststring
+ 
+ PROJECT_LIBRARY_VERSION_estools = $(PROJECT_VERSION).1
+-PROJECT_LIBRARY_VERSION_estbase = $(PROJECT_VERSION).1
++PROJECT_LIBRARY_VERSION_estbase = 1.2
+ PROJECT_LIBRARY_VERSION_eststring = 1.2
+ PROJECT_LIBRARY_VERSION_estjava = $(PROJECT_VERSION).1
+ 
Index: pkg/PFRAG.shared
===================================================================
RCS file: pkg/PFRAG.shared
diff -N pkg/PFRAG.shared
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ pkg/PFRAG.shared    25 Dec 2006 19:28:36 -0000
@@ -0,0 +1,5 @@
[EMAIL PROTECTED] $OpenBSD$
+lib/libestbase.so
[EMAIL PROTECTED] lib/libestbase.so.${LIBestbase_VERSION}
+lib/libeststring.so
[EMAIL PROTECTED] lib/libeststring.so.${LIBeststring_VERSION}
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/audio/festival/core/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST
--- pkg/PLIST   6 Aug 2004 03:36:24 -0000       1.2
+++ pkg/PLIST   25 Dec 2006 19:28:36 -0000
@@ -1,10 +1,45 @@
 @comment $OpenBSD: PLIST,v 1.2 2004/08/06 03:36:24 jolan Exp $
+%%SHARED%%
+bin/align
 bin/audsp
+bin/bcat
+bin/ch_lab
+bin/ch_track
+bin/ch_utt
+bin/ch_wave
+bin/design_filter
+bin/dp
 bin/festival
 bin/festival_client
 bin/festival_server
 bin/festival_server_control
+bin/fringe_client
+bin/na_play
+bin/na_record
+bin/ngram_build
+bin/ngram_test
+bin/ols
+bin/ols_test
+bin/pda
+bin/pitchmark
+bin/scfg_make
+bin/scfg_parse
+bin/scfg_test
+bin/scfg_train
+bin/sig2fv
+bin/sigfilter
+bin/siod
+bin/spectgen
 bin/text2wave
+bin/tilt_analysis
+bin/tilt_synthesis
+bin/viterbi
+bin/wagon
+bin/wagon_test
+bin/wfst_build
+bin/wfst_run
+bin/wfst_train
+bin/xml_parser
 lib/festival/
 lib/festival/Sable.v0_2.dtd
 lib/festival/Singing.v0_1.dtd
@@ -23,6 +58,8 @@ lib/festival/duration.scm
 lib/festival/email-mode.scm
 lib/festival/engmorph.scm
 lib/festival/engmorphsyn.scm
+lib/festival/etc/
+lib/festival/etc/email_filter
 lib/festival/f2bdurtreeZ.scm
 lib/festival/f2bf0lr.scm
 lib/festival/festdoc.scm





Reply via email to