Source: highwayhash
Version: 0~git20191002.0aaf66b-1
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

highwayhash fails to cross build from source for multiple reasons. One
reason is confusing the terms build and host as defined in man
dpkg-architecture. Thus it issues inappropriate compiler flags during
cross builds. Beyond that, libhighwayhash.so is not part of the default
target, so it only gets built during dh_auto_install where no cross
tools are passed. The attached patch fixes both aspects. Please consider
applying it.

Helmut
diff --minimal -Nru highwayhash-0~git20191002.0aaf66b/debian/changelog 
highwayhash-0~git20191002.0aaf66b/debian/changelog
--- highwayhash-0~git20191002.0aaf66b/debian/changelog  2019-10-04 
09:48:51.000000000 +0200
+++ highwayhash-0~git20191002.0aaf66b/debian/changelog  2020-09-24 
06:13:24.000000000 +0200
@@ -1,3 +1,12 @@
+highwayhash (0~git20191002.0aaf66b-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Fix build vs host confusion.
+    + Build libhighwayhash.so during dh_auto_build.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Thu, 24 Sep 2020 06:13:24 +0200
+
 highwayhash (0~git20191002.0aaf66b-1) unstable; urgency=medium
 
   * New upstream version 0~git20191002.0aaf66b
diff --minimal -Nru highwayhash-0~git20191002.0aaf66b/debian/rules 
highwayhash-0~git20191002.0aaf66b/debian/rules
--- highwayhash-0~git20191002.0aaf66b/debian/rules      2019-10-04 
09:48:51.000000000 +0200
+++ highwayhash-0~git20191002.0aaf66b/debian/rules      2020-09-24 
06:13:24.000000000 +0200
@@ -1,26 +1,25 @@
 #!/usr/bin/make -f
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
-BUILD_ARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
-MULTIARCH=$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+include /usr/share/dpkg/architecture.mk
 export DESTDIR=/usr
-export LIBDIR=$(DESTDIR)/lib/$(MULTIARCH)/
+export LIBDIR=$(DESTDIR)/lib/$(DEB_HOST_MULTIARCH)/
 export INCDIR=$(DESTDIR)/include/
 TESTBINS = highwayhash_test nanobenchmark_example profiler_example 
sip_hash_test vector_test
 
-ifeq (arm64,$(BUILD_ARCH))
+ifeq (arm64,$(DEB_HOST_ARCH_CPU))
 export HH_AARCH64=1
 endif
-ifeq (ppc64,$(BUILD_ARCH))
-export HH_POWER=1
-endif
-ifeq (ppc64el,$(BUILD_ARCH))
+ifneq (,$(filter $(DEB_HOST_ARCH_CPU),ppc64 ppc64el))
 export HH_POWER=1
 endif
 
 %:
        dh $@
 
+override_dh_auto_build:
+       dh_auto_build -- all lib/libhighwayhash.so
+
 override_dh_auto_clean:
        dh_auto_clean
        -$(RM) deps.mk
@@ -35,12 +34,12 @@
 
 override_dh_auto_install:
        dh_auto_install
-       mkdir -p debian/libhighwayhash0/usr/lib/$(MULTIARCH)
-       rename 's/.so/.so.0/' debian/tmp/usr/lib/$(MULTIARCH)/*.so
-       install -m0755 debian/tmp/usr/lib/$(MULTIARCH)/*.so.0 \
-               debian/libhighwayhash0/usr/lib/$(MULTIARCH)/
-       mkdir -p debian/libhighwayhash-dev/usr/lib/$(MULTIARCH)
-       install -m0755 debian/tmp/usr/lib/$(MULTIARCH)/*.a \
-               debian/libhighwayhash-dev/usr/lib/$(MULTIARCH)/
-       set -e; cd debian/libhighwayhash-dev/usr/lib/$(MULTIARCH)/; \
+       mkdir -p debian/libhighwayhash0/usr/lib/$(DEB_HOST_MULTIARCH)
+       rename 's/.so/.so.0/' debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.so
+       install -m0755 debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.so.0 \
+               debian/libhighwayhash0/usr/lib/$(DEB_HOST_MULTIARCH)/
+       mkdir -p debian/libhighwayhash-dev/usr/lib/$(DEB_HOST_MULTIARCH)
+       install -m0755 debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.a \
+               debian/libhighwayhash-dev/usr/lib/$(DEB_HOST_MULTIARCH)/
+       set -e; cd debian/libhighwayhash-dev/usr/lib/$(DEB_HOST_MULTIARCH)/; \
                ln -s libhighwayhash.so.0 libhighwayhash.so

Reply via email to