Package: liblocale-gettext-perl
Version: 1.05-6
Severity: wishlist
Tags: patch
User: crossbu...@debian.org
Usertags: cross

Hi,

I'm currently working on cross-building bits of Debian and I've got to
perl modules. Most would cross-build fine, but they need to pick up
cross-build details from a cross-perl package. I've just pushed a
patch to the perl package (#633884) which puts that information in
place.

Based on that patch, here's a patch that allosws
liblocale-gettext-perl to cross-build.

Cheers,
-- 
Steve McIntyre
steve.mcint...@linaro.org
diff -u liblocale-gettext-perl-1.05/debian/rules liblocale-gettext-perl-1.05/debian/rules
--- liblocale-gettext-perl-1.05/debian/rules
+++ liblocale-gettext-perl-1.05/debian/rules
@@ -1,5 +1,22 @@
 #!/usr/bin/make -f
 
+DEB_BUILD_GNU_TYPE      := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_HOST_GNU_TYPE       := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+
+ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+        HOST_PERL = $(shell which perl)
+        PERL_VER = $(shell $(HOST_PERL) -v | $(HOST_PERL) -e 'while(<>) {/v(\d+\.\d+\.\d+)/ and print "$$1\n";}')
+
+        export PERL5LIB=/usr/$(DEB_HOST_GNU_TYPE)/lib/perl/$(PERL_VER)
+clean:
+	@if [ ! -f $(PERL5LIB)/Config.pm ] || [ ! -f $(PERL5LIB)/Config_heavy.pl ]	;\
+	then	\
+		echo "Config.pm & Config_heavy.pl for cross building not found in $(PERL5LIB)"	;\
+	exit 1	;\
+	fi
+	dh $@
+endif
+
 %:
 	dh --with quilt $@
 
diff -u liblocale-gettext-perl-1.05/debian/changelog liblocale-gettext-perl-1.05/debian/changelog
--- liblocale-gettext-perl-1.05/debian/changelog
+++ liblocale-gettext-perl-1.05/debian/changelog
@@ -1,3 +1,10 @@
+liblocale-gettext-perl (1.05-6.1) unstable; urgency=low
+
+  * Configure perl C compilation for cross builds
+    + Initial patch from Peter Pearse <peter.pea...@linaro.org>
+
+ -- Steve McIntyre <steve.mcint...@linaro.org>  Fri, 15 Jul 2011 11:34:27 +0111
+
 liblocale-gettext-perl (1.05-6) unstable; urgency=low
 
   * The -d option of dh_perl was lost by mistake while converting to tiny

Reply via email to