Skip to contentSkip to conversation

host-qemu: new package

PATCH Superseded Francois Perrad 3 participants 18 messages Oct 6, 2012 – Oct 10, 2012

v9 of 11 Superseded Latest is v11 →

lore
Share & tools
lore
#0 lore raw

PATCH v9 1/10 host-qemu: new package

only user mode for the current target architecture

---
 package/qemu/qemu.mk |   82 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)
 create mode 100644 package/qemu/qemu.mk
package/qemu/qemu.mk new file +82 -0
new file mode 100644
index 0000000..de72e04
@@ -0,0 +1,82 @@
+#############################################################
+#
+# qemu
+#
+#############################################################
+
+QEMU_VERSION = 1.2.0
+QEMU_SOURCE = qemu-$(QEMU_VERSION).tar.bz2
+QEMU_SITE = http://wiki.qemu.org/download
+
+#       BR ARCH         qemu
+#       -------         ----
+#       arm             arm
+#       armeb           armeb
+#       avr32           not supported
+#       bfin            not supported
+#       i386            i386
+#       i486            i386
+#       i586            i386
+#       i686            i386
+#       x86_64          x86_64
+#       m68k            m68k
+#       microblaze      microblaze
+#       mips            mips
+#       mipsel          mipsel
+#       mips64          ?
+#       mips64el        ?
+#       powerpc         ppc
+#       sh2             not supported
+#       sh2a            not supported
+#       sh3             not supported
+#       sh3eb           not supported
+#       sh4             sh4
+#       sh4eb           sh4eb
+#       sh4a            ?
+#       sh4aeb          ?
+#       sh64            not supported
+#       sparc           sparc
+
+QEMU_ARCH = $(ARCH)
+ifeq ($(QEMU_ARCH),i486)
+    QEMU_ARCH = i386
+endif
+ifeq ($(QEMU_ARCH),i586)
+    QEMU_ARCH = i386
+endif
+ifeq ($(QEMU_ARCH),i686)
+    QEMU_ARCH = i386
+endif
+ifeq ($(QEMU_ARCH),powerpc)
+    QEMU_ARCH = ppc
+endif
+HOST_QEMU_TARGETS=$(QEMU_ARCH)-linux-user
+
+define HOST_QEMU_CONFIGURE_CMDS
+	(cd $(@D); ./configure                          \
+		--target-list="$(HOST_QEMU_TARGETS)"    \
+		--prefix="$(HOST_DIR)/usr"              \
+		--interp-prefix=$(STAGING_DIR)          \
+		--cc="$(HOSTCC)"                        \
+		--host-cc="$(HOSTCC)"                   \
+		--extra-cflags="$(HOST_CFLAGS)"         \
+		--extra-ldflags="$(HOST_LDFLAGS)"       \
+	)
+endef
+
+define HOST_QEMU_BUILD_CMDS
+	$(MAKE) -C $(@D) all
+endef
+
+define HOST_QEMU_INSTALL_CMDS
+	$(MAKE) -C $(@D) install
+endef
+
+define HOST_QEMU_CLEAN_CMDS
+	$(MAKE) -C $(@D) clean
+endef
+
+$(eval $(host-generic-package))
+
+# variable used by other packages
+QEMU_USER = $(HOST_DIR)/usr/bin/qemu-$(QEMU_ARCH)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v9 2/10 perl: new package

---
 package/Config.in                      |    1 +
 package/perl/Config.in                 |   19 +++++++
 package/perl/perl-configure-qemu.patch |   53 ++++++++++++++++++
 package/perl/perl-make-ext.patch       |   24 +++++++++
 package/perl/perl-mkppport.patch       |   37 +++++++++++++
 package/perl/perl.mk                   |   92 ++++++++++++++++++++++++++++++++
 6 files changed, 226 insertions(+)
 create mode 100644 package/perl/Config.in
 create mode 100644 package/perl/perl-configure-qemu.patch
 create mode 100644 package/perl/perl-make-ext.patch
 create mode 100644 package/perl/perl-mkppport.patch
 create mode 100644 package/perl/perl.mk
package/Config.in +1 -0
index f308de7..00a79ab 100644
@@ -262,6 +262,7 @@ source "package/wsapi/Config.in"
 source "package/xavante/Config.in"
 endmenu
 endif
+source "package/perl/Config.in"
 source "package/microperl/Config.in"
 source "package/php/Config.in"
 source "package/python/Config.in"
package/perl/Config.in new file +19 -0
new file mode 100644
index 0000000..096159f
@@ -0,0 +1,19 @@
+config BR2_PACKAGE_PERL
+	bool "perl"
+	depends on !BR2_avr32
+	depends on !BR2_bfin
+	depends on !BR2_sh2
+	depends on !BR2_sh2a
+	depends on !BR2_sh3
+	depends on !BR2_sh3eb
+	depends on !BR2_sh64
+	select BR2_PACKAGE_HOST_QEMU
+	help
+	  Larry Wall's Practical Extraction and Report Language
+	  An interpreted scripting language, known among some as "Unix's Swiss
+	  Army Chainsaw".
+
+	  http://www.perl.org/
+
+comment "perl requires an architecture supported by qemu"
+	depends on BR2_avr32 || BR2_bfin || BR2_sh2 || BR2_sh2a || BR2_sh3 || BR2_sh3eb || BR2_sh64
package/perl/perl-configure-qemu.patch new file +53 -0

