[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#949789: libcdb-file-perl FTCBFS: computes a build architecture ARCHLIB



Source: libcdb-file-perl
Version: 1.00-1
Tags: patch
User: debian-cross@lists.debian.org
Usertags: ftcbfs

libcdb-file-perl fails to cross build from source, because its ARCHLIB
variable is computed for the build architecture rather than the host
architecture. We've already seen this pattern in #949266. The same fix
works here.

Can we take the opportunity to step back? Clearly embodying these runes
into many packages is going to cause pain down the road. They're hard to
remember and longish. If setting up ARCHLIB is a common thing, then
maybe it should be centralized somehow? dpkg provides
/usr/share/dpkg/*.mk. Maybe perl should do something similar? Could
there be some perl.mk to be included in debian/rules that sets up
ARCHLIB?

I've X-Debbugs-Cced debian-perl@l.d.o to get an answer to the latter.
Please wait a little before applying my patch: I hope we can centralize
it somehow.

Helmut
diff --minimal -Nru libcdb-file-perl-1.00/debian/changelog libcdb-file-perl-1.00/debian/changelog
--- libcdb-file-perl-1.00/debian/changelog	2020-01-24 14:28:12.000000000 +0100
+++ libcdb-file-perl-1.00/debian/changelog	2020-01-25 06:03:25.000000000 +0100
@@ -1,3 +1,10 @@
+libcdb-file-perl (1.00-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: Correctly compute ARCHLIB. (Closes: #-1)
+
+ -- Helmut Grohne <helmut@subdivi.de>  Sat, 25 Jan 2020 06:03:25 +0100
+
 libcdb-file-perl (1.00-1) unstable; urgency=medium
 
   * Team upload.
diff --minimal -Nru libcdb-file-perl-1.00/debian/rules libcdb-file-perl-1.00/debian/rules
--- libcdb-file-perl-1.00/debian/rules	2020-01-24 14:28:12.000000000 +0100
+++ libcdb-file-perl-1.00/debian/rules	2020-01-25 06:03:23.000000000 +0100
@@ -4,7 +4,9 @@
 
 PACKAGE = $(shell dh_listpackages)
 TMP     = $(CURDIR)/debian/$(PACKAGE)
-ARCHLIB := $(shell perl -MConfig -e 'print $$Config{vendorarch}')
+include /usr/share/dpkg/architecture.mk
+PERLVER := $(shell perl -MConfig -e 'print $$Config{version}')
+ARCHLIB := $(shell perl -I/usr/lib/$(DEB_HOST_MULTIARCH)/perl/cross-config-$(PERLVER) -MConfig -e 'print $$Config{vendorarch}')
 
 %:
 	dh $@

Reply to: