Package: libalgorithm-diff-xs-perl
Version: 0.04-1
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 allows
libalgorithm-diff-xs-perl to cross-build.

Cheers,
-- 
Steve McIntyre
steve.mcint...@linaro.org
diff -u libalgorithm-diff-xs-perl-0.04/debian/changelog libalgorithm-diff-xs-perl-0.04/debian/changelog
--- libalgorithm-diff-xs-perl-0.04/debian/changelog
+++ libalgorithm-diff-xs-perl-0.04/debian/changelog
@@ -1,3 +1,9 @@
+libalgorithm-diff-xs-perl (0.04-1.1) unstable; urgency=low
+
+  * Configure perl C compilation for cross builds
+
+ -- Steve McIntyre <steve.mcint...@linaro.org>  Fri, 15 Jul 2011 11:44:27 +0111
+
 libalgorithm-diff-xs-perl (0.04-1) unstable; urgency=low
 
   * Initial Release (Closes: #556949)
diff -u libalgorithm-diff-xs-perl-0.04/debian/rules libalgorithm-diff-xs-perl-0.04/debian/rules
--- libalgorithm-diff-xs-perl-0.04/debian/rules
+++ libalgorithm-diff-xs-perl-0.04/debian/rules
@@ -1,4 +1,21 @@
 #!/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 $@

Reply via email to