From patchwork Thu Aug 23 08:14:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francois Perrad X-Patchwork-Id: 179553 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 4F5052C0093 for ; Thu, 23 Aug 2012 18:14:51 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 474CCA051B; Thu, 23 Aug 2012 08:14:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mmx+uqw5tm-h; Thu, 23 Aug 2012 08:14:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 71E18A0115; Thu, 23 Aug 2012 08:14:41 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 9EFAE8F753 for ; Thu, 23 Aug 2012 08:14:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8D2828F6A2 for ; Thu, 23 Aug 2012 08:14:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6fvZkBdYzB+r for ; Thu, 23 Aug 2012 08:14:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by whitealder.osuosl.org (Postfix) with ESMTPS id 948538F699 for ; Thu, 23 Aug 2012 08:14:34 +0000 (UTC) Received: by wibhm2 with SMTP id hm2so396556wib.10 for ; Thu, 23 Aug 2012 01:14:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=mhR5wA2wAmHzBK4wNm/UwlwQB1ZGMOqXhBb+9F9HHqA=; b=RUGFocuZHsTU/9FCiuq8OqQMZIwUDXzfa03Oo6s1HUC3Lz4LxU/O4MzT9x/rFPcFhw +JVvWuewScWK6pig2zJIiHeRSYxMixPbMC8aMkf9e/MqEpMbqX9xKLg3611rQWj2EDde 2RFTUXH4VmKDq3hGhzP768sAeE8ABL9gFIvDujjkPYHNeLlgPf7E4Ucqzib6is66cDsi 9ty+6goERV2p5PeWcyyvLA4uyqs6ZqKuczeUseNfPYTqeMxP97sIf8xm/OmCJ+WWTubv /37pdKhtn0U4Rr0m6Uwa5CM8FQInEihBR1Pfwmhs2qsQFcoqnxuLQlM1KiLHgPXJtX5g 1ZpA== Received: by 10.180.84.164 with SMTP id a4mr1970466wiz.12.1345709672775; Thu, 23 Aug 2012 01:14:32 -0700 (PDT) Received: from xubuntu-12.04 (113.120.86.79.rev.sfr.net. [79.86.120.113]) by mx.google.com with ESMTPS id q4sm43651163wix.9.2012.08.23.01.14.30 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 23 Aug 2012 01:14:32 -0700 (PDT) From: Francois Perrad To: buildroot@busybox.net Date: Thu, 23 Aug 2012 10:14:13 +0200 Message-Id: <1345709660-25443-2-git-send-email-francois.perrad@gadz.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1345709660-25443-1-git-send-email-francois.perrad@gadz.org> References: <1345709660-25443-1-git-send-email-francois.perrad@gadz.org> Subject: [Buildroot] [PATCH 2/9] perl: add an option for miniperl X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net --- package/perl/Config.in | 6 ++ package/perl/perl-install-miniperl.patch | 126 ++++++++++++++++++++++++++++++ package/perl/perl.mk | 6 +- 3 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 package/perl/perl-install-miniperl.patch diff --git a/package/perl/Config.in b/package/perl/Config.in index 286b09e..1f044eb 100644 --- a/package/perl/Config.in +++ b/package/perl/Config.in @@ -14,4 +14,10 @@ config BR2_PACKAGE_PERL_CUSTOM_CONFIGURE help Allows to add some flags to Configure. +config BR2_PACKAGE_PERL_ONLY_MINIPERL + bool "only miniperl" + help + Install only miniperl (without dynamic module loader) + Usually used to bootstrap a full Perl (@INC contains only .). + endif diff --git a/package/perl/perl-install-miniperl.patch b/package/perl/perl-install-miniperl.patch new file mode 100644 index 0000000..b1aaad3 --- /dev/null +++ b/package/perl/perl-install-miniperl.patch @@ -0,0 +1,126 @@ +Add an option -miniperl + +Signed-off-by: Francois Perrad + +Index: b/installperl +=================================================================== +--- a/installperl ++++ b/installperl +@@ -14,7 +14,7 @@ + use vars qw($Is_VMS $Is_W32 $Is_OS2 $Is_Cygwin $Is_Darwin $Is_NetWare + %opts $packlist); + my ($dostrip, $versiononly, $force, +- $otherperls, $archname, $nwinstall, $nopods); ++ $otherperls, $archname, $nwinstall, $nopods, $miniperl); + + BEGIN { + if ($Is_VMS) { eval 'use VMS::Filespec;' } +@@ -83,6 +83,7 @@ + $force = 1 if $ARGV[0] eq '-f'; + $opts{verbose} = 1 if $ARGV[0] eq '-V' || $ARGV [0] eq '-n'; + $archname = 1 if $ARGV[0] eq '-A'; ++ $miniperl = 1 if $ARGV[0] eq '-miniperl'; + $nwinstall = 1 if $ARGV[0] eq '-netware'; + $nopods = 1 if $ARGV[0] eq '-p'; + $opts{destdir} = $1 if $ARGV[0] =~ /^-?-destdir=(.*)$/; +@@ -102,6 +103,7 @@ + -A Also install perl with the architecture's name in the perl binary's + name. + -p Don't install the pod files. [This will break use diagnostics;] ++ -miniperl Install only miniperl. + -netware Install correctly on a Netware server. + -destdir Prefix installation directories by this string. + EOT +@@ -114,6 +116,7 @@ + my (@scripts, @tolink); + open SCRIPTS, "utils.lst" or die "Can't open utils.lst: $!"; + while () { ++ next if $miniperl; + next if /^#/; + next if /a2p/; # a2p is binary, to be installed separately + chomp; +@@ -310,7 +313,7 @@ + link($Config{perlpath}, "$installbin/perl$ver$exe_ext"); + } + elsif ($^O ne 'dos') { +- if (!$Is_NetWare) { ++ if (!$Is_NetWare && !$miniperl) { + safe_unlink("$installbin/$perl_verbase$ver$exe_ext"); + copy("perl$exe_ext", "$installbin/$perl_verbase$ver$exe_ext"); + strip("$installbin/$perl_verbase$ver$exe_ext"); +@@ -396,6 +399,7 @@ + } + } + foreach my $file (@corefiles) { ++ next if $miniperl; + # HP-UX (at least) needs to maintain execute permissions + # on dynamically-loadable libraries. So we do it for all. + if (copy_if_diff($file,"$installarchlib/CORE/$file")) { +@@ -411,7 +415,7 @@ + # Install main perl executables + # Make links to ordinary names if installbin directory isn't current directory. + +-if (! $versiononly && ! samepath($installbin, '.') && ($^O ne 'dos') && ! $Is_VMS && ! $Is_NetWare) { ++if (! $versiononly && ! samepath($installbin, '.') && ($^O ne 'dos') && ! $Is_VMS && ! $Is_NetWare && ! $miniperl) { + safe_unlink("$installbin/$perl$exe_ext", "$installbin/suid$perl$exe_ext"); + if ($^O eq 'mpeix') { + # MPE doesn't support hard links, so use a symlink. +@@ -429,7 +433,7 @@ + + # For development purposes it can be very useful to have multiple perls + # build for different "architectures" (eg threading or not) simultaneously. +-if ($archname && ! samepath($installbin, '.') && ($^O ne 'dos') && ! $Is_VMS) { ++if ($archname && ! samepath($installbin, '.') && ($^O ne 'dos') && ! $Is_VMS && ! $miniperl) { + my $archperl = "$perl_verbase$ver-$Config{archname}$exe_ext"; + safe_unlink("$installbin/$archperl"); + if ($^O eq 'mpeix') { +@@ -451,7 +455,7 @@ + + if ($Config{installusrbinperl} && $Config{installusrbinperl} eq 'define' && + !$versiononly && !$opts{notify} && !$Is_W32 && !$Is_NetWare && !$Is_VMS && -t STDIN && -t STDERR +- && -w $mainperldir && ! samepath($mainperldir, $installbin)) { ++ && -w $mainperldir && ! samepath($mainperldir, $installbin) && ! $miniperl) { + my($usrbinperl) = "$mainperldir/$perl$exe_ext"; + my($instperl) = "$installbin/$perl$exe_ext"; + my($expinstperl) = "$binexp/$perl$exe_ext"; +@@ -480,7 +484,7 @@ + } + + # Make links to ordinary names if installbin directory isn't current directory. +-if (!$Is_NetWare && $dbg eq '') { ++if (!$Is_NetWare && $dbg eq '' && !$miniperl) { + if (! samepath($installbin, 'x2p')) { + my $base = 'a2p'; + $base .= $ver if $versiononly; +@@ -495,12 +499,18 @@ + # it can't safely be shared. Place it in $installbin. + # Note that Configure doesn't build cppstin if it isn't needed, so + # we skip this if cppstdin doesn't exist. +-if (! $versiononly && (-f 'cppstdin') && (! samepath($installbin, '.'))) { ++if (! $versiononly && (-f 'cppstdin') && (! samepath($installbin, '.')) && !$miniperl) { + safe_unlink("$installbin/cppstdin"); + copy("cppstdin", "$installbin/cppstdin"); + chmod(0755, "$installbin/cppstdin"); + } + ++if ($miniperl && (-f 'miniperl')) { ++ safe_unlink("$installbin/miniperl$exe_ext"); ++ copy("miniperl$exe_ext", "$installbin/miniperl$exe_ext"); ++ chmod(0755, "$installbin/miniperl$exe_ext"); ++} ++ + sub script_alias { + my ($installscript, $orig, $alias, $scr_ext) = @_; + +@@ -761,6 +771,11 @@ + + return if $name eq 'ExtUtils/XSSymSet.pm' and !$Is_VMS; + ++ if ($miniperl && $dir =~ /^auto\//) { ++ # Don't copy ++ return; ++ } ++ + my $installlib = $installprivlib; + if ($dir =~ /^auto\// || + ($name =~ /^(.*)\.(?:pm|pod)$/ && $archpms{$1}) || diff --git a/package/perl/perl.mk b/package/perl/perl.mk index 813d8bf..5161654 100644 --- a/package/perl/perl.mk +++ b/package/perl/perl.mk @@ -16,6 +16,10 @@ ifeq ($(shell expr $(PERL_VERSION_MAJOR) % 2), 1) PERL_USE_DEVEL=-Dusedevel endif +ifdef BR2_PACKAGE_PERL_ONLY_MINIPERL + PERL_INSTALL_ONLY_MINIPERL = -miniperl +endif + PERL_ARCH=$(call qstrip,$(BR2_ARCH)) ifeq ($(PERL_ARCH),i686) PERL_ARCH=i386 @@ -79,7 +83,7 @@ endef define PERL_INSTALL_TARGET_CMDS $(MAKE) INSTALL_DEPENDENCE= \ - INSTALLFLAGS=-p \ + INSTALLFLAGS="-p $(PERL_INSTALL_ONLY_MINIPERL)"\ DESTDIR="$(TARGET_DIR)" \ -C $(@D) install.perl endef