Source: fathom
Version: 1.0+git.20190811.97fb5c-1
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

fathom fails to cross build from source, because debian/rules hard codes
the build architecture compiler. A good way to initialize is to use
dpkg's buildtools.mk. The attached patch implements that. While at it,
it also fixes a host/target confusion. Please refer to man
dpkg-architecture for a definition of those terms. It also employs the
$(AR) variable set up by dpkg's buildtools.mk. Please consider applying
it.

Helmut
diff --minimal -Nru fathom-1.0+git.20190811.97fb5c/debian/changelog 
fathom-1.0+git.20190811.97fb5c/debian/changelog
--- fathom-1.0+git.20190811.97fb5c/debian/changelog     2020-03-30 
17:33:50.000000000 +0200
+++ fathom-1.0+git.20190811.97fb5c/debian/changelog     2020-04-06 
18:04:31.000000000 +0200
@@ -1,3 +1,12 @@
+fathom (1.0+git.20190811.97fb5c-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: Let dpkg's buildtools.mk supply CC. (Closes: #-1)
+  * Also fix build/host confusion.
+  * Also use AR from dpkg's buildtools.mk.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Mon, 06 Apr 2020 18:04:31 +0200
+
 fathom (1.0+git.20190811.97fb5c-1) unstable; urgency=medium
 
   * Import upstream lastest changes
diff --minimal -Nru fathom-1.0+git.20190811.97fb5c/debian/rules 
fathom-1.0+git.20190811.97fb5c/debian/rules
--- fathom-1.0+git.20190811.97fb5c/debian/rules 2020-03-30 17:33:50.000000000 
+0200
+++ fathom-1.0+git.20190811.97fb5c/debian/rules 2020-04-06 18:04:29.000000000 
+0200
@@ -2,9 +2,8 @@
 
 export DH_VERBOSE = 1
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
-export DEB_TARGET_MULTIARCH ?= $(shell dpkg-architecture 
-qDEB_TARGET_MULTIARCH)
-
-CC=gcc
+include /usr/share/dpkg/architecture.mk
+include /usr/share/dpkg/buildtools.mk
 CFLAGS=-std=gnu99 $(shell dpkg-buildflags --get CFLAGS) \
 -Wall -D TB_NO_THREADS -D TB_NO_HW_POP_COUNT -I.. $(CPPFLAGS)
 
@@ -15,9 +14,9 @@
 
 override_dh_auto_install:
        dh_auto_install
-       install -d debian/tmp/usr/lib/$(DEB_TARGET_MULTIARCH)
-       cp --reflink=auto -a ./lib*.so 
debian/tmp/usr/lib/$(DEB_TARGET_MULTIARCH)
-       cp --reflink=auto -a ./lib*.so.* 
debian/tmp/usr/lib/$(DEB_TARGET_MULTIARCH)
+       install -d debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)
+       cp --reflink=auto -a ./lib*.so debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)
+       cp --reflink=auto -a ./lib*.so.* 
debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)
 
 override_dh_makeshlibs:
        dh_makeshlibs -- -v1.0 -plibfathom1
@@ -33,7 +32,7 @@
        $(CC) $(CFLAGS) -I src -c $< -o $@
 
 libfathom.a: tbprobe.o
-       ar rcs $@ $^
+       $(AR) rcs $@ $^
 
 tbprobe.o: src/tbprobe.c src/tbprobe.h
        $(CC) $(CFLAGS) -fPIC -I src -c -o $@ $<

Reply via email to