Source: infnoise
Version: 0.3.1+dfsg-1
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

infnoise fails to cross build from source, because it does not pass
cross tools to make. The easiest way of fixing that is using
dh_auto_build. It keeps failing, because it does not find -lftdi1. This
happens, because its libfdti detection only searches for the build
architecture libftdi, but we're interested in the host architecture one
here. The attached patch fixes both and makes infnoise cross buildable.
Please consider applying it.

Helmut
diff --minimal -Nru infnoise-0.3.1+dfsg/debian/changelog 
infnoise-0.3.1+dfsg/debian/changelog
--- infnoise-0.3.1+dfsg/debian/changelog        2019-02-23 18:20:31.000000000 
+0100
+++ infnoise-0.3.1+dfsg/debian/changelog        2019-06-21 20:35:48.000000000 
+0200
@@ -1,3 +1,12 @@
+infnoise (0.3.1+dfsg-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Let dh_auto_build pass cross tools to make. (Closes: #-1)
+    + cross.patch: Detect the host libftdi instead of the build libftdi.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Fri, 21 Jun 2019 20:35:48 +0200
+
 infnoise (0.3.1+dfsg-1) unstable; urgency=medium
 
   * New upstream release, with manpages.
diff --minimal -Nru infnoise-0.3.1+dfsg/debian/patches/cross.patch 
infnoise-0.3.1+dfsg/debian/patches/cross.patch
--- infnoise-0.3.1+dfsg/debian/patches/cross.patch      1970-01-01 
01:00:00.000000000 +0100
+++ infnoise-0.3.1+dfsg/debian/patches/cross.patch      2019-06-21 
20:35:48.000000000 +0200
@@ -0,0 +1,11 @@
+--- infnoise-0.3.1+dfsg.orig/software/Makefile.linux
++++ infnoise-0.3.1+dfsg/software/Makefile.linux
+@@ -10,7 +10,7 @@
+  -DGIT_DATE=\"$(GIT_DATE)\"\
+  -DLINUX
+ 
+-FOUND = $(shell /sbin/ldconfig -p | grep --silent libftdi.so && echo found)
++FOUND = $(shell $(CC) -o /dev/null -x c /dev/null -shared -lftdi 2>/dev/null 
&& echo found)
+ ifeq ($(FOUND), found)
+         FTDI=   -lftdi
+ else
diff --minimal -Nru infnoise-0.3.1+dfsg/debian/patches/series 
infnoise-0.3.1+dfsg/debian/patches/series
--- infnoise-0.3.1+dfsg/debian/patches/series   2019-02-19 10:35:20.000000000 
+0100
+++ infnoise-0.3.1+dfsg/debian/patches/series   2019-06-21 20:35:48.000000000 
+0200
@@ -1 +1,2 @@
 service-documentation.patch
+cross.patch
diff --minimal -Nru infnoise-0.3.1+dfsg/debian/rules 
infnoise-0.3.1+dfsg/debian/rules
--- infnoise-0.3.1+dfsg/debian/rules    2019-02-19 10:49:18.000000000 +0100
+++ infnoise-0.3.1+dfsg/debian/rules    2019-06-21 20:35:47.000000000 +0200
@@ -13,7 +13,7 @@
        dh_auto_clean -Dsoftware/tools
 
 override_dh_auto_build:
-       make -C software -f Makefile.linux CFLAGS="$(CPPFLAGS) $(CFLAGS) 
$(LDFLAGS) -fPIC -IKeccak -DGIT_VERSION=\\\"$(DEB_VERSION_UPSTREAM)\\\" 
-DGIT_COMMIT=\\\"Debian\\\" -DGIT_DATE=\\\"$(shell date --utc +%FT%T%:z -d 
@$(SOURCE_DATE_EPOCH))\\\""
+       dh_auto_build --buildsystem=makefile -- -f Makefile.linux 
CFLAGS="$(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -fPIC -IKeccak 
-DGIT_VERSION=\\\"$(DEB_VERSION_UPSTREAM)\\\" -DGIT_COMMIT=\\\"Debian\\\" 
-DGIT_DATE=\\\"$(shell date --utc +%FT%T%:z -d @$(SOURCE_DATE_EPOCH))\\\""
        dh_auto_build -Dsoftware/tools -- CFLAGS="$(CPPFLAGS) $(CFLAGS) 
$(LDFLAGS)"
 
 override_dh_auto_configure:

Reply via email to