@@ -263,6 +263,11 @@ source "package/xavante/Config.in"
endmenu
endif
source "package/perl/Config.in"
+if BR2_PACKAGE_PERL
+menu "Perl libraries/modules"
+source "package/cpanminus/Config.in"
+endmenu
+endif
source "package/microperl/Config.in"
source "package/php/Config.in"
source "package/python/Config.in"
new file mode 100644
@@ -0,0 +1,23 @@
+config BR2_PACKAGE_CPANMINUS
+ bool "cpanminus"
+ help
+ cpanminus is a script to get, unpack, build and install Perl modules
+ from CPAN.
+
+ Why? It's dependency free, requires zero configuration, and stands
+ alone. When running, it requires only 10MB of RAM.
+
+ http://github.com/miyagawa/cpanminus
+
+if BR2_PACKAGE_CPANMINUS
+
+config BR2_PACKAGE_CPANMINUS_MODULES
+ string "Perl modules from CPAN"
+ help
+ List of space-separated Perl modules to install from CPAN.
+
+ Examples: Try::Tiny Dancer YAML Moo
+
+ Install the listed modules and their dependencies.
+
+endif
new file mode 100644
@@ -0,0 +1,24 @@
+
+Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
+
+Index: b/cpanm
+===================================================================
+--- a/cpanm
++++ b/cpanm
+@@ -399,6 +399,7 @@
+ 'h|help' => sub { $self->{action} = 'show_help' },
+ 'V|version' => sub { $self->{action} = 'show_version' },
+ 'perl=s' => \$self->{perl},
++ 'destdir=s' => \$self->{destdir},
+ 'l|local-lib=s' => sub { $self->{local_lib} = $self->maybe_abs($_[1]) },
+ 'L|local-lib-contained=s' => sub {
+ $self->{local_lib} = $self->maybe_abs($_[1]);
+@@ -1636,7 +1637,7 @@
+ $self->diag_progress("Building " . ($self->{notest} ? "" : "and testing ") . $distname);
+ $self->build([ $self->{make} ], $distname) &&
+ $self->test([ $self->{make}, "test" ], $distname) &&
+- $self->install([ $self->{make}, "install" ], [ "UNINST=1" ], $depth) &&
++ $self->install([ $self->{make}, "install", "DESTDIR=$self->{destdir}" ], [ "UNINST=1" ], $depth) &&
+ $installed++;
+ } else {
+ my $why;
new file mode 100644
@@ -0,0 +1,34 @@
+#############################################################
+#
+# cpanminus
+#
+#############################################################
+
+CPANMINUS_VERSION = 1.5017
+CPANMINUS_SOURCE = miyagawa-cpanminus-$(CPANMINUS_VERSION)-0-g917a607.tar.gz
+CPANMINUS_SITE = https://github.com/miyagawa/cpanminus/tarball/$(CPANMINUS_VERSION)
+CPANMINUS_DEPENDENCIES = perl
+
+CPANMINUS_ARCH=$(call qstrip,$(BR2_ARCH))
+ifeq ($(CPANMINUS_ARCH),i686)
+ CPANMINUS_ARCH=i386
+endif
+CPANMINUS_QEMU_USER_MODE=qemu-$(CPANMINUS_ARCH) -L $(STAGING_DIR)
+CPANMINUS_RUN_PERL=$(CPANMINUS_QEMU_USER_MODE) $(STAGING_DIR)/usr/bin/perl
+CPANMINUS_ARCHNAME=$(shell $(CPANMINUS_RUN_PERL) -MConfig -e "print Config->{archname}")
+CPANMINUS_PERL5LIB=$(TARGET_DIR)/usr/lib/perl5/site_perl/$(PERL_VERSION)/$(CPANMINUS_ARCHNAME):$(TARGET_DIR)/usr/lib/perl5/site_perl/$(PERL_VERSION):$(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)/$(CPANMINUS_ARCHNAME):$(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)
+
+define CPANMINUS_INSTALL_TARGET_CMDS
+ echo "#!/bin/sh" > $(@D)/run_perl
+ echo "PERL5LIB=$(CPANMINUS_PERL5LIB) $(CPANMINUS_RUN_PERL) \"\$$@\"" >>$(@D)/run_perl
+ chmod +x $(@D)/run_perl
+ PERL5LIB=$(CPANMINUS_PERL5LIB) \
+ $(CPANMINUS_RUN_PERL) $(@D)/cpanm \
+ --perl=$(@D)/run_perl \
+ --destdir="$(TARGET_DIR)" \
+ --notest \
+ --no-man-pages \
+ $(call qstrip,$(BR2_PACKAGE_CPANMINUS_MODULES))
+endef
+
+$(eval $(generic-package))
@@ -6,7 +6,24 @@ Index: b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
===================================================================
--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
-@@ -1924,7 +1925,7 @@
+@@ -1659,8 +1659,14 @@
+ } else {
+ # we should also consider $ENV{PERL5LIB} here
+ my $old = $self->{PERL_LIB} || $self->{PERL_ARCHLIB} || $self->{PERL_INC};
+- $self->{PERL_LIB} ||= $Config{privlibexp};
+- $self->{PERL_ARCHLIB} ||= $Config{archlibexp};
++ if ($Config{run}) {
++ $self->{PERL_LIB} ||= $inc_carp_dir;
++ $self->{PERL_ARCHLIB} ||= $inc_config_dir;
++ }
++ else {
++ $self->{PERL_LIB} ||= $Config{privlibexp};
++ $self->{PERL_ARCHLIB} ||= $Config{archlibexp};
++ }
+ $self->{PERL_INC} = $self->catdir("$self->{PERL_ARCHLIB}","CORE"); # wild guess for now
+ my $perl_h;
+
+@@ -1924,7 +1930,7 @@
foreach my $perl (qw(PERL FULLPERL ABSPERL)) {
my $run = $perl.'RUN';