53 lines not on this page · raw message

package/perl/perl-make-ext.patch new file +24 -0
new file mode 100644
index 0000000..e0195e7
@@ -0,0 +1,24 @@
+Don't use RUN with make (only for perl)
+
+Signed-off-by: Francois Perrad <[email protected]>
+
+Index: b/make_ext.pl
+===================================================================
+--- a/make_ext.pl
++++ b/make_ext.pl
+@@ -458,11 +458,13 @@
+ 	# Give makefile an opportunity to rewrite itself.
+ 	# reassure users that life goes on...
+ 	my @args = ('config', @$pass_through);
+-	system(@run, @make, @args) and print "@run @make @args failed, continuing anyway...\n";
++#	system(@run, @make, @args) and print "@run @make @args failed, continuing anyway...\n";
++	system(@make, @args) and print "@make @args failed, continuing anyway...\n";
+     }
+     my @targ = ($target, @$pass_through);
+     print "Making $target in $ext_dir\n at run @make @targ\n";
+-    my $code = system(@run, @make, @targ);
++#    my $code = system(@run, @make, @targ);
++    my $code = system(@make, @targ);
+     die "Unsuccessful make($ext_dir): code=$code" if $code != 0;
+ 
+     chdir $return_dir || die "Cannot cd to $return_dir: $!";
package/perl/perl-mkppport.patch new file +37 -0
new file mode 100644
index 0000000..97f27a2
@@ -0,0 +1,37 @@
+Add RUN
+
+Signed-off-by: Francois Perrad <[email protected]>
+
+Index: b/mkppport
+===================================================================
+--- a/mkppport
++++ b/mkppport
+@@ -1,6 +1,7 @@
+ use strict;
+ use warnings;
+ 
++use Config;
+ use Getopt::Long;
+ use File::Spec;
+ use File::Compare qw( compare );
+@@ -136,14 +137,18 @@
+ #----------------------------------------------
+ sub run
+ {
++  my @run = $Config{run};
++  @run = () if not defined $run[0] or $run[0] eq '';
+   my @args = ("-I" . File::Spec->catdir((File::Spec->updir) x 2, 'lib'), @_);
+   my $run = $perl =~ m/\s/ ? qq("$perl") : $perl;
+   for (@args) {
+     $_ = qq("$_") if $^O eq 'VMS' && /^[^"]/;
+     $run .= " $_";
+   }
+-  print "running $run\n";
+-  system $run and die "$run failed: $?\n";
++#  print "running $run\n";
++#  system $run and die "$run failed: $?\n";
++  print "running ", join(' ', @run, $run), "\n";
++  system join(' ', @run, $run) and die "@run $run failed: $?\n";
+ }
+ 
+ __END__
package/perl/perl.mk new file +92 -0

92 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v9 2/10 perl: new package

Dear Francois Perrad,

package/perl/Config.in line 10

Quoted 1 line · Francois Perrad
package/perl/Config.in new file +1 -0
+	select BR2_PACKAGE_HOST_QEMU

No longer needed.

package/perl/perl.mk line 86

Quoted 6 lines
package/perl/perl.mk new file +6 -0
+define PERL_INSTALL_TARGET_CMDS
+	$(MAKE) INSTALL_DEPENDENCE= \
+		INSTALLFLAGS=-p \
+		DESTDIR="$(TARGET_DIR)" \
+		-C $(@D) install.perl
+endef

In my target, I have about 2 MB of C header files in usr/lib/perl5/5.16.1/linux-gnueabihf/CORE. I suspect they are not really useful, right?

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#3 lore raw

PATCH v9 2/10 perl: new package

2012/10/8 Thomas Petazzoni <[email protected]>:

Quoted 7 lines

Dear Francois Perrad,

Quoted 1 line · Francois Perrad

+ select BR2_PACKAGE_HOST_QEMU

No longer needed.

Ok

Quoted 11 lines

package/perl/perl.mk line 86

Quoted 7 lines
package/perl/perl.mk new file +6 -0
+define PERL_INSTALL_TARGET_CMDS
+     $(MAKE) INSTALL_DEPENDENCE= \
+             INSTALLFLAGS=-p \
+             DESTDIR="$(TARGET_DIR)" \
+             -C $(@D) install.perl
+endef

In my target, I have about 2 MB of C header files in usr/lib/perl5/5.16.1/linux-gnueabihf/CORE. I suspect they are not really useful, right?

No, there are required for building XS modules (with cpanminus for example).

Fran?ois

Quoted 11 lines

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux development, consulting, training and support.
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#4 lore raw

PATCH v9 2/10 perl: new package

Quoted 5 lines · Fran?ois Perrad
Quoted 3 lines

In my target, I have about 2 MB of C header files in usr/lib/perl5/5.16.1/linux-gnueabihf/CORE. I suspect they are not really useful, right?

No, there are required for building XS modules (with cpanminus for example).

Yes, but you're not building those XS modules on the target. So keep the headers only in $(STAGING_DIR).

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#5 lore raw

PATCH v9 2/10 perl: new package

2012/10/8 Thomas Petazzoni <[email protected]>:

Quoted 12 lines · Fran?ois Perrad
Quoted 6 lines
Quoted 4 lines

In my target, I have about 2 MB of C header files in usr/lib/perl5/5.16.1/linux-gnueabihf/CORE. I suspect they are not really useful, right?

No, there are required for building XS modules (with cpanminus for example).

Yes, but you're not building those XS modules on the target. So keep the headers only in $(STAGING_DIR).

a BR user could choose between 2 methods for installing Perl :
- a full install supplied by the script installperl from the Perl tarball
- a custom install which reproduce the behavior of the BR package of microperl, where the user explicitily defines each module/file to install

In my sense, when a user chooses the full install, he must also use the post-build script which removes its useless files, like CORE/*.h or the Unicode support.

Fran?ois

Quoted 6 lines

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

#6 lore raw

PATCH v9 2/10 perl: new package

Quoted 8 lines · Fran?ois Perrad

a BR user could choose between 2 methods for installing Perl :
- a full install supplied by the script installperl from the Perl tarball
- a custom install which reproduce the behavior of the BR package of microperl, where the user explicitily defines each module/file to install

In my sense, when a user chooses the full install, he must also use the post-build script which removes its useless files, like CORE/*.h or the Unicode support.

This is in complete contradiction with what we do in all other Buildroot packages, so I don't think your statement actually makes sense in the context of Buildroot. Unless BR2_HAVE_DEVFILES is enabled, we don't want development files to be installed on the target.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#7 lore raw

PATCH v9 2/10 perl: new package

In reply to Thomas Petazzoni

2012/10/8 Thomas Petazzoni <[email protected]>:

Quoted 12 lines · Fran?ois Perrad
Quoted 6 lines
Quoted 4 lines

In my target, I have about 2 MB of C header files in usr/lib/perl5/5.16.1/linux-gnueabihf/CORE. I suspect they are not really useful, right?

No, there are required for building XS modules (with cpanminus for example).

Yes, but you're not building those XS modules on the target. So keep the headers only in $(STAGING_DIR).

After a refactoring of cpanminus.mk, the headers in $(TARGET_DIR) could be removed.

Quoted 6 lines

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

#8 lore raw

PATCH v9 3/10 perl: add DB_File

In reply to Francois Perrad
---
 package/perl/Config.in |   10 ++++++++++
 package/perl/perl.mk   |    4 ++++
 2 files changed, 14 insertions(+)
package/perl/Config.in +10 -0
index 096159f..9a13223 100644
@@ -15,5 +15,15 @@ config BR2_PACKAGE_PERL
 
 	  http://www.perl.org/
 
+if BR2_PACKAGE_PERL
+
+config BR2_PACKAGE_PERL_DB_FILE
+	bool "DB_File"
+	select BR2_PACKAGE_BERKELEYDB
+	help
+	  Build the DB_File module.
+
+endif
+
 comment "perl requires an architecture supported by qemu"
 	depends on BR2_avr32 || BR2_bfin || BR2_sh2 || BR2_sh2a || BR2_sh3 || BR2_sh3eb || BR2_sh64
package/perl/perl.mk +4 -0
index b29e99f..fbaba54 100644
@@ -11,7 +11,11 @@ PERL_SOURCE = perl-$(PERL_VERSION).tar.bz2
 PERL_LICENSE = Artistic
 PERL_LICENSE_FILES = Artistic
 PERL_INSTALL_STAGING = YES
+
 PERL_DEPENDENCIES = host-qemu
+ifeq ($(BR2_PACKAGE_BERKELEYDB),y)
+    PERL_DEPENDENCIES += berkeleydb
+endif
 
 PERL_CONF_OPT = -des \
 		-Dusecrosscompile \
Signature · 1 line
1.7.9.5
#9 lore raw

PATCH v9 4/10 gdbm: new package

In reply to Francois Perrad
---
 package/Config.in      |    1 +
 package/gdbm/Config.in |    8 ++++++++
 package/gdbm/gdbm.mk   |   12 ++++++++++++
 3 files changed, 21 insertions(+)
 create mode 100644 package/gdbm/Config.in
 create mode 100644 package/gdbm/gdbm.mk
package/Config.in +1 -0
index 00a79ab..d9cadf9 100644
@@ -324,6 +324,7 @@ endmenu
 
 menu "Database"
 source "package/berkeleydb/Config.in"
+source "package/gdbm/Config.in"
 source "package/mysql_client/Config.in"
 source "package/sqlcipher/Config.in"
 source "package/sqlite/Config.in"
package/gdbm/Config.in new file +8 -0
new file mode 100644
index 0000000..d5aae83
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_GDBM
+	bool "gdbm"
+	help
+	  GNU dbm is a set of database routines that use extensible hashing.
+	  It works similar to the standard UNIX dbm routines.
+
+	  http://www.gnu.org/software/gdbm/gdbm.html
+
package/gdbm/gdbm.mk new file +12 -0
new file mode 100644
index 0000000..4971b12
@@ -0,0 +1,12 @@
+#############################################################
+#
+# gdbm
+#
+#############################################################
+GDBM_VERSION = 1.10
+GDBM_SITE = $(BR2_GNU_MIRROR)/gdbm
+GDBM_LICENSE = GPLv3
+GDBM_LICENSE_FILES = COPYING
+GDBM_INSTALL_STAGING = YES
+
+$(eval $(autotools-package))
Signature · 1 line
1.7.9.5
#10 lore raw

PATCH v9 5/10 perl: add GDBM_File

In reply to Francois Perrad
---
 package/perl/Config.in |    6 ++++++
 package/perl/perl.mk   |    3 +++
 2 files changed, 9 insertions(+)
package/perl/Config.in +6 -0
index 9a13223..6369243 100644
@@ -23,6 +23,12 @@ config BR2_PACKAGE_PERL_DB_FILE
 	help
 	  Build the DB_File module.
 
+config BR2_PACKAGE_PERL_GDBM_FILE
+	bool "GDBM_File"
+	select BR2_PACKAGE_GDBM
+	help
+	  Build the GDBM_File module.
+
 endif
 
 comment "perl requires an architecture supported by qemu"
package/perl/perl.mk +3 -0
index fbaba54..0f12044 100644
@@ -16,6 +16,9 @@ PERL_DEPENDENCIES = host-qemu
 ifeq ($(BR2_PACKAGE_BERKELEYDB),y)
     PERL_DEPENDENCIES += berkeleydb
 endif
+ifeq ($(BR2_PACKAGE_GDBM),y)
+    PERL_DEPENDENCIES += gdbm
+endif
 
 PERL_CONF_OPT = -des \
 		-Dusecrosscompile \
Signature · 1 line
1.7.9.5
#11 lore raw

PATCH v9 6/10 cpanminus: new package

In reply to Francois Perrad
---
 package/Config.in                        |    5 ++++
 package/cpanminus/Config.in              |   36 +++++++++++++++++++++++
 package/cpanminus/cpanminus.mk           |   46 ++++++++++++++++++++++++++++++
 package/perl/perl-fix-Module-Build.patch |   16 +++++++++++
 4 files changed, 103 insertions(+)
 create mode 100644 package/cpanminus/Config.in
 create mode 100644 package/cpanminus/cpanminus.mk
 create mode 100644 package/perl/perl-fix-Module-Build.patch
package/Config.in +5 -0
index d9cadf9..06050f2 100644
@@ -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"
package/cpanminus/Config.in new file +36 -0
new file mode 100644
index 0000000..b8b39dc
@@ -0,0 +1,36 @@
+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_MIRROR
+	string "mirror"
+	help
+	  Specifies the base URL for the CPAN mirror to use,
+	  such as http://cpan.cpantesters.org/.
+
+config BR2_PACKAGE_CPANMINUS_MODULES
+	string "Perl modules from CPAN"
+	default "Curses::UI"
+	help
+	  List of space-separated Perl modules to install from CPAN.
+
+	  Examples: Try::Tiny Dancer YAML Moo
+
+	  Install the listed modules and their dependencies.
+
+config BR2_PACKAGE_CPANMINUS_NATIVE_DEPENDENCIES
+	string "native dependencies"
+	default "ncurses"
+	help
+	  Some XS modules require native libraries.
+
+endif
package/cpanminus/cpanminus.mk new file +46 -0

46 lines not on this page · raw message

package/perl/perl-fix-Module-Build.patch new file +16 -0
new file mode 100644
index 0000000..26b15e4
@@ -0,0 +1,16 @@
+
+Signed-off-by: Francois Perrad <[email protected]>
+
+Index: b/cpan/Module-Build/lib/Module/Build/Base.pm
+===================================================================
+--- a/cpan/Module-Build/lib/Module/Build/Base.pm
++++ b/cpan/Module-Build/lib/Module/Build/Base.pm
+@@ -456,7 +456,7 @@
+   my $proto = shift;
+   my $c     = ref($proto) ? $proto->{config} : 'Module::Build::Config';
+ 
+-  my $perl  = $^X;
++  my $perl  = $ENV{RUN_PERL} || $^X;
+   my $perl_basename = File::Basename::basename($perl);
+ 
+   my @potential_perls;
Signature · 1 line
1.7.9.5
#12 lore raw

PATCH v9 6/10 cpanminus: new package

Dear Francois Perrad,

Quoted 10 lines · Francois Perrad
---
 package/Config.in                        |    5 ++++
 package/cpanminus/Config.in              |   36 +++++++++++++++++++++++
 package/cpanminus/cpanminus.mk           |   46 ++++++++++++++++++++++++++++++
 package/perl/perl-fix-Module-Build.patch |   16 +++++++++++
 4 files changed, 103 insertions(+)
 create mode 100644 package/cpanminus/Config.in
 create mode 100644 package/cpanminus/cpanminus.mk
 create mode 100644 package/perl/perl-fix-Module-Build.patch

One thing that I'm wondering with cpanminus is how it interacts with the Buildroot mechanisms for download.

I.e :

*) Where does cpanminus downloads the Perl module tarballs?

*) Does it re-use the downloaded tarballs between rebuilds?

*) Is there a way to tell it to download its tarballs in $(DL_DIR) ?

*) Is there a way to have "make source" work properly, i.e ask
cpanminus to download the tarballs that it will need so that offline builds are possible.

*) Is it possible to make it play nice with BR2_PRIMARY_SITE ?

Thanks!

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#13 lore raw

PATCH v9 6/10 cpanminus: new package

2012/10/8 Thomas Petazzoni <[email protected]>:

Quoted 14 lines

Dear Francois Perrad,

Quoted 10 lines · Francois Perrad
---
 package/Config.in                        |    5 ++++
 package/cpanminus/Config.in              |   36 +++++++++++++++++++++++
 package/cpanminus/cpanminus.mk           |   46 ++++++++++++++++++++++++++++++
 package/perl/perl-fix-Module-Build.patch |   16 +++++++++++
 4 files changed, 103 insertions(+)
 create mode 100644 package/cpanminus/Config.in
 create mode 100644 package/cpanminus/cpanminus.mk
 create mode 100644 package/perl/perl-fix-Module-Build.patch
Quoted 3 lines

One thing that I'm wondering with cpanminus is how it interacts with the Buildroot mechanisms for download.

It doesn't interact.
cpanminus is not a CPAN client based on BR infrastructure. I think what creating a CPAN client based on BR infrastructure could be a nice project, but premature at this time.

But the reproductibility of a project (with an identified version of each CPAN module) could be done with a local CPAN mirror.
A local CPAN mirror allows to work offline.
(see minicpan, http://search.cpan.org/~rjbs/CPAN-Mini-1.111009/bin/minicpan).
So, cpanminus does the job (with its way).

Fran?ois

Quoted 26 lines

I.e :

*) Where does cpanminus downloads the Perl module tarballs?

*) Does it re-use the downloaded tarballs between rebuilds?

*) Is there a way to tell it to download its tarballs in $(DL_DIR) ?

*) Is there a way to have "make source" work properly, i.e ask
cpanminus to download the tarballs that it will need so that offline builds are possible.

*) Is it possible to make it play nice with BR2_PRIMARY_SITE ?

Thanks!

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#14 lore raw

PATCH v9 7/10 perl: add option "custom install"

In reply to Francois Perrad

allows same behaviour (and footprint) as microperl

---
 package/cpanminus/Config.in |    4 ++++
 package/perl/Config.in      |   16 ++++++++++++++++
 package/perl/perl.mk        |   37 +++++++++++++++++++++++++++++++++++++
 3 files changed, 57 insertions(+)
package/cpanminus/Config.in +4 -0
index b8b39dc..58fcb0c 100644
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_CPANMINUS
 	bool "cpanminus"
+	depends on !BR2_PACKAGE_PERL_CUSTOM_INSTALL
 	help
 	  cpanminus is a script to get, unpack, build and install Perl modules
 	  from CPAN.
@@ -34,3 +35,6 @@ config BR2_PACKAGE_CPANMINUS_NATIVE_DEPENDENCIES
 	  Some XS modules require native libraries.
 
 endif
+
+comment "cpanminus requires a fully installed perl"
+	depends on BR2_PACKAGE_PERL_CUSTOM_INSTALL
package/perl/Config.in +16 -0
index 6369243..dcd4b58 100644
@@ -17,6 +17,22 @@ config BR2_PACKAGE_PERL
 
 if BR2_PACKAGE_PERL
 
+config BR2_PACKAGE_PERL_CUSTOM_INSTALL
+	bool "custom install"
+	help
+	  Don't use the full install target
+	  Install only a selection of modules (like microperl).
+
+config BR2_PACKAGE_PERL_MODULES
+	string "additional modules"
+	depends on BR2_PACKAGE_PERL_CUSTOM_INSTALL
+	help
+	  List of space-separated perl modules to copy to the rootfs.
+
+	  Examples: constant.pm Getopt/Std.pm Time/Local.pm
+
+	  Module dependencies are not automatic so check your needs.
+
 config BR2_PACKAGE_PERL_DB_FILE
 	bool "DB_File"
 	select BR2_PACKAGE_BERKELEYDB
package/perl/perl.mk +37 -0
index 0f12044..1fee4e0 100644
@@ -85,12 +85,49 @@ define PERL_INSTALL_STAGING_CMDS
 		-C $(@D) install.perl
 endef
 
+PERL_RUN_PERL = $(QEMU_USER) $(@D)/perl -Ilib
+PERL_ARCHNAME = $(shell $(PERL_RUN_PERL) -MConfig -e "print Config->{archname}")
+PERL_LIB = $(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)
+PERL_ARCHLIB = $(PERL_LIB)/$(PERL_ARCHNAME)
+PERL_MODS = $(call qstrip,$(BR2_PACKAGE_PERL_MODULES))
+# Minimal set of modules required for 'perl -V' to work
+PERL_ARCH_MODS = Config.pm Config_git.pl Config_heavy.pl
+PERL_BASE_MODS = strict.pm vars.pm warnings.pm warnings/register.pm
+
+define PERL_INSTALL_MODULES
+	for i in $(PERL_ARCH_MODS); do \
+		$(INSTALL) -m 0644 -D $(@D)/lib/$$i $(PERL_ARCHLIB)/$$i; \
+	done
+	for i in $(PERL_BASE_MODS); do \
+		$(INSTALL) -m 0644 -D $(@D)/lib/$$i $(PERL_LIB)/$$i; \
+	done
+	for i in $(PERL_MODS); do \
+		j=`echo $$i|cut -d : -f 1` ; \
+		if [ -d $(@D)/lib/$$j ] ; then \
+			cp -af $(@D)/lib/$$j $(PERL_LIB) ; \
+		fi ; \
+		if [ -f $(@D)/lib/$$i ] ; then \
+			$(INSTALL) -m 0644 -D $(@D)/lib/$$i $(PERL_LIB)/$$i; \
+		fi ; \
+	done
+	# Remove test files
+	find $(PERL_LIB) -type f -name *.t -exec rm -f {} \;
+endef
+
+ifeq ($(BR2_PACKAGE_PERL_CUSTOM_INSTALL),y)
+define PERL_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 -D $(@D)/perl $(TARGET_DIR)/usr/bin/perl
+	$(INSTALL) -m 0755 -D $(@D)/libperl.so $(PERL_ARCHLIB)/CORE/libperl.so
+	$(PERL_INSTALL_MODULES)
+endef
+else
 define PERL_INSTALL_TARGET_CMDS
 	$(MAKE) INSTALL_DEPENDENCE= \
 		INSTALLFLAGS=-p \
 		DESTDIR="$(TARGET_DIR)" \
 		-C $(@D) install.perl
 endef
+endif
 
 define PERL_CLEAN_CMDS
 	-$(MAKE) -C $(@D) clean
Signature · 1 line
1.7.9.5
#15 lore raw

PATCH v9 8/10 perl: relax microperl dependencies

In reply to Francois Perrad
---
 package/autoconf/Config.in   |    2 +-
 package/autoconf/autoconf.mk |    7 ++++++-
 package/automake/Config.in   |    2 +-
 package/automake/automake.mk |    7 ++++++-
 package/ntp/Config.in        |    4 ++--
 package/samba/Config.in      |    4 ++--
 6 files changed, 18 insertions(+), 8 deletions(-)
package/autoconf/Config.in +1 -1
index 00b3e2c..41866ad 100644
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_AUTOCONF
 	bool "autoconf"
-	select BR2_PACKAGE_MICROPERL
+	select BR2_PACKAGE_MICROPERL if !BR2_PACKAGE_PERL
 	help
 	  Extensible program for developing configure scripts.  These
 	  scripts handle all the mundane system/feature detection.
package/autoconf/autoconf.mk +6 -1
index 3f84e3e..13a474e 100644
@@ -10,7 +10,12 @@ AUTOCONF_SITE = $(BR2_GNU_MIRROR)/autoconf
 AUTOCONF_CONF_ENV = EMACS="no" ac_cv_path_M4=$(HOST_DIR)/usr/bin/m4 \
 		    ac_cv_prog_gnu_m4_gnu=no
 
-AUTOCONF_DEPENDENCIES = microperl host-m4
+AUTOCONF_DEPENDENCIES = host-m4
+ifeq ($(BR2_PACKAGE_PERL),y)
+    AUTOCONF_DEPENDENCIES += perl
+else
+    AUTOCONF_DEPENDENCIES += microperl
+endif
 
 HOST_AUTOCONF_CONF_ENV = ac_cv_path_M4=$(HOST_DIR)/usr/bin/m4 \
 			ac_cv_prog_gnu_m4_gnu=no
package/automake/Config.in +1 -1
index 935f1f1..c0b29d1 100644
@@ -1,7 +1,7 @@
 config BR2_PACKAGE_AUTOMAKE
 	bool "automake"
 	select BR2_PACKAGE_AUTOCONF
-	select BR2_PACKAGE_MICROPERL
+	select BR2_PACKAGE_MICROPERL if !BR2_PACKAGE_PERL
 	help
 	  Tool for automatically generating Makefile's for input to
 	  configure scripts (made by autoconf).
package/automake/automake.mk +6 -1
index 3c19085..0766111 100644
@@ -7,7 +7,12 @@
 AUTOMAKE_VERSION = 1.11.5
 AUTOMAKE_SITE = $(BR2_GNU_MIRROR)/automake
 
-AUTOMAKE_DEPENDENCIES = host-autoconf autoconf microperl
+AUTOMAKE_DEPENDENCIES = host-autoconf autoconf
+ifeq ($(BR2_PACKAGE_PERL),y)
+    AUTOMAKE_DEPENDENCIES += perl
+else
+    AUTOMAKE_DEPENDENCIES += microperl
+endif
 
 HOST_AUTOMAKE_DEPENDENCIES = host-autoconf
 
package/ntp/Config.in +2 -2
index 5996596..434cd2d 100644
@@ -20,7 +20,7 @@ config BR2_PACKAGE_NTP_NTP_KEYGEN
 
 config BR2_PACKAGE_NTP_NTP_WAIT
 	bool "ntp-wait"
-	depends on BR2_PACKAGE_MICROPERL
+	depends on BR2_PACKAGE_MICROPERL || BR2_PACKAGE_PERL
 	help
 	  ntp-wait waits until the locally running ntpd is in state 4
 	  (synchronized). This could be useful at boot time, to delay the
@@ -59,7 +59,7 @@ config BR2_PACKAGE_NTP_NTPSNMPD
 
 config BR2_PACKAGE_NTP_NTPTRACE
 	bool "ntptrace"
-	depends on BR2_PACKAGE_MICROPERL
+	depends on BR2_PACKAGE_MICROPERL || BR2_PACKAGE_PERL
 	help
 	  ntptrace is a perl script that uses the ntpq utility program to
 	  follow the chain of NTP servers from a given host back to the
package/samba/Config.in +2 -2
index e88b360..ee3244f 100644
@@ -36,12 +36,12 @@ config BR2_PACKAGE_SAMBA_FINDSMB
 	default y
 	depends on BR2_PACKAGE_SAMBA_SMBCLIENT
 	depends on BR2_PACKAGE_SAMBA_NMBLOOKUP
-	depends on BR2_PACKAGE_MICROPERL
+	depends on BR2_PACKAGE_MICROPERL || BR2_PACKAGE_PERL
 	help
 	  Script to browse network
 
 comment "findsmb       - disabled (requires nmblookup, smbclient and perl)"
-	depends on !BR2_PACKAGE_SAMBA_SMBCLIENT || !BR2_PACKAGE_SAMBA_NMBLOOKUP || !BR2_PACKAGE_MICROPERL
+	depends on !BR2_PACKAGE_SAMBA_SMBCLIENT || !BR2_PACKAGE_SAMBA_NMBLOOKUP || !(BR2_PACKAGE_MICROPERL || BR2_PACKAGE_PERL)
 
 config BR2_PACKAGE_SAMBA_NET
 	bool "net"
Signature · 1 line
1.7.9.5
#16 lore raw

PATCH v9 9/10 microperl: mark as DEPRECATED

In reply to Francois Perrad
---
 package/microperl/Config.in |    1 +
 1 file changed, 1 insertion(+)
package/microperl/Config.in +1 -0
index 66bbedd..19d104a 100644
@@ -2,6 +2,7 @@ config BR2_PACKAGE_MICROPERL
 	bool "microperl"
 	# needs fork()
 	depends on BR2_USE_MMU
+	depends on BR2_DEPRECATED
 	help
 	  Perl without operating-specific functions such as readdir.
 
Signature · 1 line
1.7.9.5
#17 lore raw

PATCH v9 10/10 microperl: remove it

In reply to Francois Perrad

replaced by perl
use BR2_PACKAGE_PERL_CUSTOM_INSTALL if you want a small footprint

---
 package/Config.in                                  |    1 -
 package/autoconf/Config.in                         |    2 +-
 package/autoconf/autoconf.mk                       |    7 +-
 package/automake/Config.in                         |    2 +-
 package/automake/automake.mk                       |    7 +-
 package/libxml-parser-perl/libxml-parser-perl.mk   |    6 -
 package/microperl/Config.in                        |   30 ----
 .../microperl/microperl-no-signal-handlers.patch   |   22 ---
 package/microperl/microperl-uudmap.patch           |   47 ------
 package/microperl/microperl.mk                     |  156 --------------------
 package/ntp/Config.in                              |    4 +-
 package/samba/Config.in                            |    4 +-
 12 files changed, 8 insertions(+), 280 deletions(-)
 delete mode 100644 package/microperl/Config.in
 delete mode 100644 package/microperl/microperl-no-signal-handlers.patch
 delete mode 100644 package/microperl/microperl-uudmap.patch
 delete mode 100644 package/microperl/microperl.mk
package/Config.in +0 -1
index 06050f2..987d1d1 100644
@@ -268,7 +268,6 @@ 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"
 if BR2_PACKAGE_PYTHON
package/autoconf/Config.in +1 -1
index 41866ad..5f2f148 100644
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_AUTOCONF
 	bool "autoconf"
-	select BR2_PACKAGE_MICROPERL if !BR2_PACKAGE_PERL
+	select BR2_PACKAGE_PERL
 	help
 	  Extensible program for developing configure scripts.  These
 	  scripts handle all the mundane system/feature detection.
package/autoconf/autoconf.mk +1 -6
index 13a474e..0cb50db 100644
@@ -10,12 +10,7 @@ AUTOCONF_SITE = $(BR2_GNU_MIRROR)/autoconf
 AUTOCONF_CONF_ENV = EMACS="no" ac_cv_path_M4=$(HOST_DIR)/usr/bin/m4 \
 		    ac_cv_prog_gnu_m4_gnu=no
 
-AUTOCONF_DEPENDENCIES = host-m4
-ifeq ($(BR2_PACKAGE_PERL),y)
-    AUTOCONF_DEPENDENCIES += perl
-else
-    AUTOCONF_DEPENDENCIES += microperl
-endif
+AUTOCONF_DEPENDENCIES = host-m4 perl
 
 HOST_AUTOCONF_CONF_ENV = ac_cv_path_M4=$(HOST_DIR)/usr/bin/m4 \
 			ac_cv_prog_gnu_m4_gnu=no
package/automake/Config.in +1 -1
index c0b29d1..9a9673a 100644
@@ -1,7 +1,7 @@
 config BR2_PACKAGE_AUTOMAKE
 	bool "automake"
 	select BR2_PACKAGE_AUTOCONF
-	select BR2_PACKAGE_MICROPERL if !BR2_PACKAGE_PERL
+	select BR2_PACKAGE_PERL
 	help
 	  Tool for automatically generating Makefile's for input to
 	  configure scripts (made by autoconf).
package/automake/automake.mk +1 -6
index 0766111..8be56c3 100644
@@ -7,12 +7,7 @@
 AUTOMAKE_VERSION = 1.11.5
 AUTOMAKE_SITE = $(BR2_GNU_MIRROR)/automake
 
-AUTOMAKE_DEPENDENCIES = host-autoconf autoconf
-ifeq ($(BR2_PACKAGE_PERL),y)
-    AUTOMAKE_DEPENDENCIES += perl
-else
-    AUTOMAKE_DEPENDENCIES += microperl
-endif
+AUTOMAKE_DEPENDENCIES = host-autoconf autoconf perl
 
 HOST_AUTOMAKE_DEPENDENCIES = host-autoconf
 
package/libxml-parser-perl/libxml-parser-perl.mk +0 -6
index a6f8ae9..8e2f899 100644
@@ -9,12 +9,6 @@ LIBXML_PARSER_PERL_SITE:=http://www.cpan.org/modules/by-module/XML/
 
 LIBXML_PARSER_PERL_DEPENDENCIES = expat
 
-ifeq ($(BR2_PACKAGE_MICROPERL),y)
-# microperl builds host-microperl, so ensure we build after that to build
-# against host-microperl instead of the system perl
-LIBXML_PARSER_PERL_DEPENDENCIES += microperl
-endif
-
 define HOST_LIBXML_PARSER_PERL_CONFIGURE_CMDS
  (cd $(@D) ; \
    $(HOST_CONFIGURE_OPTS) perl Makefile.PL \
package/microperl/Config.in deleted +0 -30
deleted file mode 100644
index 19d104a..0000000
@@ -1,30 +0,0 @@
-config BR2_PACKAGE_MICROPERL
-	bool "microperl"
-	# needs fork()
-	depends on BR2_USE_MMU
-	depends on BR2_DEPRECATED
-	help
-	  Perl without operating-specific functions such as readdir.
-
-if BR2_PACKAGE_MICROPERL
-
-config BR2_PACKAGE_MICROPERL_MODULES
-	string "additional modules"
-	help
-	  List of space-separated microperl modules to copy to the rootfs.
-
-	  Examples: warnings.pm Getopt/Std.pm Time::Local
-
-	  Module dependencies are not automatic so check your needs.
-	  You can't use XS modules like IO.
-
-menu "module bundles"
-
-config BR2_PACKAGE_MICROPERL_BUNDLE_CGI
-	bool "CGI"
-	help
-	  Copy required modules to do CGI scripting.
-
-endmenu
-
-endif
package/microperl/microperl-no-signal-handlers.patch deleted +0 -22
deleted file mode 100644
index 3c9aa41..0000000
@@ -1,22 +0,0 @@
-Backport of http://perl5.git.perl.org/perl.git/commitdiff/01d65469392dfc0a?hp=a82b5f080d91ffe184d8ac4795ac71e72e612c2f
-
-Signed-off-by: Gustavo Zacarias <[email protected]>
-
-diff -Nura perl-5.12.3/miniperlmain.c perl-5.12.3-nosig/miniperlmain.c
---- perl-5.12.3/miniperlmain.c	2011-01-09 17:20:57.000000000 -0300
-+++ perl-5.12.3-nosig/miniperlmain.c	2011-04-14 10:16:53.564639438 -0300
-@@ -116,12 +116,14 @@
-     if (!exitstatus)
-         perl_run(my_perl);
- 
-+#ifndef PERL_MICRO
-     /* Unregister our signal handler before destroying my_perl */
-     for (i = 0; PL_sig_name[i]; i++) {
- 	if (rsignal_state(PL_sig_num[i]) == (Sighandler_t) PL_csighandlerp) {
- 	    rsignal(PL_sig_num[i], (Sighandler_t) SIG_DFL);
- 	}
-     }
-+#endif
- 
-     exitstatus = perl_destruct(my_perl);
- 
package/microperl/microperl-uudmap.patch deleted +0 -47

47 lines not on this page · raw message

package/microperl/microperl.mk deleted +0 -156

156 lines not on this page · raw message

package/ntp/Config.in +2 -2
index 434cd2d..ec5dbbb 100644
@@ -20,7 +20,7 @@ config BR2_PACKAGE_NTP_NTP_KEYGEN
 
 config BR2_PACKAGE_NTP_NTP_WAIT
 	bool "ntp-wait"
-	depends on BR2_PACKAGE_MICROPERL || BR2_PACKAGE_PERL
+	depends on BR2_PACKAGE_PERL
 	help
 	  ntp-wait waits until the locally running ntpd is in state 4
 	  (synchronized). This could be useful at boot time, to delay the
@@ -59,7 +59,7 @@ config BR2_PACKAGE_NTP_NTPSNMPD
 
 config BR2_PACKAGE_NTP_NTPTRACE
 	bool "ntptrace"
-	depends on BR2_PACKAGE_MICROPERL || BR2_PACKAGE_PERL
+	depends on BR2_PACKAGE_PERL
 	help
 	  ntptrace is a perl script that uses the ntpq utility program to
 	  follow the chain of NTP servers from a given host back to the
package/samba/Config.in +2 -2
index ee3244f..92714d7 100644
@@ -36,12 +36,12 @@ config BR2_PACKAGE_SAMBA_FINDSMB
 	default y
 	depends on BR2_PACKAGE_SAMBA_SMBCLIENT
 	depends on BR2_PACKAGE_SAMBA_NMBLOOKUP
-	depends on BR2_PACKAGE_MICROPERL || BR2_PACKAGE_PERL
+	depends on BR2_PACKAGE_PERL
 	help
 	  Script to browse network
 
 comment "findsmb       - disabled (requires nmblookup, smbclient and perl)"
-	depends on !BR2_PACKAGE_SAMBA_SMBCLIENT || !BR2_PACKAGE_SAMBA_NMBLOOKUP || !(BR2_PACKAGE_MICROPERL || BR2_PACKAGE_PERL)
+	depends on !BR2_PACKAGE_SAMBA_SMBCLIENT || !BR2_PACKAGE_SAMBA_NMBLOOKUP || !BR2_PACKAGE_PERL
 
 config BR2_PACKAGE_SAMBA_NET
 	bool "net"
Signature · 1 line
1.7.9.5