Source: recode
Version: 3.6-23
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

recode fails to cross build from source for two reasons:

 * It configures for the build architecture. recode's ./configure is so
   ancient that it doesn't recognize --host= as passed by
   dh_auto_configure. One needs to export CC instead.
 * It fails running help2man. Adding a native build pass to generate the
   manual page fixes this issue.

With the attached patch, recode cross builds successfully. Please
consider applying it.

Helmut
diff --minimal -Nru recode-3.6/debian/changelog recode-3.6/debian/changelog
--- recode-3.6/debian/changelog 2016-11-30 15:35:40.000000000 +0100
+++ recode-3.6/debian/changelog 2017-08-28 16:51:17.000000000 +0200
@@ -1,3 +1,12 @@
+recode (3.6-23.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Export a triplet-prefixed CC.
+    + Add a native build pass for help2man.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Mon, 28 Aug 2017 16:51:17 +0200
+
 recode (3.6-23) unstable; urgency=medium
 
   * Set manpage date to 2001-01 for reproducible build. Closes: #820457.
diff --minimal -Nru recode-3.6/debian/rules recode-3.6/debian/rules
--- recode-3.6/debian/rules     2016-11-30 14:00:00.000000000 +0100
+++ recode-3.6/debian/rules     2017-08-28 16:51:17.000000000 +0200
@@ -1,5 +1,10 @@
 #!/usr/bin/make -f
 
+include /usr/share/dpkg/architecture.mk
+ifeq ($(origin CC),default)
+CC = $(DEB_HOST_GNU_TYPE)-gcc
+endif
+
 %:
        dh $@
 
@@ -27,7 +32,14 @@
        touch src/Makefile.in
        touch tests/Makefile.in
        touch contrib/Makefile.in
-       dh_auto_configure -- --without-included-gettext
+ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
+       # native build pass to save the help2man page
+       dpkg-architecture -a$(DEB_BUILD_ARCH) -c dh_auto_configure -- 
--without-included-gettext
+       LD_LIBRARY_PATH=`pwd`/src/.libs dh_auto_build
+       chmod ugo-w src/recode.1 # tell make not to touch it
+       dh_auto_clean # doesn't clean src/recode.1
+endif
+       CC='$(CC)' dh_auto_configure -- --without-included-gettext
        sh debian/fix-libtool
 
 override_dh_auto_build-arch:

Reply via email to