From a82feac6005523974f31fc24670f41be97ce5a2d Mon Sep 17 00:00:00 2001 From: Niko Tyni Date: Thu, 17 Oct 2019 11:25:12 +0100 Subject: Dh_Lib: new function perl_cross_incdir Since perl/5.30.0-7, the perl-xs-dev package provides the host architecture Config.pm in /usr/lib//perl/cross-config- for the benefit of cross builds. For more information, see the thread around https://lists.debian.org/debian-perl/2019/10/msg00015.html --- lib/Debian/Debhelper/Dh_Lib.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/Debian/Debhelper/Dh_Lib.pm b/lib/Debian/Debhelper/Dh_Lib.pm index 47cca1fb..33187e33 100644 --- a/lib/Debian/Debhelper/Dh_Lib.pm +++ b/lib/Debian/Debhelper/Dh_Lib.pm @@ -146,6 +146,7 @@ qw( is_cross_compiling is_build_profile_active get_buildoption + perl_cross_incdir ), # Other qw( @@ -2708,6 +2709,21 @@ sub dbgsym_tmpdir { return "debian/.debhelper/${package}/dbgsym-root"; } +sub perl_cross_incdir { + return if !is_cross_compiling(); + + # native builds don't currently need this so only load it on demand + require Config; Config->import(); + + my $triplet = dpkg_architecture_value("DEB_HOST_MULTIARCH"); + my $perl_version = $Config::Config{version}; + my $incdir = "/usr/lib/$triplet/perl/cross-config-${perl_version}"; + if (!-e "$incdir/Config.pm") { + warning("$incdir/Config.pm does not exist (missing build dependency on perl-xs-dev?)"); + return; + } + return $incdir; +} { my %known_packages; -- cgit v1.2.3