[sphinxbase] Different approach to the -largefile patch to fix problems with the original. Drop -aarch64 patch si
Jerry James
jjames at fedoraproject.org
Fri Mar 29 14:21:14 UTC 2013
commit 85877beca735a25be828476f8bc407f65efbe155
Author: Jerry James <jamesjer at betterlinux.com>
Date: Fri Mar 29 08:20:55 2013 -0600
Different approach to the -largefile patch to fix problems with the original.
Drop -aarch64 patch since we now run autoreconf.
Add -uninit patch to fix bogus lm scores.
Add -doxygen patch to fix some broken doxygen comments.
sphinxbase-aarch64.patch | 1140 --------------------------------------------
sphinxbase-doxygen.patch | 31 ++
sphinxbase-largefile.patch | 517 ++++++++++++++++++---
sphinxbase-uninit.patch | 11 +
sphinxbase.spec | 20 +-
5 files changed, 522 insertions(+), 1197 deletions(-)
---
diff --git a/sphinxbase-doxygen.patch b/sphinxbase-doxygen.patch
new file mode 100644
index 0000000..245e180
--- /dev/null
+++ b/sphinxbase-doxygen.patch
@@ -0,0 +1,31 @@
+--- ./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
index 9159009..7dd17c4 100644
--- a/sphinxbase-largefile.patch
+++ b/sphinxbase-largefile.patch
@@ -1,5 +1,5 @@
--- ./include/sphinxbase/pio.h.orig 2012-12-05 07:06:01.000000000 -0700
-+++ ./include/sphinxbase/pio.h 2013-03-27 17:05:58.476768707 -0600
++++ ./include/sphinxbase/pio.h 2013-03-28 16:40:55.415749785 -0600
@@ -285,7 +285,7 @@ int32 stat_retry (const char *file, stru
*/
@@ -9,14 +9,94 @@
/**
* 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 07:48:54.079307592 -0600
++++ ./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);
-+ fseeko(fh, 0, SEEK_SET);
++ FSEEK(fh, 0, SEEK_SET);
for (li = lineiter_start(fh); li; li = lineiter_next(li)) {
char **words;
int nword;
@@ -25,7 +105,7 @@
}
- fseek(fh, 1024, SEEK_SET);
-+ fseeko(fh, 1024, SEEK_SET);
++ FSEEK(fh, 1024, SEEK_SET);
if (out_fh)
*out_fh = fh;
else
@@ -34,7 +114,7 @@
FILE *fh;
int32 len;
- long flen;
-+ off_t flen;
++ OFF_T flen;
if ((fh = fopen(wtf->infile, "rb")) == NULL) {
E_ERROR_SYSTEM("Failed to open %s", wtf->infile);
@@ -44,8 +124,8 @@
}
- fseek(fh, 0, SEEK_END);
- flen = ftell(fh);
-+ fseeko(fh, 0, SEEK_END);
-+ flen = ftello(fh);
++ FSEEK(fh, 0, SEEK_END);
++ flen = FTELL(fh);
/* figure out whether to byteswap */
flen = (flen / 4) - 1;
@@ -54,7 +134,7 @@
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%08zx\n",
++ E_ERROR("Mismatch in header/file lengths: 0x%08x vs 0x%08" PRIxOFF_T "\n",
len, flen);
return -1;
}
@@ -63,7 +143,7 @@
}
- fseek(fh, 4, SEEK_SET);
-+ fseeko(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");
@@ -72,7 +152,7 @@
if (wtf->ot->output_header) {
- if (fseek(wtf->outfh, 0, SEEK_SET) < 0) {
-+ if (fseeko(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;
}
@@ -81,18 +161,50 @@
for (li = lineiter_start(ctlfh); li; li = lineiter_next(li))
++nlines;
- fseek(ctlfh, 0, SEEK_SET);
-+ fseeko(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 08:03:12.205319946 -0600
++++ ./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);
-+ fseeko(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;
@@ -101,7 +213,7 @@
cmd_ln_set_boolean("-raw", TRUE);
}
- fseek(infh, 0, SEEK_SET);
-+ fseeko(infh, 0, SEEK_SET);
++ FSEEK(infh, 0, SEEK_SET);
return 0;
}
@@ -110,7 +222,7 @@
/* Any extra parameters. */
if (header_len > 16)
- fseek(infh, header_len - 16, SEEK_CUR);
-+ fseeko(infh, header_len - 16, SEEK_CUR);
++ FSEEK(infh, header_len - 16, SEEK_CUR);
/* Now skip to the 'data' chunk. */
while (1) {
@@ -119,18 +231,34 @@
TRY_FREAD(&intval, 4, 1, infh);
if (WORDS_BIGENDIAN) SWAP_INT32(&intval);
- fseek(infh, intval, SEEK_CUR);
-+ fseeko(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-27 17:15:48.227654656 -0600
++++ ./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) {
++ if ((OFF_T) (n_float * sizeof(float) + 4) != statbuf.st_size) {
n = n_float;
SWAP_INT32(&n);
@@ -138,26 +266,35 @@
- 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: %zd(%08zx)\n",
-+ n_float, n_float, 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 07:54:31.943518377 -0600
-@@ -513,8 +513,9 @@ bio_read_wavfile(char const *directory,
++++ ./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;
-+ off_t n;
n = strlen(extension);
- l = strlen(filename);
@@ -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);
@@ -165,12 +302,12 @@
- fseek(uttfp, 0, SEEK_END);
- n = ftell(uttfp);
- fseek(uttfp, 0, SEEK_SET);
-+ fseeko(uttfp, 0, SEEK_END);
-+ n = ftello(uttfp);
-+ fseeko(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 (fseeko(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);
@@ -179,7 +316,7 @@
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 %zd 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);
@@ -188,18 +325,18 @@
ckd_free(inputfile);
fclose(uttfp);
- if (nsamps) *nsamps = n;
-+ if (nsamps) *nsamps = (int32)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 07:59:05.125888554 -0600
++++ ./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;
++ OFF_T pos;
FILE *fp;
E_INFO("Reading log table file '%s'\n", file_name);
@@ -208,10 +345,10 @@
/* Check alignment constraints for memory mapping */
do_mmap = 1;
- pos = ftell(fp);
-+ pos = ftello(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 %zd 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;
}
@@ -220,7 +357,7 @@
{
FILE *fp;
- long pos;
-+ off_t pos;
++ OFF_T pos;
uint32 chksum;
if (lmath->t.table == NULL) {
@@ -229,12 +366,24 @@
fprintf(fp, "logbase %f\n", lmath->base);
/* Pad it out to ensure alignment. */
- pos = ftell(fp) + strlen("endhdr\n");
-+ pos = ftello(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 07:56:11.374292764 -0600
++++ ./src/libsphinxbase/util/pio.c 2013-03-28 16:40:55.418749782 -0600
@@ -464,7 +464,7 @@ stat_retry(const char *file, struct stat
}
@@ -259,8 +408,8 @@
{
- fseek( fp, 0, SEEK_END);
- statbuf->st_size = ftell( fp );
-+ fseeko( fp, 0, SEEK_END);
-+ statbuf->st_size = ftello( fp );
++ FSEEK( fp, 0, SEEK_END);
++ statbuf->st_size = FTELL( fp );
fclose(fp);
return 0;
}
@@ -282,14 +431,34 @@
}
#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 08:01:33.901539198 -0600
++++ ./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;
++ OFF_T offset = 0;
base = NULL;
do_mmap = FALSE;
@@ -298,7 +467,7 @@
/* Now mmap() the file and read in the rest of the (read-only) stuff. */
if (do_mmap) {
- offset = ftell(fp);
-+ offset = ftello(fp);
++ offset = FTELL(fp);
/* Check for improper word alignment. */
if (offset & 0x3) {
@@ -307,7 +476,7 @@
/* read n_prob2 and prob2 array (in memory) */
if (do_mmap)
- fseek(fp, offset, SEEK_SET);
-+ fseeko(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);
@@ -316,7 +485,7 @@
/* read tseg_base size and tseg_base */
if (do_mmap)
- offset = ftell(fp);
-+ offset = ftello(fp);
++ offset = FTELL(fp);
if (n_trigram > 0) {
if (do_mmap) {
memcpy(&k, map_base + offset, sizeof(k));
@@ -325,7 +494,7 @@
{
int32 i, k;
- long pos;
-+ off_t pos;
++ OFF_T pos;
/* Write file format description into header */
for (i = 0; fmtdesc[i] != NULL; i++) {
@@ -334,26 +503,266 @@
}
/* Pad it out in order to achieve 32-bit alignment */
- pos = ftell(fh);
-+ pos = ftello(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-27 17:17:47.787440142 -0600
-@@ -1041,13 +1041,13 @@ feat_s2mfc_read_norm_pad(feat_t *fcb, ch
++++ ./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) {
++ 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) {
++ if ((OFF_T) (n * sizeof(float32) + 4) != statbuf.st_size) {
E_ERROR
- ("%s: Header size field: %d(%08x); filesize: %d(%08x)\n",
-+ ("%s: Header size field: %d(%08x); filesize: %zd(%08zx)\n",
- file, n_float32, n_float32, statbuf.st_size,
- statbuf.st_size);
+- 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
new file mode 100644
index 0000000..5a5e0ec
--- /dev/null
+++ b/sphinxbase-uninit.patch
@@ -0,0 +1,11 @@
+--- 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 5a97705..461752f 100644
--- a/sphinxbase.spec
+++ b/sphinxbase.spec
@@ -1,6 +1,6 @@
Name: sphinxbase
Version: 0.8
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: Common library for CMU Sphinx voice recognition products
Group: Development/Libraries
@@ -9,8 +9,11 @@ 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 28 Mar 2013. Enable building on aarch64.
-Patch1: %{name}-aarch64.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: Cython
@@ -19,6 +22,7 @@ BuildRequires: ghostscript
BuildRequires: lapack-devel
BuildRequires: libsamplerate-devel
BuildRequires: libsndfile-devel
+BuildRequires: libtool
BuildRequires: perl
BuildRequires: perl(Pod::Usage)
BuildRequires: pulseaudio-libs-devel
@@ -60,6 +64,10 @@ Python 2 interface to sphinxbase.
%setup -q
%patch0
%patch1
+%patch2
+
+# Regenerate the configure files due to changes in patch 0
+autoreconf -fi
# Fix encoding
iconv -f ISO8859-1 -t UTF-8 -o AUTHORS.new AUTHORS
@@ -141,6 +149,12 @@ chmod 0755 $RPM_BUILD_ROOT%{python2_sitearch}/%{name}.so
%{python2_sitearch}/*
%changelog
+* Fri Mar 29 2013 Jerry James <loganjerry at gmail.com> - 0.8-4
+- Different approach to the -largefile patch to fix problems with the original
+- Drop -aarch64 patch since we now run autoreconf
+- Add -uninit patch to fix bogus lm scores
+- Add -doxygen patch to fix some broken doxygen comments
+
* Thu Mar 28 2013 Jerry James <loganjerry at gmail.com> - 0.8-3
- Add -largefile patch to get large file support
- Add -aarch64 patch (bz 926565)
More information about the scm-commits
mailing list