Source: pocketsphinx
Version: 0.8+5prealpha+1-11
Tags: patch upstream
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

pocketsphinx fails to cross build from source. One reason is that it
uses the build architecture pkg-config via AC_CHECK_PROG. The attached
patch replaces the use with PKG_PROG_PKG_CONFIG.

Another reason is that configure.ac decides that during cross
compilation, it should skip the gstreamer stuff (search for
AM_CONDITIONAL and BUILD_GST). Thus dh_install complains about missing
files. I think this upstream choice is unfortunate. I think upstream
should leave that choice to users (e.g. using an AC_ARG_WITH). Thus
users could enable it despite cross compilation. Do you think that would
work with upstream? It could look like:

AC_ARG_WITH(gstreamer, AS_HELP_STRING([--with-gstreamer],[Enable GStreamer 
plugin, autodetect unless cross building]))
AS_IF([test "x$with_gstreamer" != xno],[
  PKG_CHECK_MODULES(GStreamer, ..., HAVE_GST=yes, HAVE_GST=no)
  AS_IF([test "x$with_gstreamer" = xyes && test "$HAVE_GST" = no],[
    AC_MSG_ERROR(["gstreamer not found])])
])
AM_CONDITIONAL(BUILD_GST, test "x$with_gstreamer" != xno && test "$HAVE_GST" = 
yes && { test "x$with_gstreamer" = yes || test "$cross_compiling" = no; })

Even after enabling BUILD_GST, the cross build fails, because
dh_gstscancodecs does not work during cross building (even though the
plugin was successfully cross built). We don't presently have a solution
to this.

Please consider applying the attached patch to fix the pkg-config issue.
Please consider talking to upstream and propose the --with-gstreamer
switch to allow cross building the gstreamer plugin and unconditionally
pass --with-gstreamer to the build if that was successful. Please close
this bug even if pocketsphinx fails in dh_gstscancodecs.

Helmut
--- pocketsphinx-0.8+5prealpha+1.orig/configure.ac
+++ pocketsphinx-0.8+5prealpha+1/configure.ac
@@ -18,7 +18,7 @@
 dnl
 dnl Check for pkgconfig
 dnl
-AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
+PKG_PROG_PKG_CONFIG
 
 dnl
 dnl Check for Doxygen, and build dox if present
@@ -117,7 +118,7 @@
 if test x$sphinxbase = x || test x$sphinxbase = xauto; then
    sphinxbase=
 
-   if test "x$HAVE_PKGCONFIG" = "xno"; then
+   if test "x$PKG_CONFIG" = "x"; then
       SPHINXBASE_CFLAGS = "-I/usr/include/sphinxbase -I/usr/local/include/sphinxbase"
       SPHINXBASE_LIBS = "-lsphinxbase"
       SPHINXBASE_PREFIX="/usr/local"
@@ -128,7 +128,7 @@
 Make sure that you have installed it and that the
 PKG_CONFIG_PATH environment variable is set correctly, if
 it was installed in a non-standard prefix.])])
-      SPHINXBASE_PREFIX=`pkg-config --variable=prefix sphinxbase`
+      SPHINXBASE_PREFIX=`$PKG_CONFIG --variable=prefix sphinxbase`
    fi
    
    LIBS="$LIBS $SPHINXBASE_LIBS"

Reply via email to