Bug#717433: debian cross build produces a unusable perl-dev package

Matthias Klose doko at debian.org
Sun May 31 11:24:03 UTC 2015


On 05/31/2015 11:01 AM, Niko Tyni wrote:
> On Sat, Jul 20, 2013 at 10:40:37PM +0200, Matthias Klose wrote:

> 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).

yes, that's the same idea I used for python:

 - putting the _sysconfigdata.py into /usr/lib/python/plat-<multiarch>.
 - and then setting this in the rules file:
   SET_CROSS_ENV = PYTHONPATH=/usr/lib/python$$pv/plat-$(DEB_HOST_MULTIARCH)

works as long as the build system relies on the sysconfig module, and doesn't
get information about the build from other modules (e.g. sys).




More information about the Perl-maintainers mailing list