Source: gpredict Version: 2.0-4 Tags: patch User: helm...@debian.org Usertags: rebootstrap
gpredict fails to cross build from source, because it configures for the build architecture. It actually configures twice. Once from autogen.sh and another time from dh_auto_configure. The first invocation tends to fail for cross compilation though and that aborts the build. Skipping it makes the build proceed. Then ./configure uses the wrong pkg-config. Another patch fixes that. After applying both, gpredict cross builds successfully. Please consider applying them. Helmut
diff --minimal -Nru gpredict-2.0/debian/changelog gpredict-2.0/debian/changelog --- gpredict-2.0/debian/changelog 2017-12-28 15:01:00.000000000 +0100 +++ gpredict-2.0/debian/changelog 2018-01-22 21:43:25.000000000 +0100 @@ -1,3 +1,13 @@ +gpredict (2.0-4.1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * Fix FTCBFS: (Closes: #-1) + + 0125-skip-configure.patch: Only run ./configure once and let + dh_auto_configure do it. + + 0126-cross-pkg-config.patch: Consider $ac_tool_prefix for pkg-config. + + -- Helmut Grohne <hel...@subdivi.de> Mon, 22 Jan 2018 21:43:25 +0100 + gpredict (2.0-4) unstable; urgency=medium * Update to v2.1-123-gc6bc520 diff --minimal -Nru gpredict-2.0/debian/patches/0125-skip-configure.patch gpredict-2.0/debian/patches/0125-skip-configure.patch --- gpredict-2.0/debian/patches/0125-skip-configure.patch 1970-01-01 01:00:00.000000000 +0100 +++ gpredict-2.0/debian/patches/0125-skip-configure.patch 2018-01-22 21:43:22.000000000 +0100 @@ -0,0 +1,18 @@ +From: Helmut Grohne <hel...@subdivi.de> +Subject: avoid failing configure during ./autogen.sh, let dh_auto_configure call it + +Index: gpredict-2.0/autogen.sh +=================================================================== +--- gpredict-2.0.orig/autogen.sh ++++ gpredict-2.0/autogen.sh +@@ -50,9 +50,7 @@ + echo "- autoconf." && \ + autoconf && \ + echo "- automake." && \ +- automake --add-missing --gnu && \ +-echo && \ +- ./configure "$@" && exit 0 ++ automake --add-missing --gnu && exit 0 + + exit 1 + diff --minimal -Nru gpredict-2.0/debian/patches/0126-cross-pkg-config.patch gpredict-2.0/debian/patches/0126-cross-pkg-config.patch --- gpredict-2.0/debian/patches/0126-cross-pkg-config.patch 1970-01-01 01:00:00.000000000 +0100 +++ gpredict-2.0/debian/patches/0126-cross-pkg-config.patch 2018-01-22 21:43:25.000000000 +0100 @@ -0,0 +1,78 @@ +Index: gpredict-2.0/configure.ac +=================================================================== +--- gpredict-2.0.orig/configure.ac ++++ gpredict-2.0/configure.ac +@@ -28,16 +28,21 @@ + # check for libm + AC_CHECK_LIB([m], [sin],, AC_MSG_ERROR([Can not find libm. Check your libc installation])) + ++PKG_PROG_PKG_CONFIG ++if test "x$PKG_CONFIG" = x; then ++ AC_MSG_ERROR(Gpredict requires pkg-config) ++fi ++ + # check for libcurl +-if pkg-config --atleast-version=7.19 libcurl; then +- CFLAGS="$CFLAGS `pkg-config --cflags libcurl`" +- LIBS="$LIBS `pkg-config --libs libcurl`" ++if $PKG_CONFIG --atleast-version=7.19 libcurl; then ++ CFLAGS="$CFLAGS `$PKG_CONFIG --cflags libcurl`" ++ LIBS="$LIBS `$PKG_CONFIG --libs libcurl`" + else + AC_MSG_ERROR(Gpredict requires libcurl-dev 7.19 or later) + fi + + # check for glib >2.32 +-if pkg-config --atleast-version=2.32 glib-2.0; then ++if $PKG_CONFIG --atleast-version=2.32 glib-2.0; then + CFLAGS="$CFLAGS" + LIBS="$LIBS" + else +@@ -45,17 +50,17 @@ + fi + + # check for goocanvas (depends on gtk and glib) +-if pkg-config --atleast-version=2.0 goocanvas-2.0; then +- CFLAGS="$CFLAGS `pkg-config --cflags goocanvas-2.0`" +- LIBS="$LIBS `pkg-config --libs goocanvas-2.0`" ++if $PKG_CONFIG --atleast-version=2.0 goocanvas-2.0; then ++ CFLAGS="$CFLAGS `$PKG_CONFIG --cflags goocanvas-2.0`" ++ LIBS="$LIBS `$PKG_CONFIG --libs goocanvas-2.0`" + else + AC_MSG_ERROR(Gpredict requires libgoocanvas-2.0-dev) + fi + + # check for libgps (optional) +-if pkg-config --atleast-version=2.90 libgps; then +- CFLAGS="$CFLAGS `pkg-config --cflags libgps`" +- LIBS="$LIBS `pkg-config --libs libgps`" ++if $PKG_CONFIG --atleast-version=2.90 libgps; then ++ CFLAGS="$CFLAGS `$PKG_CONFIG --cflags libgps`" ++ LIBS="$LIBS `$PKG_CONFIG --libs libgps`" + havelibgps=true; + AC_DEFINE(HAS_LIBGPS, 1, [Define if libgps is available]) + else +@@ -88,15 +93,15 @@ + AM_CONDITIONAL(UPDATE_CACHES, test x"$enable_caches" = "xyes") + + +-GLIB_V=`pkg-config --modversion glib-2.0` +-GIO_V=`pkg-config --modversion gio-2.0` +-GTHR_V=`pkg-config --modversion gthread-2.0` +-GDK_V=`pkg-config --modversion gdk-3.0` +-GTK_V=`pkg-config --modversion gtk+-3.0` +-GOOC_V=`pkg-config --modversion goocanvas-2.0` +-CURL_V=`pkg-config --modversion libcurl` ++GLIB_V=`$PKG_CONFIG --modversion glib-2.0` ++GIO_V=`$PKG_CONFIG --modversion gio-2.0` ++GTHR_V=`$PKG_CONFIG --modversion gthread-2.0` ++GDK_V=`$PKG_CONFIG --modversion gdk-3.0` ++GTK_V=`$PKG_CONFIG --modversion gtk+-3.0` ++GOOC_V=`$PKG_CONFIG --modversion goocanvas-2.0` ++CURL_V=`$PKG_CONFIG --modversion libcurl` + if test "$havelibgps" = true ; then +- GPS_V=`pkg-config --modversion libgps` ++ GPS_V=`$PKG_CONFIG --modversion libgps` + fi + + diff --minimal -Nru gpredict-2.0/debian/patches/series gpredict-2.0/debian/patches/series --- gpredict-2.0/debian/patches/series 2017-12-28 15:01:00.000000000 +0100 +++ gpredict-2.0/debian/patches/series 2018-01-22 21:43:25.000000000 +0100 @@ -122,3 +122,5 @@ 0122-Fix-GtkDialog-mapped-without-.-messages.patch 0123-Update-NEWS-file.patch 0124-Update-translation-files.patch +0125-skip-configure.patch +0126-cross-pkg-config.patch