[Buildroot] [PATCH 1/2] pkg-perl: refactor perl infrastructure

Francois Perrad fperrad at gmail.com
Wed Sep 2 19:31:43 UTC 2015


the perl dependency of cpan module is no longer generated by scancpan,
but added at the infrastructure level

Signed-off-by: Francois Perrad <francois.perrad at gadz.org>
---
 package/pkg-perl.mk      | 8 ++++++++
 support/scripts/scancpan | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/package/pkg-perl.mk b/package/pkg-perl.mk
index 6577588..a06c068 100644
--- a/package/pkg-perl.mk
+++ b/package/pkg-perl.mk
@@ -39,7 +39,15 @@ PERL_RUN = PERL5LIB= $(HOST_DIR)/usr/bin/perl
 
 define inner-perl-package
 
+# Target packages need both the perl interpreter on the target (for
+# runtime) and the perl interpreter on the host (for
+# compilation). However, host packages only need the perl
+# interpreter on the host.
+ifeq ($(4),target)
+$(2)_DEPENDENCIES += host-perl perl
+else
 $(2)_DEPENDENCIES += host-perl
+endif
 
 #
 # Configure step. Only define it if not already defined by the package
diff --git a/support/scripts/scancpan b/support/scripts/scancpan
index c7180c8..947d248 100755
--- a/support/scripts/scancpan
+++ b/support/scripts/scancpan
@@ -655,7 +655,7 @@ while (my ($distname, $dist) = each %dist) {
         # the auth part is not used, because we use $(BR2_CPAN_MIRROR)
         my($filename, $directories, $suffix) = fileparse( $path, q{tar.gz}, q{tgz} );
         $directories =~ s|/$||;
-        my $dependencies = join q{ }, qw( = perl ),
+        my $dependencies = join q{ }, qw( = ),
                                       map( { q{host-} . fsname( $_ ); } sort @{$deps_build{$distname}} ),
                                       map( { fsname( $_ ); } sort @{$deps_runtime{$distname}} );
         my $host_dependencies = join q{ }, qw( = ),
-- 
2.1.4



More information about the buildroot mailing list