Source: autogen
Version: 5.18.10-2
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

Hi Andreas,

thank you for your autogen maintenance and applying my past patches. I
have new issues with autogen and would like to see them fixed in autogen
directly. If you are using sbuild, you can cross build packages simply
by passing --host=$some_debian_arch nowadays. To make that work for
sbuild, a few more bits are needed.

 * Pass --add-depends=libc-dev to sbuild to work around #815172.
 * autogen's configure fails to find guile, because it invokes plain
   pkg-config. In former times, cross build environments would set up
   PKG_CONFIG_LIBDIR so invoking plain pkg-config worked. Nowadays, we
   expect packages to invoke a triplet prefixed pkg-config cross wrapper
   explicitly. Most of autogen does that already, except for one
   relevant place in config/misc.def. Also debian/rules misses those
   prefixed in two occasions.
 * In former times, we would collect configure check results for checks
   that don't work with cross compilation in dpkg-cross. However, some
   of these results are very specific and better put into individual
   packages. In this case, libopts_cv_with_libregex is already specific
   to autogen (via the libopts prefix) and to make matters worse,
   autogen doesn't build at all without this being yes. So for cross
   builds we should simply assume that the C library provides a working
   libregex.

I am attaching a patch for the latter two issues. Do you mind applying
it to the autogen source package?

Helmut
diff --minimal -Nru autogen-5.18.10/debian/changelog 
autogen-5.18.10/debian/changelog
--- autogen-5.18.10/debian/changelog    2016-07-17 13:20:07.000000000 +0200
+++ autogen-5.18.10/debian/changelog    2016-08-01 19:23:48.000000000 +0200
@@ -1,3 +1,13 @@
+autogen (1:5.18.10-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS. Closes: #-1
+    + Invoke the triplet prefixed pkg-config
+    + Always assume that the libc comes with a working libregex as autogen
+      doesn't work at all without it
+
+ -- Helmut Grohne <hel...@subdivi.de>  Mon, 01 Aug 2016 17:11:43 +0200
+
 autogen (1:5.18.10-2) unstable; urgency=low
 
   * Upload to unstable.
diff --minimal -Nru autogen-5.18.10/debian/patches/05_cross_pkg_config.diff 
autogen-5.18.10/debian/patches/05_cross_pkg_config.diff
--- autogen-5.18.10/debian/patches/05_cross_pkg_config.diff     1970-01-01 
01:00:00.000000000 +0100
+++ autogen-5.18.10/debian/patches/05_cross_pkg_config.diff     2016-08-01 
19:28:50.000000000 +0200
@@ -0,0 +1,33 @@
+From: Helmut Grohne <hel...@subdivi.de>
+Subject: Invoke the triplet prefixed pkg-config
+Last-Update: 2016-08-01
+
+Otherwise pkg-config examines the build architecture which usually doesn't have
+the relevant dependencies installed or whose flags is different.
+
+Index: autogen-5.18.10/config/misc.def
+===================================================================
+--- autogen-5.18.10.orig/config/misc.def
++++ autogen-5.18.10/config/misc.def
+@@ -340,7 +340,7 @@
+ 
+ do-always = <<- _END_ALWAYS_
+       GUILE_FLAGS
+-      [ag_gv=`gdir=\`pkg-config --cflags-only-I \
++      [ag_gv=`gdir=\`$PKG_CONFIG --cflags-only-I \
+                       guile-${GUILE_EFFECTIVE_VERSION} | \
+                       sed 's/-I *//;s/ *-I.*/ /g'\`
+               test -z "$gdir" && gdir=/usr/include
+Index: autogen-5.18.10/config/ag_macros.m4
+===================================================================
+--- autogen-5.18.10.orig/config/ag_macros.m4
++++ autogen-5.18.10/config/ag_macros.m4
+@@ -30,7 +30,7 @@
+ AC_DEFUN([INVOKE_AG_MACROS_LAST],[
+ [if test X${INVOKE_AG_MACROS_LAST_done} != Xyes ; then]
+   GUILE_FLAGS
+-  [ag_gv=`gdir=\`pkg-config --cflags-only-I \
++  [ag_gv=`gdir=\`$PKG_CONFIG --cflags-only-I \
+   guile-${GUILE_EFFECTIVE_VERSION} | \
+   sed 's/-I *//;s/ *-I.*/ /g'\`
+   for d in $gdir
diff --minimal -Nru autogen-5.18.10/debian/patches/series 
autogen-5.18.10/debian/patches/series
--- autogen-5.18.10/debian/patches/series       2016-05-28 07:55:15.000000000 
+0200
+++ autogen-5.18.10/debian/patches/series       2016-08-01 17:13:43.000000000 
+0200
@@ -1,3 +1,4 @@
 04_crossbuild.diff
+05_cross_pkg_config.diff
 10_libopts_tarball_perms.diff
 21_test.error.diff
diff --minimal -Nru autogen-5.18.10/debian/rules autogen-5.18.10/debian/rules
--- autogen-5.18.10/debian/rules        2016-05-28 07:55:15.000000000 +0200
+++ autogen-5.18.10/debian/rules        2016-08-01 19:18:44.000000000 +0200
@@ -1,5 +1,6 @@
 #!/usr/bin/make -f
 
+include /usr/share/dpkg/architecture.mk
 export DEB_BUILD_MAINT_OPTIONS := hardening=+all
 export DEB_LDFLAGS_MAINT_APPEND := -Wl,--as-needed
 export DEB_CFLAGS_MAINT_APPEND := -Wall -Wno-format-contains-nul
@@ -9,12 +10,16 @@
 export BUILD_DATE := $(shell dpkg-parsechangelog --show-field Date)
 export MAN_PAGE_DATE = $(shell env LC_ALL=C date -u -d '$(BUILD_DATE)' 
+%Y-%m-%d)
 
+ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+export libopts_cv_with_libregex=yes
+endif
+
 override_dh_auto_configure:
        dh_auto_configure --verbose -- \
                --disable-silent-rules \
                --enable-timeout=78 \
-               --with-libxml2-libs="$(shell pkg-config --libs libxml-2.0)" \
-               --with-libxml2-cflags="$(shell pkg-config --cflags libxml-2.0)"
+               --with-libxml2-libs="$(shell $(DEB_HOST_GNU_TYPE)-pkg-config 
--libs libxml-2.0)" \
+               --with-libxml2-cflags="$(shell $(DEB_HOST_GNU_TYPE)-pkg-config 
--cflags libxml-2.0)"
 
 override_dh_auto_build:
        dh_auto_build --verbose

Reply via email to