From eb8c73132a52b002e0e14aa86c5f8eb9cd2c21e5 Mon Sep 17 00:00:00 2001 From: W. Michael Petullo Date: Aug 10 2018 00:17:11 +0000 Subject: New upsteam release Signed-off-by: W. Michael Petullo --- diff --git a/.gitignore b/.gitignore index 3b698d9..3528fdf 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /sphinxbase-0.8.tar.gz +/sphinxbase-5prealpha.tar.gz diff --git a/sources b/sources index 0df017d..62eb24d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -7335d233f7ad4ecc4b508aec7b5dc101 sphinxbase-0.8.tar.gz +SHA512 (sphinxbase-5prealpha.tar.gz) = 9d999d0b9041c0965ff679636e3c5705987b70317a353916f447809a916878d831a82a5d9c1476d304f908df1ce6b68eb07c906af4f7b86ab84b859ee1b0d20b diff --git a/sphinxbase-doxygen.patch b/sphinxbase-doxygen.patch deleted file mode 100644 index 245e180..0000000 --- a/sphinxbase-doxygen.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- ./include/sphinxbase/matrix.h.orig 2012-12-05 07:06:01.000000000 -0700 -+++ ./include/sphinxbase/matrix.h 2013-03-29 08:06:21.648426061 -0600 -@@ -82,7 +82,7 @@ SPHINXBASE_EXPORT void norm_3d(float32 * - /** - * Floor 3-d array - * @param out output array -- * @para in input array -+ * @param in input array - * @param d1 dimension - * @param d2 dimension - * @param d3 dimension -@@ -109,7 +109,7 @@ SPHINXBASE_EXPORT void floor_nz_3d(float - - /** - * Floor 1-d array -- * @param m array -+ * @param v array - * @param d1 dimension - * @param floor floor value - **/ ---- ./src/libsphinxbase/util/heap.c.orig 2012-12-05 07:06:08.000000000 -0700 -+++ ./src/libsphinxbase/util/heap.c 2013-03-29 08:03:34.889007411 -0600 -@@ -78,7 +78,7 @@ typedef struct heapnode_s { - void *data; /**< Application data at this node */ - int32 val; /**< Associated with above application data; according to which - heap is sorted (in ascending order) */ -- int32 nl, nr; /**< #left/right descendants of this node (for balancing heap) */ -+ int32 nl, nr; /**< \#left/right descendants of this node (for balancing heap) */ - struct heapnode_s *l; /**< Root of left descendant heap */ - struct heapnode_s *r; /**< Root of right descendant heap */ - } heapnode_t; diff --git a/sphinxbase-largefile.patch b/sphinxbase-largefile.patch deleted file mode 100644 index 7dd17c4..0000000 --- a/sphinxbase-largefile.patch +++ /dev/null @@ -1,768 +0,0 @@ ---- ./include/sphinxbase/pio.h.orig 2012-12-05 07:06:01.000000000 -0700 -+++ ./include/sphinxbase/pio.h 2013-03-28 16:40:55.415749785 -0600 -@@ -285,7 +285,7 @@ int32 stat_retry (const char *file, stru - */ - - SPHINXBASE_EXPORT --int32 stat_mtime (const char *file); -+time_t stat_mtime (const char *file); - - /** - * Create a directory and all of its parent directories, as needed. ---- ./include/sphinxbase/prim_type.h.orig 2012-12-05 07:06:01.000000000 -0700 -+++ ./include/sphinxbase/prim_type.h 2013-03-28 16:40:55.415749785 -0600 -@@ -132,6 +132,29 @@ typedef unsigned long long uint64; - typedef double int64; - typedef double uint64; - #endif /* !HAVE_LONG_LONG && SIZEOF_LONG_LONG == 8 */ -+#ifdef HAVE_FSEEKO -+# define OFF_T off_t -+# define FSEEK(stream, offset, whence) fseeko (stream, offset, whence) -+# define FTELL(stream) ftello (stream) -+# if SIZEOF_OFF_T == SIZEOF_INT -+# define PRIdOFF_T "d" -+# define PRIxOFF_T "x" -+# elif SIZEOF_OFF_T == SIZEOF_LONG -+# define PRIdOFF_T "ld" -+# define PRIxOFF_T "lx" -+# elif defined(HAVE_LONG_LONG) && SIZEOF_OFF_T == SIZEOF_LONG_LONG -+# define PRIdOFF_T "lld" -+# define PRIxOFF_T "llx" -+# else -+# error Cannot determine how to print an off_t -+# endif -+#else -+# define OFF_T long -+# define FSEEK(stream, offset, whence) fseek (stream, offset, whence) -+# define FTELL(stream) ftell (stream) -+# define PRIdOFF_T "ld" -+# define PRIxOFF_T "lx" -+#endif - - #ifndef TRUE - #define TRUE 1 ---- ./configure.in.orig 2012-12-12 10:28:32.000000000 -0700 -+++ ./configure.in 2013-03-28 16:42:00.780690385 -0600 -@@ -1,7 +1,7 @@ - dnl Welcome to the Sphinx automated build system. - dnl try not to hurt yourself ;) - --AC_INIT([sphinxbase], 0.8) -+AC_INIT([sphinxbase],[0.8]) - AC_CONFIG_HEADERS([include/config.h include/sphinx_config.h]) - AM_INIT_AUTOMAKE([no-define]) - AC_CONFIG_MACRO_DIR([m4]) -@@ -41,12 +41,18 @@ fi - AC_ARG_VAR(YACC,[Bison command]) - - AC_HEADER_STDC -+AC_SYS_LARGEFILE - AC_C_BIGENDIAN - AC_TYPE_SIGNAL -+ -+AC_TYPE_OFF_T - AC_CHECK_TYPES(long long) - AC_CHECK_SIZEOF(long long) - AC_CHECK_SIZEOF(long) -+AC_CHECK_SIZEOF(int) -+AC_CHECK_SIZEOF(off_t) - AC_CHECK_FUNCS([popen perror snprintf]) -+AC_FUNC_FSEEKO - AC_CHECK_HEADER(errno.h) - AM_ICONV - -@@ -203,7 +209,7 @@ AC_SUBST(ad_files) - AC_SUBST(ad_libs) - AC_SUBST(ad_backend) - --AM_PROG_LIBTOOL -+LT_INIT - - dnl - dnl Check for Doxygen, and build dox if present -@@ -246,7 +252,7 @@ else - PYTHON=bogus - fi - if test "x$use_python" != xtrue ; then -- AC_WARN([Disabling python since development headers were not found]) -+ AC_MSG_WARN(Disabling python since development headers were not found) - fi - AM_CONDITIONAL(BUILD_PYTHON, test "x$use_python" = "xtrue") - AC_SUBST(PYTHON) ---- ./src/sphinx_fe/sphinx_fe.c.orig 2012-12-05 07:06:03.000000000 -0700 -+++ ./src/sphinx_fe/sphinx_fe.c 2013-03-28 16:40:55.416749784 -0600 -@@ -166,7 +166,7 @@ open_nist_file(sphinx_wave2feat_t *wtf, - return FALSE; - } - /* Rewind, parse lines. */ -- fseek(fh, 0, SEEK_SET); -+ FSEEK(fh, 0, SEEK_SET); - for (li = lineiter_start(fh); li; li = lineiter_next(li)) { - char **words; - int nword; -@@ -194,7 +194,7 @@ open_nist_file(sphinx_wave2feat_t *wtf, - ckd_free(words); - } - -- fseek(fh, 1024, SEEK_SET); -+ FSEEK(fh, 1024, SEEK_SET); - if (out_fh) - *out_fh = fh; - else -@@ -283,7 +283,7 @@ detect_sphinx_mfc(sphinx_wave2feat_t *wt - { - FILE *fh; - int32 len; -- long flen; -+ OFF_T flen; - - if ((fh = fopen(wtf->infile, "rb")) == NULL) { - E_ERROR_SYSTEM("Failed to open %s", wtf->infile); -@@ -294,8 +294,8 @@ detect_sphinx_mfc(sphinx_wave2feat_t *wt - fclose(fh); - return -1; - } -- fseek(fh, 0, SEEK_END); -- flen = ftell(fh); -+ FSEEK(fh, 0, SEEK_END); -+ flen = FTELL(fh); - - /* figure out whether to byteswap */ - flen = (flen / 4) - 1; -@@ -304,7 +304,7 @@ detect_sphinx_mfc(sphinx_wave2feat_t *wt - SWAP_INT32(&len); - if (flen != len) { - SWAP_INT32(&len); -- E_ERROR("Mismatch in header/file lengths: 0x%08x vs 0x%08x\n", -+ E_ERROR("Mismatch in header/file lengths: 0x%08x vs 0x%08" PRIxOFF_T "\n", - len, flen); - return -1; - } -@@ -314,7 +314,7 @@ detect_sphinx_mfc(sphinx_wave2feat_t *wt - ? "little" : "big")); - } - -- fseek(fh, 4, SEEK_SET); -+ FSEEK(fh, 4, SEEK_SET); - wtf->infh = fh; - if (cmd_ln_boolean_r(wtf->config, "-spec2cep")) { - wtf->in_veclen = cmd_ln_int32_r(wtf->config, "-nfilt"); -@@ -917,7 +917,7 @@ sphinx_wave2feat_convert_file(sphinx_wav - } - - if (wtf->ot->output_header) { -- if (fseek(wtf->outfh, 0, SEEK_SET) < 0) { -+ if (FSEEK(wtf->outfh, 0, SEEK_SET) < 0) { - E_ERROR_SYSTEM("Failed to seek to beginning of %s\n", outfile); - goto error_out; - } -@@ -1027,7 +1027,7 @@ run_control_file(sphinx_wave2feat_t *wtf - part = cmd_ln_int32_r(wtf->config, "-part"); - for (li = lineiter_start(ctlfh); li; li = lineiter_next(li)) - ++nlines; -- fseek(ctlfh, 0, SEEK_SET); -+ FSEEK(ctlfh, 0, SEEK_SET); - partlen = nlines / npart; - nskip = partlen * (part - 1); - if (part == npart) ---- ./src/sphinx_fe/Makefile.am.orig 2012-12-05 07:06:03.000000000 -0700 -+++ ./src/sphinx_fe/Makefile.am 2013-03-28 16:47:20.684165075 -0600 -@@ -9,7 +9,7 @@ sphinx_fe_LDADD = \ - $(top_builddir)/src/libsphinxbase/libsphinxbase.la \ - @SNDFILE_LIBS@ - --INCLUDES = -I$(top_srcdir)/include \ -+AM_CPPFLAGS = -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/src/libsphinxbase/fe \ - @SNDFILE_CFLAGS@ ---- ./src/sphinx_lmtools/Makefile.am.orig 2012-12-05 07:06:03.000000000 -0700 -+++ ./src/sphinx_lmtools/Makefile.am 2013-03-28 16:48:15.132091538 -0600 -@@ -7,6 +7,6 @@ LDADD = \ - $(top_builddir)/src/libsphinxbase/libsphinxbase.la \ - $(top_builddir)/src/libsphinxbase/lm/libsphinxlm.la - --INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \ -+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include \ - -I$(top_srcdir)/src/libsphinxlm - ---- ./src/libsphinxad/Makefile.am.orig 2012-12-05 07:06:04.000000000 -0700 -+++ ./src/libsphinxad/Makefile.am 2013-03-28 16:43:08.676624722 -0600 -@@ -28,7 +28,7 @@ libsphinxad_la_LIBADD = \ - @SAMPLERATE_LIBS@ \ - $(top_builddir)/src/libsphinxbase/libsphinxbase.la - --INCLUDES = \ -+AM_CPPFLAGS = \ - @SAMPLERATE_CFLAGS@ \ - -I$(top_srcdir)/include/sphinxbase \ - -I$(top_srcdir)/include \ ---- ./src/sphinx_adtools/sphinx_pitch.c.orig 2012-12-05 07:06:09.000000000 -0700 -+++ ./src/sphinx_adtools/sphinx_pitch.c 2013-03-28 16:40:55.416749784 -0600 -@@ -176,7 +176,7 @@ guess_file_type(char const *file, FILE * - { - char header[4]; - -- fseek(infh, 0, SEEK_SET); -+ FSEEK(infh, 0, SEEK_SET); - if (fread(header, 1, 4, infh) != 4) { - E_ERROR_SYSTEM("Failed to read 4 byte header"); - return -1; -@@ -199,7 +199,7 @@ guess_file_type(char const *file, FILE * - cmd_ln_set_boolean("-nist", FALSE); - cmd_ln_set_boolean("-raw", TRUE); - } -- fseek(infh, 0, SEEK_SET); -+ FSEEK(infh, 0, SEEK_SET); - return 0; - } - -@@ -282,7 +282,7 @@ read_riff_header(FILE *infh) - - /* Any extra parameters. */ - if (header_len > 16) -- fseek(infh, header_len - 16, SEEK_CUR); -+ FSEEK(infh, header_len - 16, SEEK_CUR); - - /* Now skip to the 'data' chunk. */ - while (1) { -@@ -297,7 +297,7 @@ read_riff_header(FILE *infh) - /* Number of bytes of ... whatever */ - TRY_FREAD(&intval, 4, 1, infh); - if (WORDS_BIGENDIAN) SWAP_INT32(&intval); -- fseek(infh, intval, SEEK_CUR); -+ FSEEK(infh, intval, SEEK_CUR); - } - } - ---- ./src/sphinx_adtools/Makefile.am.orig 2012-12-05 07:06:09.000000000 -0700 -+++ ./src/sphinx_adtools/Makefile.am 2013-03-28 16:46:35.516265981 -0600 -@@ -6,4 +6,4 @@ sphinx_cont_fileseg_SOURCES = cont_files - LDADD = $(top_builddir)/src/libsphinxbase/libsphinxbase.la \ - $(top_builddir)/src/libsphinxad/libsphinxad.la - --INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include -+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include ---- ./src/sphinx_cepview/Makefile.am.orig 2012-12-05 07:06:09.000000000 -0700 -+++ ./src/sphinx_cepview/Makefile.am 2013-03-28 16:46:59.428207699 -0600 -@@ -5,4 +5,4 @@ sphinx_cepview_SOURCES = main_cepview.c - sphinx_cepview_LDADD = \ - $(top_builddir)/src/libsphinxbase/libsphinxbase.la - --INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include -+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include ---- ./src/sphinx_cepview/main_cepview.c.orig 2012-12-13 02:01:21.000000000 -0700 -+++ ./src/sphinx_cepview/main_cepview.c 2013-03-28 16:40:55.417749783 -0600 -@@ -219,14 +219,14 @@ read_cep(char const *file, float ***cep, - - /* Check if n_float matches file size */ - byterev = FALSE; -- if ((int) (n_float * sizeof(float) + 4) != statbuf.st_size) { -+ if ((OFF_T) (n_float * sizeof(float) + 4) != statbuf.st_size) { - n = n_float; - SWAP_INT32(&n); - -- if ((int) (n * sizeof(float) + 4) != statbuf.st_size) { -- E_ERROR("Header size field: %d(%08x); filesize: %d(%08x)\n", -- n_float, n_float, (int) statbuf.st_size, -- (int) statbuf.st_size); -+ if ((OFF_T) (n * sizeof(float) + 4) != statbuf.st_size) { -+ E_ERROR("Header size field: %d(%08x); filesize: %" PRIdOFF_T -+ "(%08" PRIxOFF_T ")\n", n_float, n_float, statbuf.st_size, -+ statbuf.st_size); - fclose(fp); - return IO_ERR; - } ---- ./src/sphinx_jsgf2fsg/Makefile.am.orig 2012-12-05 07:06:04.000000000 -0700 -+++ ./src/sphinx_jsgf2fsg/Makefile.am 2013-03-28 16:47:42.948126918 -0600 -@@ -5,6 +5,6 @@ sphinx_jsgf2fsg_SOURCES = main.c - sphinx_jsgf2fsg_LDADD = \ - $(top_builddir)/src/libsphinxbase/libsphinxbase.la - --INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include -+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include - - EXTRA_DIST = fsg2dot.pl ---- ./src/libsphinxbase/util/bio.c.orig 2012-12-05 07:06:08.000000000 -0700 -+++ ./src/libsphinxbase/util/bio.c 2013-03-28 16:40:55.417749783 -0600 -@@ -513,7 +513,8 @@ bio_read_wavfile(char const *directory, - { - FILE *uttfp; - char *inputfile; -- int32 n, l; -+ OFF_T n; -+ int32 l; - int16 *data; - - n = strlen(extension); -@@ -530,11 +531,11 @@ bio_read_wavfile(char const *directory, - if ((uttfp = fopen(inputfile, "rb")) == NULL) { - E_FATAL_SYSTEM("Failed to open file '%s' for reading", inputfile); - } -- fseek(uttfp, 0, SEEK_END); -- n = ftell(uttfp); -- fseek(uttfp, 0, SEEK_SET); -+ FSEEK(uttfp, 0, SEEK_END); -+ n = FTELL(uttfp); -+ FSEEK(uttfp, 0, SEEK_SET); - if (header > 0) { -- if (fseek(uttfp, header, SEEK_SET) < 0) { -+ if (FSEEK(uttfp, header, SEEK_SET) < 0) { - E_ERROR_SYSTEM("Failed to move to an offset %d in a file '%s'", header, inputfile); - fclose(uttfp); - ckd_free(inputfile); -@@ -545,7 +546,7 @@ bio_read_wavfile(char const *directory, - n /= sizeof(int16); - data = ckd_calloc(n, sizeof(*data)); - if ((l = fread(data, sizeof(int16), n, uttfp)) < n) { -- E_ERROR_SYSTEM("Failed to read %d samples from %s: %d", n, inputfile, l); -+ E_ERROR_SYSTEM("Failed to read %" PRIdOFF_T " samples from %s: %d", n, inputfile, l); - ckd_free(data); - ckd_free(inputfile); - fclose(uttfp); -@@ -553,7 +554,7 @@ bio_read_wavfile(char const *directory, - } - ckd_free(inputfile); - fclose(uttfp); -- if (nsamps) *nsamps = n; -+ if (nsamps) *nsamps = (int32) n; - - return data; - } ---- ./src/libsphinxbase/util/logmath.c.orig 2012-12-05 07:06:08.000000000 -0700 -+++ ./src/libsphinxbase/util/logmath.c 2013-03-28 16:40:55.418749782 -0600 -@@ -168,7 +168,7 @@ logmath_read(const char *file_name) - int32 byteswap, i; - int chksum_present, do_mmap; - uint32 chksum; -- long pos; -+ OFF_T pos; - FILE *fp; - - E_INFO("Reading log table file '%s'\n", file_name); -@@ -228,9 +228,9 @@ logmath_read(const char *file_name) - - /* Check alignment constraints for memory mapping */ - do_mmap = 1; -- pos = ftell(fp); -+ pos = FTELL(fp); - if (pos & ((long)lmath->t.width - 1)) { -- E_WARN("%s: Data start %ld is not aligned on %d-byte boundary, will not memory map\n", -+ E_WARN("%s: Data start %" PRIdOFF_T "is not aligned on %d-byte boundary, will not memory map\n", - file_name, pos, lmath->t.width); - do_mmap = 0; - } -@@ -272,7 +272,7 @@ int32 - logmath_write(logmath_t *lmath, const char *file_name) - { - FILE *fp; -- long pos; -+ OFF_T pos; - uint32 chksum; - - if (lmath->t.table == NULL) { -@@ -293,7 +293,7 @@ logmath_write(logmath_t *lmath, const ch - fprintf(fp, "shift %d\n", lmath->t.shift); - fprintf(fp, "logbase %f\n", lmath->base); - /* Pad it out to ensure alignment. */ -- pos = ftell(fp) + strlen("endhdr\n"); -+ pos = FTELL(fp) + strlen("endhdr\n"); - if (pos & ((long)lmath->t.width - 1)) { - size_t align = lmath->t.width - (pos & ((long)lmath->t.width - 1)); - assert(lmath->t.width <= 8); ---- ./src/libsphinxbase/util/Makefile.am.orig 2012-12-05 07:06:08.000000000 -0700 -+++ ./src/libsphinxbase/util/Makefile.am 2013-03-28 16:46:06.364358976 -0600 -@@ -44,7 +44,8 @@ EXTRA_DIST = \ - string_wce.c \ - errno.c - --INCLUDES = -I$(top_srcdir)/include/sphinxbase \ -+AM_CPPFLAGS = \ -+ -I$(top_srcdir)/include/sphinxbase \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include - ---- ./src/libsphinxbase/util/pio.c.orig 2012-12-05 07:06:08.000000000 -0700 -+++ ./src/libsphinxbase/util/pio.c 2013-03-28 16:40:55.418749782 -0600 -@@ -464,7 +464,7 @@ stat_retry(const char *file, struct stat - } - - --int32 -+time_t - stat_mtime(const char *file) - { - struct stat statbuf; -@@ -472,7 +472,7 @@ stat_mtime(const char *file) - if (stat_retry(file, &statbuf) != 0) - return -1; - -- return ((int32) statbuf.st_mtime); -+ return statbuf.st_mtime; - } - #else - #define STAT_RETRY_COUNT 10 -@@ -490,8 +490,8 @@ stat_retry(const char *file, struct stat - - if ((fp=(FILE *)fopen(file, "r"))!= 0) - { -- fseek( fp, 0, SEEK_END); -- statbuf->st_size = ftell( fp ); -+ FSEEK( fp, 0, SEEK_END); -+ statbuf->st_size = FTELL( fp ); - fclose(fp); - return 0; - } -@@ -511,7 +511,7 @@ stat_retry(const char *file, struct stat - return -1; - } - --int32 -+time_t - stat_mtime(const char *file) - { - struct stat statbuf; -@@ -524,7 +524,7 @@ stat_mtime(const char *file) - return -1; - #endif /* HAVE_SYS_STAT_H */ - -- return ((int32) statbuf.st_mtime); -+ return statbuf.st_mtime; - } - #endif /* !_WIN32_WCE */ - ---- ./src/libsphinxbase/util/mmio.c.orig 2012-12-05 07:06:08.000000000 -0700 -+++ ./src/libsphinxbase/util/mmio.c 2013-03-28 16:40:55.419749781 -0600 -@@ -222,7 +222,7 @@ mmio_file_read(const char *filename) - } - ptr = mmap(NULL, buf.st_size, PROT_READ, MAP_SHARED, fd, 0); - if (ptr == (void *)-1) { -- E_ERROR_SYSTEM("Failed to mmap %lld bytes", (unsigned long long)buf.st_size); -+ E_ERROR_SYSTEM("Failed to mmap %" PRIdOFF_T " bytes", buf.st_size); - close(fd); - return NULL; - } -@@ -242,7 +242,7 @@ mmio_file_unmap(mmio_file_t *mf) - if (mf == NULL) - return; - if (munmap(mf->ptr, mf->mapsize) < 0) { -- E_ERROR_SYSTEM("Failed to unmap %ld bytes at %p", mf->mapsize, mf->ptr); -+ E_ERROR_SYSTEM("Failed to unmap %zd bytes at %p", mf->mapsize, mf->ptr); - } - ckd_free(mf); - } ---- ./src/libsphinxbase/lm/ngram_model_dmp.c.orig 2012-12-13 02:01:21.000000000 -0700 -+++ ./src/libsphinxbase/lm/ngram_model_dmp.c 2013-03-28 16:40:55.419749781 -0600 -@@ -95,7 +95,7 @@ ngram_model_dmp_read(cmd_ln_t *config, - trigram_t *tgptr; - char *tmp_word_str; - char *map_base = NULL; -- size_t offset = 0; -+ OFF_T offset = 0; - - base = NULL; - do_mmap = FALSE; -@@ -243,7 +243,7 @@ ngram_model_dmp_read(cmd_ln_t *config, - - /* Now mmap() the file and read in the rest of the (read-only) stuff. */ - if (do_mmap) { -- offset = ftell(fp); -+ offset = FTELL(fp); - - /* Check for improper word alignment. */ - if (offset & 0x3) { -@@ -320,7 +320,7 @@ ngram_model_dmp_read(cmd_ln_t *config, - if (n_bigram > 0) { - /* read n_prob2 and prob2 array (in memory) */ - if (do_mmap) -- fseek(fp, offset, SEEK_SET); -+ FSEEK(fp, offset, SEEK_SET); - if (fread(&k, sizeof(k), 1, fp) != 1) - goto error_out; - if (do_swap) SWAP_INT32(&k); -@@ -381,7 +381,7 @@ ngram_model_dmp_read(cmd_ln_t *config, - - /* read tseg_base size and tseg_base */ - if (do_mmap) -- offset = ftell(fp); -+ offset = FTELL(fp); - if (n_trigram > 0) { - if (do_mmap) { - memcpy(&k, map_base + offset, sizeof(k)); -@@ -753,7 +753,7 @@ static void - ngram_model_dmp_write_fmtdesc(FILE * fh) - { - int32 i, k; -- long pos; -+ OFF_T pos; - - /* Write file format description into header */ - for (i = 0; fmtdesc[i] != NULL; i++) { -@@ -762,7 +762,7 @@ ngram_model_dmp_write_fmtdesc(FILE * fh) - fwrite(fmtdesc[i], 1, k, fh); - } - /* Pad it out in order to achieve 32-bit alignment */ -- pos = ftell(fh); -+ pos = FTELL(fh); - k = pos & 3; - if (k) { - fwrite_int32(fh, 4-k); ---- ./src/libsphinxbase/lm/Makefile.am.orig 2012-12-05 07:06:07.000000000 -0700 -+++ ./src/libsphinxbase/lm/Makefile.am 2013-03-28 16:45:38.260476346 -0600 -@@ -26,7 +26,8 @@ noinst_HEADERS = ngram_model_internal.h - jsgf_scanner.h \ - jsgf_parser.h - --INCLUDES = -I$(top_srcdir)/include/sphinxbase \ -+AM_CPPFLAGS = \ -+ -I$(top_srcdir)/include/sphinxbase \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include - ---- ./src/libsphinxbase/fe/Makefile.am.orig 2012-12-05 07:06:08.000000000 -0700 -+++ ./src/libsphinxbase/fe/Makefile.am 2013-03-28 16:44:41.420532959 -0600 -@@ -17,8 +17,9 @@ noinst_HEADERS = \ - fe_warp_inverse_linear.h \ - fe_warp_piecewise_linear.h - --INCLUDES = -I$(top_srcdir)/include/sphinxbase \ -- -I$(top_srcdir)/include \ -- -I$(top_builddir)/include -+AM_CPPFLAGS = \ -+ -I$(top_srcdir)/include/sphinxbase \ -+ -I$(top_srcdir)/include \ -+ -I$(top_builddir)/include - - LIBOBJS = @LIBOBJS@ ---- ./src/libsphinxbase/feat/Makefile.am.orig 2012-12-05 07:06:05.000000000 -0700 -+++ ./src/libsphinxbase/feat/Makefile.am 2013-03-28 16:45:07.212507287 -0600 -@@ -7,7 +7,8 @@ libsphinxfeat_la_SOURCES = \ - lda.c \ - feat.c - --INCLUDES = -I$(top_srcdir)/include/sphinxbase \ -+AM_CPPFLAGS = \ -+ -I$(top_srcdir)/include/sphinxbase \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include - ---- ./src/libsphinxbase/feat/feat.c.orig 2012-12-05 07:06:05.000000000 -0700 -+++ ./src/libsphinxbase/feat/feat.c 2013-03-28 16:40:55.420749780 -0600 -@@ -1041,15 +1041,15 @@ feat_s2mfc_read_norm_pad(feat_t *fcb, ch - - /* Check if n_float32 matches file size */ - byterev = 0; -- if ((int32) (n_float32 * sizeof(float32) + 4) != (int32) statbuf.st_size) { /* RAH, typecast both sides to remove compile warning */ -+ if ((OFF_T) (n_float32 * sizeof(float32) + 4) != statbuf.st_size) { - n = n_float32; - SWAP_INT32(&n); - -- if ((int32) (n * sizeof(float32) + 4) != (int32) (statbuf.st_size)) { /* RAH, typecast both sides to remove compile warning */ -+ if ((OFF_T) (n * sizeof(float32) + 4) != statbuf.st_size) { - E_ERROR -- ("%s: Header size field: %d(%08x); filesize: %d(%08x)\n", -- file, n_float32, n_float32, statbuf.st_size, -- statbuf.st_size); -+ ("%s: Header size field: %d(%08x); filesize: %" PRIdOFF_T -+ "(%08" PRIxOFF_T ")\n", file, n_float32, n_float32, -+ statbuf.st_size, statbuf.st_size); - fclose(fp); - return -1; - } -@@ -1120,7 +1120,7 @@ feat_s2mfc_read_norm_pad(feat_t *fcb, ch - /* Position at desired start frame and read actual MFC data */ - mfc = (mfcc_t **)ckd_calloc_2d(n + start_pad + end_pad, cepsize, sizeof(mfcc_t)); - if (sf > 0) -- fseek(fp, sf * cepsize * sizeof(float32), SEEK_CUR); -+ FSEEK(fp, sf * cepsize * sizeof(float32), SEEK_CUR); - n_float32 = n * cepsize; - #ifdef FIXED_POINT - float_feat = ckd_calloc(n_float32, sizeof(float32)); ---- ./test/unit/test_fe/Makefile.am.orig 2012-12-05 07:04:49.000000000 -0700 -+++ ./test/unit/test_fe/Makefile.am 2013-03-28 16:54:30.067347095 -0600 -@@ -1,7 +1,7 @@ - check_PROGRAMS = test_fe test_pitch - - TESTS = test_fe test_pitch --INCLUDES = \ -+AM_CPPFLAGS = \ - -I$(top_srcdir)/include/sphinxbase \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ ---- ./test/unit/test_matrix/Makefile.am.orig 2012-12-05 07:04:50.000000000 -0700 -+++ ./test/unit/test_matrix/Makefile.am 2013-03-28 16:55:39.243226827 -0600 -@@ -5,7 +5,7 @@ test_solve_SRCS = test_solve.c - test_invert_SRCS = test_invert.c - test_determinant_SRCS = test_determinant.c - --INCLUDES = \ -+AM_CPPFLAGS = \ - -I$(top_srcdir)/include/sphinxbase \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include ---- ./test/unit/test_ngram/Makefile.am.orig 2012-12-05 07:04:51.000000000 -0700 -+++ ./test/unit/test_ngram/Makefile.am 2013-03-28 16:55:51.936211258 -0600 -@@ -12,7 +12,7 @@ check_PROGRAMS = \ - - TESTS = $(check_PROGRAMS) - --INCLUDES = \ -+AM_CPPFLAGS = \ - -I$(top_srcdir)/include/sphinxbase \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ ---- ./test/unit/test_logmath/Makefile.am.orig 2012-12-05 07:04:49.000000000 -0700 -+++ ./test/unit/test_logmath/Makefile.am 2013-03-28 16:55:27.579241956 -0600 -@@ -1,7 +1,7 @@ - check_PROGRAMS = test_log_int16 test_log_int8 test_log_shifted - TESTS = test_log_int16 test_log_int8 test_log_shifted - --INCLUDES = \ -+AM_CPPFLAGS = \ - -I$(top_srcdir)/include/sphinxbase \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include ---- ./test/unit/test_thread/Makefile.am.orig 2012-12-05 07:04:51.000000000 -0700 -+++ ./test/unit/test_thread/Makefile.am 2013-03-28 16:56:12.259187552 -0600 -@@ -6,7 +6,7 @@ check_PROGRAMS = \ - - TESTS = $(check_PROGRAMS) - --INCLUDES = \ -+AM_CPPFLAGS = \ - -I$(top_srcdir)/include/sphinxbase \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ ---- ./test/unit/test_string/Makefile.am.orig 2012-12-05 07:04:51.000000000 -0700 -+++ ./test/unit/test_string/Makefile.am 2013-03-28 16:56:02.147199203 -0600 -@@ -1,6 +1,6 @@ - check_PROGRAMS = strtest test_atof - --INCLUDES = \ -+AM_CPPFLAGS = \ - -I$(top_srcdir)/include/sphinxbase \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ ---- ./test/unit/test_alloc/Makefile.am.orig 2012-12-05 07:04:49.000000000 -0700 -+++ ./test/unit/test_alloc/Makefile.am 2013-03-28 16:53:39.459433760 -0600 -@@ -3,7 +3,7 @@ check_PROGRAMS = test_ckd_alloc test_ckd - - TESTS = test_ckd_alloc test_ckd_alloc_catch test_ckd_alloc_fail.sh test_ckd_alloc_abort.sh \ - test_listelem_alloc --INCLUDES = \ -+AM_CPPFLAGS = \ - -I$(top_srcdir)/include/sphinxbase \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ ---- ./test/unit/test_util/Makefile.am.orig 2012-12-05 07:04:52.000000000 -0700 -+++ ./test/unit/test_util/Makefile.am 2013-03-28 16:56:22.763175670 -0600 -@@ -9,7 +9,7 @@ check_PROGRAMS = \ - - TESTS = $(check_PROGRAMS) - --INCLUDES = \ -+AM_CPPFLAGS = \ - -I$(top_srcdir)/include/sphinxbase \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ ---- ./test/unit/test_ad/Makefile.am.orig 2012-12-05 07:04:49.000000000 -0700 -+++ ./test/unit/test_ad/Makefile.am 2013-03-28 16:53:25.347448696 -0600 -@@ -1,7 +1,7 @@ - check_PROGRAMS = test_ad_read test_ad_copy - - TESTS = test_ad_read test_ad_copy --INCLUDES = \ -+AM_CPPFLAGS = \ - -I$(top_srcdir)/include/sphinxbase \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ ---- ./test/unit/test_lineiter/Makefile.am.orig 2012-12-05 07:04:52.000000000 -0700 -+++ ./test/unit/test_lineiter/Makefile.am 2013-03-28 16:55:17.075256551 -0600 -@@ -1,7 +1,7 @@ - check_PROGRAMS = test_lineiter - TESTS = test_lineiter - --INCLUDES = \ -+AM_CPPFLAGS = \ - -I$(top_srcdir)/include/sphinxbase \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ ---- ./test/unit/test_fsg/Makefile.am.orig 2012-12-05 07:04:52.000000000 -0700 -+++ ./test/unit/test_fsg/Makefile.am 2013-03-28 16:54:53.411295002 -0600 -@@ -5,7 +5,7 @@ check_PROGRAMS = \ - - TESTS = $(check_PROGRAMS) - --INCLUDES = \ -+AM_CPPFLAGS = \ - -I$(top_srcdir)/include/sphinxbase \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ ---- ./test/unit/test_feat/Makefile.am.orig 2012-12-05 07:04:52.000000000 -0700 -+++ ./test/unit/test_feat/Makefile.am 2013-03-28 16:54:41.331319484 -0600 -@@ -1,7 +1,7 @@ - check_PROGRAMS = test_feat test_feat_live test_feat_fe test_subvq - noinst_HEADERS = test_macros.h - --INCLUDES = \ -+AM_CPPFLAGS = \ - -I$(top_srcdir)/include/sphinxbase \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ ---- ./test/unit/test_hash/Makefile.am.orig 2012-12-05 07:04:49.000000000 -0700 -+++ ./test/unit/test_hash/Makefile.am 2013-03-28 16:55:03.931276701 -0600 -@@ -2,7 +2,7 @@ check_PROGRAMS = displayhash deletehash - - noinst_HEADERS = test_macros.h - --INCLUDES = \ -+AM_CPPFLAGS = \ - -I$(top_srcdir)/include/sphinxbase \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include ---- ./test/unit/test_case/Makefile.am.orig 2012-12-05 07:04:52.000000000 -0700 -+++ ./test/unit/test_case/Makefile.am 2013-03-28 16:54:06.979405726 -0600 -@@ -1,7 +1,7 @@ - check_PROGRAMS = chgCase - - --INCLUDES = \ -+AM_CPPFLAGS = \ - -I$(top_srcdir)/include/sphinxbase \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include ---- ./test/unit/test_bitvec/Makefile.am.orig 2012-12-05 07:04:52.000000000 -0700 -+++ ./test/unit/test_bitvec/Makefile.am 2013-03-28 16:53:54.795418055 -0600 -@@ -1,7 +1,7 @@ - check_PROGRAMS = test_bitvec - - TESTS = test_bitvec --INCLUDES = \ -+AM_CPPFLAGS = \ - -I$(top_srcdir)/include/sphinxbase \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ ---- ./test/unit/test_cmdln/Makefile.am.orig 2012-12-05 07:04:49.000000000 -0700 -+++ ./test/unit/test_cmdln/Makefile.am 2013-03-28 16:54:17.795384850 -0600 -@@ -1,6 +1,6 @@ - check_PROGRAMS = cmdln_parse cmdln_parse_multiple cmdln_parse_r - --INCLUDES = \ -+AM_CPPFLAGS = \ - -I$(top_srcdir)/include/sphinxbase \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include ---- ./test/regression/Makefile.am.orig 2012-12-05 07:05:39.000000000 -0700 -+++ ./test/regression/Makefile.am 2013-03-28 16:51:58.403771849 -0600 -@@ -33,9 +33,9 @@ CLEANFILES = test*.err test*.out \ - - # Disable sphinx_fe tests for now if fixed-point due to imprecision - if FIXED_POINT --TESTS = $(srcdir)/test-cepview.sh $(srcdir)/test-sphinx_pitch.sh -+TESTS = test-cepview.sh test-sphinx_pitch.sh - else --TESTS = $(srcdir)/test-*.sh -+TESTS = test-*.sh - endif - - EXTRA_DIST += $(TESTS) diff --git a/sphinxbase-uninit.patch b/sphinxbase-uninit.patch deleted file mode 100644 index 5a5e0ec..0000000 --- a/sphinxbase-uninit.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- src/sphinx_lmtools/sphinx_lm_eval.c.orig 2012-12-05 07:06:03.000000000 -0700 -+++ src/sphinx_lmtools/sphinx_lm_eval.c 2013-03-29 07:59:16.776912497 -0600 -@@ -193,7 +193,7 @@ - { - FILE *fh; - lineiter_t *litor; -- int32 nccs, noovs, nwords, lscr; -+ int32 nccs, noovs, nwords, lscr = 0; - float64 ch, log_to_log2;; - - if ((fh = fopen(lsnfn, "r")) == NULL) diff --git a/sphinxbase.spec b/sphinxbase.spec index 2f326b4..d006717 100644 --- a/sphinxbase.spec +++ b/sphinxbase.spec @@ -1,18 +1,11 @@ Name: sphinxbase -Version: 0.8 -Release: 21%{?dist} +Version: 5prealpha +Release: 1%{?dist} Summary: Common library for CMU Sphinx voice recognition products License: BSD URL: http://cmusphinx.sourceforge.net/ Source0: http://downloads.sourceforge.net/cmusphinx/%{name}-%{version}.tar.gz -# Sent upstream 28 Mar 2013. Enable large file support. -Patch0: %{name}-largefile.patch -# Sent upstream 29 Mar 2013. Fix an uninitialized variable that leads to bogus -# lm scores. -Patch1: %{name}-uninit.patch -# Sent upstream 29 Mar 2013. Fix broken doxygen comments. -Patch2: %{name}-doxygen.patch BuildRequires: bison BuildRequires: doxygen-latex @@ -63,14 +56,14 @@ Python 2 interface to sphinxbase. %prep %setup -q -%patch0 -%patch1 -%patch2 # Use openblas instead of the blas reference implementation -sed -ri 's/blas|lapack/openblas/' configure.in +sed -ri 's/blas|lapack/openblas/' configure.ac -# Regenerate configure files due to changes in patch 0 and the openblas change +# Use system-provided ax_python_devel.m4 +rm -f m4/ax_python_devel.m4 + +# Regenerate configure files due to openblas and m4 changes autoreconf -fi # Fix encoding @@ -81,13 +74,8 @@ mv -f AUTHORS.new AUTHORS # Force code generation with newer versions of Cython and bison rm -f python/sphinxbase.c src/libsphinxbase/lm/jsgf_parser.{c,h} -# Install the python egg in the Fedora way -sed 's|\( install \)--prefix\( \$(DESTDIR)\)\$(prefix)|\1--skip-build --root\2|' \ - -i python/Makefile.in - # Improve auto requires detection -for f in src/sphinx_lmtools/sphinx_lm_sort src/sphinx_jsgf2fsg/fsg2dot.pl \ - python/hufftest2.py python/sb_test.py; do +for f in src/sphinx_jsgf2fsg/fsg2dot.pl; do sed -r 's|/usr/bin/env (.*)|/usr/bin/\1|' $f > $f.new touch -r $f $f.new mv -f $f.new $f @@ -134,9 +122,6 @@ cp -p doc/*.1 %{buildroot}%{_mandir}/man1 # Remove libtool archives rm -f %{buildroot}%{_libdir}/*.la -# Fix a permission problem -chmod 0755 %{buildroot}%{python2_sitearch}/%{name}.so - %ldconfig_scriptlets libs %files @@ -149,10 +134,11 @@ chmod 0755 %{buildroot}%{python2_sitearch}/%{name}.so %{_libdir}/libsphinxad.so %{_libdir}/libsphinxbase.so %{_libdir}/pkgconfig/sphinxbase.pc +%{_datadir}/sphinxbase/ %files libs -%doc AUTHORS ChangeLog NEWS README -%license COPYING +%doc AUTHORS NEWS README +%license LICENSE %{_libdir}/libsphinxad.so.* %{_libdir}/libsphinxbase.so.* @@ -160,6 +146,9 @@ chmod 0755 %{buildroot}%{python2_sitearch}/%{name}.so %{python2_sitearch}/* %changelog +* Sun Jul 22 2018 W. Michael Petullo - 5prealpha-1 +- New upstream release + * Sat Jul 14 2018 Fedora Release Engineering - 0.8-21 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild