This diff allows cmu-sphinx3 to compile with the latest recommended
upstream release (see my other diff for cmu-sphinxbase).
There is no newer sphinx3 upstream release as far as I can tell.
Upstream now advertises sphinx4 which is written in Java.
Also, switch from g77 to gfortan, which was apparently missed
when steven and pirofti swiched cmu-sphinxbase to gfortran in
November 2017. As far as I can tell, this port is only interested
in fortran WANTLIB (it wants libquadmath via sphinxbase).
diff 13c2fb54dce5a740f25ca5c9d561bd336812b19d /usr/ports
blob - c35a6cf3151400f50a68eee008b12a7e46e40158
file + audio/cmu-sphinx3/Makefile
--- audio/cmu-sphinx3/Makefile
+++ audio/cmu-sphinx3/Makefile
@@ -2,34 +2,35 @@
COMMENT= acoustic decoder for CMU Sphinx3 speech recognition system
-DISTNAME= sphinx3-0.8
+VERSION= 0.8
+DISTNAME= sphinx3-${VERSION}
PKGNAME= cmu-${DISTNAME}
-REVISION= 6
+REVISION= 7
CATEGORIES= audio
SHARED_LIBS= s3decoder 0.0
-HOMEPAGE= http://cmusphinx.sourceforge.net/
+HOMEPAGE= https://cmusphinx.sourceforge.net/
# CMU
PERMIT_PACKAGE_CDROM= Yes
-MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=cmusphinx/}
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=cmusphinx/sphinx3/${VERSION}/}
-WANTLIB= blas c iconv lapack m pthread sndio ${MODFORTRAN_WANTLIB} \
+WANTLIB= blas c quadmath lapack m pthread sndio \
+ ${MODFORTRAN_WANTLIB} \
sphinxad sphinxbase
MODULES= fortran
-MODFORTRAN_COMPILER = g77
+MODFORTRAN_COMPILER = gfortran
LIB_DEPENDS= audio/cmu-sphinxbase \
- converters/libiconv \
${MODFORTRAN_LIB_DEPENDS}
CONFIGURE_STYLE=gnu
CONFIGURE_ENV+= LDFLAGS="-L${LOCALBASE}/lib" \
- CPPFLAGS="-I${LOCALBASE}/include"
+ CFLAGS="-I${LOCALBASE}/include"
post-extract:
cp ${FILESDIR}/compare_table.pl ${WRKSRC}/src/tests/regression
blob - /dev/null
file + audio/cmu-sphinx3/patches/patch-src_libs3decoder_libcfg_s3_cfg_convert_c
--- audio/cmu-sphinx3/patches/patch-src_libs3decoder_libcfg_s3_cfg_convert_c
+++ audio/cmu-sphinx3/patches/patch-src_libs3decoder_libcfg_s3_cfg_convert_c
@@ -0,0 +1,11 @@
+$OpenBSD$
+remove inclusion of obsolete libsphinxbase header file
+Index: src/libs3decoder/libcfg/s3_cfg_convert.c
+--- src/libs3decoder/libcfg/s3_cfg_convert.c.orig
++++ src/libs3decoder/libcfg/s3_cfg_convert.c
+@@ -1,5 +1,4 @@
+
+-#include <libutil.h>
+ #include "s3_cfg.h"
+ #include "fsg.h"
+
blob - /dev/null
file + audio/cmu-sphinx3/patches/patch-src_libs3decoder_libcommon_corpus_c
--- audio/cmu-sphinx3/patches/patch-src_libs3decoder_libcommon_corpus_c
+++ audio/cmu-sphinx3/patches/patch-src_libs3decoder_libcommon_corpus_c
@@ -0,0 +1,41 @@
+$OpenBSD$
+update to new path2basename() API function in libsphinxbase
+Index: src/libs3decoder/libcommon/corpus.c
+--- src/libs3decoder/libcommon/corpus.c.orig
++++ src/libs3decoder/libcommon/corpus.c
+@@ -401,7 +401,7 @@ ctl_read_entry(FILE * fp, char *uttfile, int32 * sf, i
+ char *uttid)
+ {
+ char line[16384];
+- char base[16384];
++ const char *base;
+ int32 k;
+
+ do {
+@@ -418,7 +418,7 @@ ctl_read_entry(FILE * fp, char *uttfile, int32 * sf, i
+
+ if (k < 4) {
+ /* Create utt-id from mfc-filename (and sf/ef if specified) */
+- path2basename(uttfile, base);
++ base = path2basename(uttfile);
+ /* strip_fileext (base, uttid); */
+ strcpy(uttid, base);
+
+@@ -687,7 +687,7 @@ ctl_process_utt(const char *uttfile, int32 count,
+ char *uttid), void *kb)
+ {
+ char uttid[4096];
+- char base[16384];
++ const char *base;
+ int32 i, c;
+ int32 ts, newts;
+ ptmr_t tm;
+@@ -696,7 +696,7 @@ ctl_process_utt(const char *uttfile, int32 count,
+
+ ptmr_init(&tm);
+ ur = new_utt_res();
+- path2basename(uttfile, base);
++ base = path2basename(uttfile);
+ /* strip_fileext() copies base to uttid. So, copying uttid to base
+ * is redundant if strip_fileext() is not called.
+ */
blob - /dev/null
file + audio/cmu-sphinx3/patches/patch-src_libs3decoder_libcommon_misc_c
--- audio/cmu-sphinx3/patches/patch-src_libs3decoder_libcommon_misc_c
+++ audio/cmu-sphinx3/patches/patch-src_libs3decoder_libcommon_misc_c
@@ -0,0 +1,32 @@
+$OpenBSD$
+update to new path2basename() API function in libsphinxbase
+Index: src/libs3decoder/libcommon/misc.c
+--- src/libs3decoder/libcommon/misc.c.orig
++++ src/libs3decoder/libcommon/misc.c
+@@ -128,7 +128,7 @@ ctlfile_next(FILE * fp, char *ctlspec, int32 * sf, int
+ {
+ char line[1024];
+ int32 k;
+- char base[1024];
++ const char *base;
+
+ *sf = 0;
+ *ef = (int32) 0x7ffffff0;
+@@ -147,7 +147,7 @@ ctlfile_next(FILE * fp, char *ctlspec, int32 * sf, int
+
+ switch (k) {
+ case 1:
+- path2basename(ctlspec, base);
++ base = path2basename(ctlspec);
+ strcpy(uttid, base);
+ break;
+
+@@ -158,7 +158,7 @@ ctlfile_next(FILE * fp, char *ctlspec, int32 * sf, int
+ case 3:
+ if ((*sf >= *ef) || (*sf < 0))
+ E_FATAL("Bad control file line: %s\n", line);
+- path2basename(ctlspec, base);
++ base = path2basename(ctlspec);
+ sprintf(uttid, "%s_%d_%d", base, *sf, *ef);
+ break;
+
blob - /dev/null
file + audio/cmu-sphinx3/patches/patch-src_libs3decoder_libsearch_fsg_history_c
--- audio/cmu-sphinx3/patches/patch-src_libs3decoder_libsearch_fsg_history_c
+++ audio/cmu-sphinx3/patches/patch-src_libs3decoder_libsearch_fsg_history_c
@@ -0,0 +1,13 @@
+$OpenBSD$
+remove inclusion of obsolete libpshinxbase header file
+Index: src/libs3decoder/libsearch/fsg_history.c
+--- src/libs3decoder/libsearch/fsg_history.c.orig
++++ src/libs3decoder/libsearch/fsg_history.c
+@@ -55,7 +55,6 @@
+ #include <kb.h>
+ /*#include <phone.h>*/
+ #include <search.h>
+-#include "libutil.h"
+
+
+ #define __FSG_DBG__ 0
blob - /dev/null
file + audio/cmu-sphinx3/patches/patch-src_libs3decoder_libsearch_vithist_c
--- audio/cmu-sphinx3/patches/patch-src_libs3decoder_libsearch_vithist_c
+++ audio/cmu-sphinx3/patches/patch-src_libs3decoder_libsearch_vithist_c
@@ -0,0 +1,23 @@
+$OpenBSD$
+avoid out-of-bounds array index: lwid[2]
+heap_t variable must be a pointer with new libsphinxbase API
+Index: src/libs3decoder/libsearch/vithist.c
+--- src/libs3decoder/libsearch/vithist.c.orig
++++ src/libs3decoder/libsearch/vithist.c
+@@ -137,7 +137,6 @@ vh_lmstate_display(vh_lmstate_t * vhl, dict_t * dict)
+ /* TODO: Also translate wid to string if dict is not NULL */
+ E_INFO("lwid[0] %d\n", vhl->lm3g.lwid[0]);
+ E_INFO("lwid[1] %d\n", vhl->lm3g.lwid[1]);
+- E_INFO("lwid[2] %d\n", vhl->lm3g.lwid[2]);
+ }
+
+ void
+@@ -647,7 +646,7 @@ vithist_prune(vithist_t * vh, dict_t * dict, int32 frm
+ {
+ int32 se, fe, filler_done, th;
+ vithist_entry_t *ve;
+- heap_t h;
++ heap_t *h;
+ s3wid_t *wid;
+ int32 i;
+
blob - /dev/null
file + audio/cmu-sphinx3/patches/patch-src_programs_Makefile_in
--- audio/cmu-sphinx3/patches/patch-src_programs_Makefile_in
+++ audio/cmu-sphinx3/patches/patch-src_programs_Makefile_in
@@ -0,0 +1,14 @@
+$OpenBSD$
+support for continuous audio has been removed from libsphinxbase
+Index: src/programs/Makefile.in
+--- src/programs/Makefile.in.orig
++++ src/programs/Makefile.in
+@@ -38,7 +38,7 @@ POST_UNINSTALL = :
+ build_triplet = @build@
+ host_triplet = @host@
+ bin_PROGRAMS = sphinx3_decode$(EXEEXT) sphinx3_livepretend$(EXEEXT) \
+- sphinx3_continuous$(EXEEXT) sphinx3_livedecode$(EXEEXT) \
++ sphinx3_livedecode$(EXEEXT) \
+ sphinx3_align$(EXEEXT) sphinx3_astar$(EXEEXT) \
+ sphinx3_conf$(EXEEXT) sphinx3_dag$(EXEEXT) sphinx3_dp$(EXEEXT) \
+ sphinx3_ep$(EXEEXT) sphinx3_gausubvq$(EXEEXT) \
blob - /dev/null
file + audio/cmu-sphinx3/patches/patch-src_programs_main_align_c
--- audio/cmu-sphinx3/patches/patch-src_programs_main_align_c
+++ audio/cmu-sphinx3/patches/patch-src_programs_main_align_c
@@ -0,0 +1,25 @@
+$OpenBSD$
+remove used of obsolete libsphinxbase APIs
+Index: src/programs/main_align.c
+--- src/programs/main_align.c.orig
++++ src/programs/main_align.c
+@@ -206,8 +206,6 @@
+ #include <assert.h>
+
+ #include <s3types.h>
+-#include "info.h"
+-#include "unlimit.h"
+ #include "logs3.h"
+ #include "tmat.h"
+ #include "mdef.h"
+@@ -1017,10 +1015,8 @@ main(int32 argc, char *argv[])
+ char sent[16384];
+ cmd_ln_t *config;
+
+- print_appl_info(argv[0]);
+ cmd_ln_appl_enter(argc, argv, "default.arg", defn);
+
+- unlimit();
+ config = cmd_ln_get();
+
+ ctloffset = cmd_ln_int32_r(config, "-ctloffset");
blob - /dev/null
file + audio/cmu-sphinx3/patches/patch-src_programs_main_astar_c
--- audio/cmu-sphinx3/patches/patch-src_programs_main_astar_c
+++ audio/cmu-sphinx3/patches/patch-src_programs_main_astar_c
@@ -0,0 +1,24 @@
+$OpenBSD$
+remove used of obsolete libsphinxbase APIs
+Index: src/programs/main_astar.c
+--- src/programs/main_astar.c.orig
++++ src/programs/main_astar.c
+@@ -217,8 +217,6 @@
+ #include <assert.h>
+
+ #include <s3types.h>
+-#include <info.h>
+-#include <unlimit.h>
+ #include <logs3.h>
+ #include <tmat.h>
+ #include <mdef.h>
+@@ -449,9 +447,7 @@ main(int32 argc, char *argv[])
+ /* kb_t kb;
+ ptmr_t tm; */
+
+- print_appl_info(argv[0]);
+ cmd_ln_appl_enter(argc, argv, "default.arg", defn);
+- unlimit();
+
+ config = cmd_ln_get();
+
blob - /dev/null
file + audio/cmu-sphinx3/patches/patch-src_programs_main_cfg2fsg_c
--- audio/cmu-sphinx3/patches/patch-src_programs_main_cfg2fsg_c
+++ audio/cmu-sphinx3/patches/patch-src_programs_main_cfg2fsg_c
@@ -0,0 +1,20 @@
+$OpenBSD$
+remove used of obsolete libsphinxbase APIs
+Index: src/programs/main_cfg2fsg.c
+--- src/programs/main_cfg2fsg.c.orig
++++ src/programs/main_cfg2fsg.c
+@@ -1,6 +1,5 @@
+
+ #include "cmd_ln.h"
+-#include "info.h"
+ #include "s3_cfg.h"
+ #include "fsg.h"
+ #include "logs3.h"
+@@ -39,7 +38,6 @@ main(int _argc, char **_argv)
+ int n_trans = 0;
+ logmath_t *logmath;
+
+- print_appl_info(_argv[0]);
+ if ((config = cmd_ln_parse_r(NULL, defn, _argc, _argv, TRUE)) == NULL)
+ E_FATAL("Cannot parse command line\n");
+
blob - /dev/null
file + audio/cmu-sphinx3/patches/patch-src_programs_main_conf_c
--- audio/cmu-sphinx3/patches/patch-src_programs_main_conf_c
+++ audio/cmu-sphinx3/patches/patch-src_programs_main_conf_c
@@ -0,0 +1,25 @@
+$OpenBSD$
+remove used of obsolete libsphinxbase APIs
+Index: src/programs/main_conf.c
+--- src/programs/main_conf.c.orig
++++ src/programs/main_conf.c
+@@ -90,8 +90,6 @@
+ #include <math.h>
+ #include <assert.h>
+
+-#include "info.h"
+-#include "unlimit.h"
+ #include "lm.h"
+ #include "fillpen.h"
+ #include "dict.h"
+@@ -339,10 +337,7 @@ confidence_utt(char *uttid, FILE * _confmatchsegfp)
+ int
+ main(int argc, char *argv[])
+ {
+- print_appl_info(argv[0]);
+ cmd_ln_appl_enter(argc, argv, "default.arg", defn);
+-
+- unlimit();
+
+ config = cmd_ln_get();
+
blob - /dev/null
file + audio/cmu-sphinx3/patches/patch-src_programs_main_dag_c
--- audio/cmu-sphinx3/patches/patch-src_programs_main_dag_c
+++ audio/cmu-sphinx3/patches/patch-src_programs_main_dag_c
@@ -0,0 +1,25 @@
+$OpenBSD$
+remove used of obsolete libsphinxbase APIs
+Index: src/programs/main_dag.c
+--- src/programs/main_dag.c.orig
++++ src/programs/main_dag.c
+@@ -222,8 +222,6 @@
+ #include <assert.h>
+
+ #include <s3types.h>
+-#include "info.h"
+-#include "unlimit.h"
+ #include "dag.h"
+ #include "logs3.h"
+ #include "tmat.h"
+@@ -496,10 +494,7 @@ utt_dag(void *data, utt_res_t * ur, int32 sf, int32 ef
+ int
+ main(int32 argc, char *argv[])
+ {
+- print_appl_info(argv[0]);
+ cmd_ln_appl_enter(argc, argv, "default.arg", defn);
+-
+- unlimit();
+
+ config = cmd_ln_get();
+
blob - /dev/null
file + audio/cmu-sphinx3/patches/patch-src_programs_main_decode_c
--- audio/cmu-sphinx3/patches/patch-src_programs_main_decode_c
+++ audio/cmu-sphinx3/patches/patch-src_programs_main_decode_c
@@ -0,0 +1,25 @@
+$OpenBSD$
+remove use of obsolete libsphinxbase APIs
+Index: src/programs/main_decode.c
+--- src/programs/main_decode.c.orig
++++ src/programs/main_decode.c
+@@ -59,8 +59,6 @@
+ /** \file decode.c
+ * \brief main function for application decode
+ */
+-#include "info.h"
+-#include "unlimit.h"
+ #include "utt.h"
+ #include "kb.h"
+ #include "corpus.h"
+@@ -142,10 +140,7 @@ main(int32 argc, char *argv[])
+ stat_t *st;
+ cmd_ln_t *config;
+
+- print_appl_info(argv[0]);
+ cmd_ln_appl_enter(argc, argv, "default.arg", arg);
+-
+- unlimit();
+
+ config = cmd_ln_get();
+ kb_init(&kb, config);
blob - /dev/null
file + audio/cmu-sphinx3/patches/patch-src_programs_main_dp_c
--- audio/cmu-sphinx3/patches/patch-src_programs_main_dp_c
+++ audio/cmu-sphinx3/patches/patch-src_programs_main_dp_c
@@ -0,0 +1,21 @@
+$OpenBSD$
+remove used of obsolete libsphinxbase APIs
+Index: src/programs/main_dp.c
+--- src/programs/main_dp.c.orig
++++ src/programs/main_dp.c
+@@ -66,7 +66,6 @@
+ #include <assert.h>
+
+ #include <cmd_ln.h>
+-#include <info.h>
+ #include <hash_table.h>
+ #include <case.h>
+ #include <s3types.h>
+@@ -588,7 +587,6 @@ main(int32 argc, char *argv[])
+ int32 oldfmt;
+
+
+- print_appl_info(argv[0]);
+ cmd_ln_appl_enter(argc, argv, "default.arg", arg);
+
+ config = cmd_ln_get();
blob - /dev/null
file + audio/cmu-sphinx3/patches/patch-src_programs_main_gausubvq_c
--- audio/cmu-sphinx3/patches/patch-src_programs_main_gausubvq_c
+++ audio/cmu-sphinx3/patches/patch-src_programs_main_gausubvq_c
@@ -0,0 +1,24 @@
+$OpenBSD$
+remove used of obsolete libsphinxbase APIs
+Index: src/programs/main_gausubvq.c
+--- src/programs/main_gausubvq.c.orig
++++ src/programs/main_gausubvq.c
+@@ -68,8 +68,6 @@
+
+ #include <math.h>
+
+-#include "info.h"
+-#include "unlimit.h"
+ #include "cont_mgau.h"
+ #include "logs3.h"
+ #include "vector.h"
+@@ -126,9 +124,7 @@ main(int32 argc, char *argv[])
+ cmd_ln_t *config;
+ logmath_t *logmath;
+
+- print_appl_info(argv[0]);
+ cmd_ln_appl_enter(argc, argv, "default.arg", arg);
+- unlimit();
+
+ config = cmd_ln_get();
+
blob - /dev/null
file + audio/cmu-sphinx3/patches/patch-src_programs_main_livepretend_c
--- audio/cmu-sphinx3/patches/patch-src_programs_main_livepretend_c
+++ audio/cmu-sphinx3/patches/patch-src_programs_main_livepretend_c
@@ -0,0 +1,22 @@
+$OpenBSD$
+remove used of obsolete libsphinxbase APIs
+Index: src/programs/main_livepretend.c
+--- src/programs/main_livepretend.c.orig
++++ src/programs/main_livepretend.c
+@@ -76,7 +76,6 @@
+ */
+ #include <stdio.h>
+
+-#include "info.h"
+ #include "s3_decode.h"
+ #include "kb.h"
+ #include "s3types.h"
+@@ -155,8 +154,6 @@ main(int _argc, char **_argv)
+ char *ctrlfn;
+ char *cfgfn;
+ cmd_ln_t *config = NULL;
+-
+- print_appl_info(_argv[0]);
+
+ if (_argc != 4) {
+ printf("\nUSAGE: %s <ctrlfile> <rawdir> <cfgfile>\n", _argv[0]);
blob - /dev/null
file + audio/cmu-sphinx3/patches/patch-src_programs_main_lm_convert_c
--- audio/cmu-sphinx3/patches/patch-src_programs_main_lm_convert_c
+++ audio/cmu-sphinx3/patches/patch-src_programs_main_lm_convert_c
@@ -0,0 +1,21 @@
+$OpenBSD$
+remove used of obsolete libsphinxbase APIs
+Index: src/programs/main_lm_convert.c
+--- src/programs/main_lm_convert.c.orig
++++ src/programs/main_lm_convert.c
+@@ -80,7 +80,6 @@
+
+ #include <string.h>
+
+-#include "info.h"
+ #include "lm.h"
+ #include "s3types.h"
+ #include "cmd_ln.h"
+@@ -143,7 +142,6 @@ main(int argc, char *argv[])
+ char separator[2];
+ cmd_ln_t *config;
+
+- print_appl_info(argv[0]);
+ cmd_ln_appl_enter(argc, argv, "default.arg", arg);
+
+ config = cmd_ln_get();
blob - d674f3621cd064c379558fa52b5bec0a51b9572d
file + audio/cmu-sphinx3/pkg/PLIST
--- audio/cmu-sphinx3/pkg/PLIST
+++ audio/cmu-sphinx3/pkg/PLIST
@@ -4,7 +4,6 @@ bin/sphinx3-simple
@bin bin/sphinx3_astar
@bin bin/sphinx3_cfg2fsg
@bin bin/sphinx3_conf
-@bin bin/sphinx3_continuous
@bin bin/sphinx3_dag
@bin bin/sphinx3_decode
@bin bin/sphinx3_dp