Bug#717433: debian cross build produces a unusable perl-dev package
Niko Tyni
ntyni at debian.org
Sun May 31 09:01:32 UTC 2015
On Sat, Jul 20, 2013 at 10:40:37PM +0200, Matthias Klose wrote:
> Package: perl
> Version: 5.14.2-21
> Severity: minor
>
> that was using wookey's early patches / backports for cross building and
> multiarch. Maybe check that with the current version again.
Hi, as perl 5.22 in experimental finally has a M-A:same libperl with
the full standard library, I had a look at this as well.
I've pushed the two commits below for the next 5.22 experimental upload
(debian-5.22 branch in our repository). I was able to cross-build
liblocale-gettext-perl and libtext-iconv-perl for arm64 with these,
so it's at least a step forward.
commit 173be8889b4f256204d60769f15c34f49c23b4cc
Author: Niko Tyni <ntyni at debian.org>
Date: Fri May 29 20:12:44 2015 +0300
Link Config.pm to /usr/lib/<triplet>/perl/cross-config-5.22.0/ (Closes: #717433)
This provides infrastructure to cross compile XS module packages.
The recipe is broadly to install libperl5.22:hostarch and do something like
DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
PERL_VER := $(shell perl -MConfig -e'print "$$Config{version}\n"')
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
export PERL5LIB=/usr/lib/$(DEB_HOST_GNU_TYPE)/perl/cross-config-$(PERL_VER)
endif
in debian/rules and then proceed normally with 'perl Makefile.PL' etc.
This gets the right cross compiler and include path from the host Config.pm.
The above snippet could eventually be pushed into debhelper, giving
out-of-the-box cross buildability for most Perl XS module packages in
the archive.
Note that we can't just set PERL5LIB to the host archlib path
(/usr/lib/<triplet>/perl/5.22) because that would make the host arch XS
modules override the build arch ones, breaking ExtUtils::MakeMaker etc.
This is why we need a separate directory with just Config.pm (and its
backend, Config_heavy.pl).
As long as the cross-config directory is in libperl5.xx (which is
currently the only Multi-Arch:same package built from src:perl), its
name needs to be versioned to make sure libperl5.xx and libperl5.yy stay
coinstallable. It contains the full version only because the short one
is not as trivial to look up dynamically via %Config.
TODO: do we want to commit to keeping this path, or should we add an
indirection like $Config{debian_cross_config}? This would presumably be
looked up with the build arch perl but would need to point at the
host arch path, leading to a need of some post processing to use the
right triplet. Possibly the tradeoff in complexity is not worthwhile.
commit 5ba27a4f9e357e442308ae05f56d045f4dcd2b16
Author: Niko Tyni <ntyni at debian.org>
Date: Fri May 29 20:18:10 2015 +0300
Make libperl5.22 Provide a perl-cross-config virtual package
This removes the need of tracking Perl versions in cross build
dependencies. The perl-cross-config virtual package could end up as a
dependency of cross-build-essential if so desired, or be pulled in some
other way when cross compiling Perl XS module packages.
Version skew with libperl packages so that the host arch libperl5.xx
doesn't match the build arch /usr/bin/perl is not expected to be a real
world problem, so the virtual package is unversioned.
Alternatively, we could make perl-cross-config a separate real
Multi-Arch:same package containing only the symlinks. This would remove
the need for versioned directories so we could have just something like
/usr/lib/<triplet>/perl/cross-config/Config.pm -> ../5.22/Config.pm
which is arguably cleaner.
--
Niko Tyni ntyni at debian.org
More information about the Perl-maintainers
mailing list