Source: irssi
Version: 1.4.2-1
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

irssi successfully cross builds a broken package. Inside the package,
the architecture-dependent directory for perl extensions uses the build
architecture tuple instead of the host architecture one. This renders
the resulting package unusable.

Fixing this is a little difficult, because there is widely adopted
standard to inform a Makefile.PL about the host architecture. So this
patch provides the information via the perl-lib configure option. Please
consider applying the patch. If you see options for improving it, that'd
be great. Consider adding debian-perl@l.d.o in the loop if you do,
because other packages contain similar constructs worth simplifying.

Helmut
diff --minimal -Nru irssi-1.4.2/debian/changelog irssi-1.4.2/debian/changelog
--- irssi-1.4.2/debian/changelog        2022-07-16 22:27:07.000000000 +0200
+++ irssi-1.4.2/debian/changelog        2022-08-31 07:44:13.000000000 +0200
@@ -1,3 +1,11 @@
+irssi (1.4.2-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: Use the host architecture vendor arch directory for perl.
+    (Closes: #-1)
+
+ -- Helmut Grohne <hel...@subdivi.de>  Wed, 31 Aug 2022 07:44:13 +0200
+
 irssi (1.4.2-1) unstable; urgency=medium
 
   * New upstream release.
diff --minimal -Nru irssi-1.4.2/debian/irssi.install 
irssi-1.4.2/debian/irssi.install
--- irssi-1.4.2/debian/irssi.install    2022-07-16 22:27:07.000000000 +0200
+++ irssi-1.4.2/debian/irssi.install    2022-08-31 07:44:13.000000000 +0200
@@ -1,8 +1,9 @@
 #!/usr/bin/perl -w
 
 use Config;
+my $hostvendorarch = `perl 
-I/usr/lib/$ENV{DEB_HOST_MULTIARCH}/perl/cross-config-$Config{vendorarch} 
-MConfig -e 'print $Config{vendorarch}')`;
 
-print substr($Config{vendorarch}, 1) . "\n";
+print substr($hostvendorarch, 1) . "\n";
 
 print <<EOF
 irssi.conf etc/
diff --minimal -Nru irssi-1.4.2/debian/irssi.lintian-overrides 
irssi-1.4.2/debian/irssi.lintian-overrides
--- irssi-1.4.2/debian/irssi.lintian-overrides  2022-07-16 22:27:07.000000000 
+0200
+++ irssi-1.4.2/debian/irssi.lintian-overrides  2022-08-31 07:44:13.000000000 
+0200
@@ -1,4 +1,4 @@
 irssi: spelling-error-in-binary hilights highlights [usr/bin/irssi]
 irssi: spelling-error-in-binary hilight highlight [usr/bin/irssi]
-irssi: spelling-error-in-binary hilight highlight 
[usr/lib/x86_64-linux-gnu/irssi/modules/libperl_core.so]
+irssi: spelling-error-in-binary hilight highlight 
[usr/lib/*/irssi/modules/libperl_core.so]
 irssi: spelling-error-in-binary hilighting highlighting [usr/bin/irssi]
diff --minimal -Nru irssi-1.4.2/debian/rules irssi-1.4.2/debian/rules
--- irssi-1.4.2/debian/rules    2022-07-16 22:27:07.000000000 +0200
+++ irssi-1.4.2/debian/rules    2022-08-31 07:44:10.000000000 +0200
@@ -1,12 +1,16 @@
 #!/usr/bin/make -f
 
+include /usr/share/dpkg/architecture.mk
 include /usr/share/dpkg/pkg-info.mk
 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
+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}')
 
 # for dh_auto_test
 TESTDIR=$(CURDIR)/debian/autotest
 
-CONFIGURE_SWITCHES = -Dwith-proxy=yes -Dwith-otr=yes -Denable-true-color=yes 
-Dwith-perl=yes -Dwith-perl-lib=vendor -Dstatic-dependency=no 
-DPACKAGE_VERSION=$(DEB_VERSION_UPSTREAM)
+
+CONFIGURE_SWITCHES = -Dwith-proxy=yes -Dwith-otr=yes -Denable-true-color=yes 
-Dwith-perl=yes -Dwith-perl-lib=$(ARCHLIB) -Dstatic-dependency=no 
-DPACKAGE_VERSION=$(DEB_VERSION_UPSTREAM)
 
 %:
        dh $@ --buildsystem meson

Reply via email to