diff options
author | Niko Tyni <ntyni@debian.org> | 2019-10-17 11:25:12 +0100 |
---|---|---|
committer | Niko Tyni <ntyni@debian.org> | 2019-10-18 17:52:44 +0100 |
commit | a82feac6005523974f31fc24670f41be97ce5a2d (patch) | |
tree | e6ba9473330801750e7e2e513dc492058e21e3dc | |
parent | 52ee21d763e3bd1d6adc2a6183fcf9510151a80d (diff) | |
download | debhelper-a82feac6005523974f31fc24670f41be97ce5a2d.tar.gz |
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/<triplet>/perl/cross-config-<version>
for the benefit of cross builds.
For more information, see the thread around
https://lists.debian.org/debian-perl/2019/10/msg00015.html
-rw-r--r-- | lib/Debian/Debhelper/Dh_Lib.pm | 16 |
1 files changed, 16 insertions, 0 deletions
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; |