Source: cdbfasta
Version: 1.00+git20181005.014498c+dfsg-1
Tags: patch
User: [email protected]
Usertags: ftcbfs

cdbfasta fails to cross build from source, because it uses the build
architecture pkg-config and g++. The reasons for each are different.
pkg-config is hard coded in the upstream Makefile. It needs to be made
substitutable. g++ instead is hard coded in debian/rules. The attached
patch fixes both and makes cdbfasta somewhat cross buildable. Since it
ignores the return code of help2man, it doesn't see that it fails and
produces garbage manual pages. Otherwise the cross build succeeds.
Please consider applying the patch.

Helmut
diff --minimal -Nru cdbfasta-1.00+git20181005.014498c+dfsg/debian/changelog 
cdbfasta-1.00+git20181005.014498c+dfsg/debian/changelog
--- cdbfasta-1.00+git20181005.014498c+dfsg/debian/changelog     2020-06-13 
12:34:42.000000000 +0200
+++ cdbfasta-1.00+git20181005.014498c+dfsg/debian/changelog     2021-01-14 
20:32:35.000000000 +0100
@@ -1,3 +1,12 @@
+cdbfasta (1.00+git20181005.014498c+dfsg-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Improve cross building: (Closes: #-1)
+    + cross.patch: Make pkg-config substitutable.
+    + d/rules: Pass a triplet-prefixed g++.
+
+ -- Helmut Grohne <[email protected]>  Thu, 14 Jan 2021 20:32:35 +0100
+
 cdbfasta (1.00+git20181005.014498c+dfsg-1) unstable; urgency=medium
 
   * Point homepage to Github
diff --minimal -Nru 
cdbfasta-1.00+git20181005.014498c+dfsg/debian/patches/cross.patch 
cdbfasta-1.00+git20181005.014498c+dfsg/debian/patches/cross.patch
--- cdbfasta-1.00+git20181005.014498c+dfsg/debian/patches/cross.patch   
1970-01-01 01:00:00.000000000 +0100
+++ cdbfasta-1.00+git20181005.014498c+dfsg/debian/patches/cross.patch   
2021-01-14 16:52:55.000000000 +0100
@@ -0,0 +1,19 @@
+--- cdbfasta-1.00+git20181005.014498c+dfsg.orig/Makefile
++++ cdbfasta-1.00+git20181005.014498c+dfsg/Makefile
+@@ -1,5 +1,6 @@
+ GCLDIR := ./gclib
+-SEARCHDIRS := `pkg-config --cflags libgclib`
++PKG_CONFIG ?= pkg-config
++SEARCHDIRS := `$(PKG_CONFIG) --cflags libgclib`
+ CC      := g++
+ 
+ BASEFLAGS  = -Wall ${SEARCHDIRS} $(MARCH) -DENABLE_COMPRESSION=1 
-D_FILE_OFFSET_BITS=64 \
+@@ -42,7 +43,7 @@
+ #LDFLAGS = 
+ #uncomment this when ENABLE_COMPRESSION
+ LDFLAGS  := -lz $(LDFLAGS)
+-LIBS      = `pkg-config --libs libgclib`
++LIBS      = `$(PKG_CONFIG) --libs libgclib`
+ 
+ .PHONY : all
+ all:    cdbfasta cdbyank 
diff --minimal -Nru 
cdbfasta-1.00+git20181005.014498c+dfsg/debian/patches/series 
cdbfasta-1.00+git20181005.014498c+dfsg/debian/patches/series
--- cdbfasta-1.00+git20181005.014498c+dfsg/debian/patches/series        
2020-06-13 12:34:42.000000000 +0200
+++ cdbfasta-1.00+git20181005.014498c+dfsg/debian/patches/series        
2021-01-14 16:50:45.000000000 +0100
@@ -1,3 +1,4 @@
 workaround-lintian-false-positive
 hardening.patch
 use_debian_packaged_gclib.patch
+cross.patch
diff --minimal -Nru cdbfasta-1.00+git20181005.014498c+dfsg/debian/rules 
cdbfasta-1.00+git20181005.014498c+dfsg/debian/rules
--- cdbfasta-1.00+git20181005.014498c+dfsg/debian/rules 2020-06-13 
12:34:42.000000000 +0200
+++ cdbfasta-1.00+git20181005.014498c+dfsg/debian/rules 2021-01-14 
16:52:27.000000000 +0100
@@ -7,12 +7,13 @@
 #export DH_VERBOSE=1
 
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+include /usr/share/dpkg/buildtools.mk
 
 %:
        dh $@
 
 override_dh_auto_build:
-       dh_auto_build -- LINKER="g++ $(LDFLAGS)"
+       dh_auto_build -- LINKER="$(CXX) $(LDFLAGS)"
 
 override_dh_installman:
        help2man --no-info --no-discard-stderr --version-option=-v ./cdbfasta |\

Reply via email to