pkg-perl: refactor perl infrastructure
authorFrancois Perrad <fperrad@gmail.com>
Fri, 4 Sep 2015 08:31:13 +0000 (10:31 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fri, 2 Oct 2015 19:56:52 +0000 (20:56 +0100)
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@gadz.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/pkg-perl.mk
support/scripts/scancpan

index 6577588db8818a52b844766647656130fd46d971..a06c068bb6c01344c2e7f5e070a081705a7c2e27 100644 (file)
@@ -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
index a33ec8bf46f87e8ae187f3f3ef4f4c5fe2f838f0..1835fea37822812376b516aac09be340c5a0c4d3 100755 (executable)
@@ -650,11 +650,9 @@ 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 ),
-                                      map( { q{host-} . fsname( $_ ); } sort @{$deps_build{$distname}} ),
+        my $dependencies = join q{ }, map( { q{host-} . fsname( $_ ); } sort @{$deps_build{$distname}} ),
                                       map( { fsname( $_ ); } sort @{$deps_runtime{$distname}} );
-        my $host_dependencies = join q{ }, qw( = ),
-                                           map { q{host-} . fsname( $_ ); } sort( @{$deps_build{$distname}},
+        my $host_dependencies = join q{ }, map { q{host-} . fsname( $_ ); } sort( @{$deps_build{$distname}},
                                                                                   @{$deps_runtime{$distname}} );
         my $license = ref $dist->{license} eq 'ARRAY'
                     ? join q{ or }, @{$dist->{license}}
@@ -677,8 +675,8 @@ while (my ($distname, $dist) = each %dist) {
         say {$fh} qq{${brname}_VERSION = ${version}};
         say {$fh} qq{${brname}_SOURCE = ${distname}-\$(${brname}_VERSION).${suffix}};
         say {$fh} qq{${brname}_SITE = \$(BR2_CPAN_MIRROR)${directories}};
-        say {$fh} qq{${brname}_DEPENDENCIES ${dependencies}} if $need_target{$distname};
-        say {$fh} qq{HOST_${brname}_DEPENDENCIES ${host_dependencies}} if $need_host{$distname};
+        say {$fh} qq{${brname}_DEPENDENCIES = ${dependencies}} if $need_target{$distname} && $dependencies;
+        say {$fh} qq{HOST_${brname}_DEPENDENCIES = ${host_dependencies}} if $need_host{$distname} && $host_dependencies;
         say {$fh} qq{${brname}_LICENSE = ${license}} if $license && $license ne q{unknown};
         say {$fh} qq{${brname}_LICENSE_FILES = ${license_files}} if $license_files;
         say {$fh} qq{};