Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 01/12] microperl: add license info
@ 2012-08-15 14:38 Francois Perrad
  2012-08-15 14:38 ` [Buildroot] [PATCH 02/12] microperl: how to test it ? Francois Perrad
                   ` (11 more replies)
  0 siblings, 12 replies; 16+ messages in thread
From: Francois Perrad @ 2012-08-15 14:38 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 package/microperl/microperl.mk |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/microperl/microperl.mk b/package/microperl/microperl.mk
index fbf319c..b2a912a 100644
--- a/package/microperl/microperl.mk
+++ b/package/microperl/microperl.mk
@@ -7,6 +7,8 @@
 MICROPERL_VERSION = 5.12.4
 MICROPERL_SITE = http://www.cpan.org/src/5.0
 MICROPERL_SOURCE = perl-$(MICROPERL_VERSION).tar.bz2
+MICROPERL_LICENSE = Artistic
+MICROPERL_LICENSE_FILES = Artistic
 MICROPERL_DEPENDENCIES = host-microperl
 MICROPERL_MODS_DIR = /usr/lib/perl5/$(MICROPERL_VERSION)
 MICROPERL_ARCH_DIR = $(MICROPERL_MODS_DIR)/$(GNU_TARGET_NAME)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Buildroot] [PATCH 02/12] microperl: how to test it ?
  2012-08-15 14:38 [Buildroot] [PATCH 01/12] microperl: add license info Francois Perrad
@ 2012-08-15 14:38 ` Francois Perrad
  2012-08-15 16:08   ` Thomas Petazzoni
  2012-08-15 14:38 ` [Buildroot] [PATCH 03/12] microperl: build extensions at build time Francois Perrad
                   ` (10 subsequent siblings)
  11 siblings, 1 reply; 16+ messages in thread
From: Francois Perrad @ 2012-08-15 14:38 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 package/microperl/Config.in    |    9 +++++++++
 package/microperl/microperl.mk |   12 ++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/package/microperl/Config.in b/package/microperl/Config.in
index 256e271..54df7e2 100644
--- a/package/microperl/Config.in
+++ b/package/microperl/Config.in
@@ -15,6 +15,15 @@ config BR2_PACKAGE_MICROPERL_MODULES
 	  Module dependencies are not automatic so check your needs.
 	  You can't use XS modules like IO.
 
+config BR2_PACKAGE_MICROPERL_INSTALL_TESTSUITE
+	bool "install testsuite"
+	help
+	  Install the test suite on target.
+		# cd /root/microperl/t
+		# rm -f perl
+		# ln -s /usr/bin/microperl perl
+		# ./perl TEST base/*.t cmd/*.t
+
 menu "module bundles"
 
 config BR2_PACKAGE_MICROPERL_BUNDLE_CGI
diff --git a/package/microperl/microperl.mk b/package/microperl/microperl.mk
index b2a912a..0269b3f 100644
--- a/package/microperl/microperl.mk
+++ b/package/microperl/microperl.mk
@@ -144,8 +144,20 @@ define MICROPERL_INSTALL_TARGET_CMDS
 	# Remove test files
 	find $(TARGET_DIR)/$(MICROPERL_MODS_DIR) -type f -name *.t \
 		-exec rm -f {} \;
+	$(MICROPERL_INSTALL_TESTSUITE)
 endef
 
+ifdef BR2_PACKAGE_MICROPERL_INSTALL_TESTSUITE
+define MICROPERL_INSTALL_TESTSUITE
+	$(INSTALL) -m644 -D $(@D)/t/TEST                $(TARGET_DIR)/root/microperl/t/TEST
+	$(INSTALL) -m644 -D $(@D)/t/harness             $(TARGET_DIR)/root/microperl/t/harness
+	cp -r $(@D)/lib         $(TARGET_DIR)/root/microperl/lib
+	cp -r $(@D)/t/base      $(TARGET_DIR)/root/microperl/t/base
+	cp -r $(@D)/t/cmd       $(TARGET_DIR)/root/microperl/t/cmd
+	echo "BEGIN { chdir 't' if -d 't'; @INC = ('../lib', '.'); } 1;" > $(TARGET_DIR)/root/microperl/TestInit.pm
+endef
+endif
+
 define MICROPERL_UNINSTALL_TARGET_CMDS
 	rm -f $(TARGET_DIR)/usr/bin/perl
 	rm -f $(TARGET_DIR)/usr/bin/microperl
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Buildroot] [PATCH 03/12] microperl: build extensions at build time
  2012-08-15 14:38 [Buildroot] [PATCH 01/12] microperl: add license info Francois Perrad
  2012-08-15 14:38 ` [Buildroot] [PATCH 02/12] microperl: how to test it ? Francois Perrad
@ 2012-08-15 14:38 ` Francois Perrad
  2012-08-15 14:38 ` [Buildroot] [PATCH 04/12] microperl: bump version to 5.14.2 Francois Perrad
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Francois Perrad @ 2012-08-15 14:38 UTC (permalink / raw)
  To: buildroot

just set PERL5LIB in build tree
optim: symlink only one time, before the loop

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 package/microperl/microperl.mk |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/package/microperl/microperl.mk b/package/microperl/microperl.mk
index 0269b3f..f2a43c0 100644
--- a/package/microperl/microperl.mk
+++ b/package/microperl/microperl.mk
@@ -97,6 +97,7 @@ define MICROPERL_CONFIGURE_CMDS
 	cp -f $(@D)/uconfig.sh $(@D)/config.sh
 	echo "ccname='$(TARGET_CC)'" >>$(@D)/config.sh
 	echo "PERL_CONFIG_SH=true" >>$(@D)/config.sh
+	touch $(@D)/config.h    # avoid warning : out of date
 	cd $(@D) ; $(HOST_DIR)/usr/bin/perl make_patchnum.pl ; \
 	$(HOST_DIR)/usr/bin/perl configpm
 endef
@@ -106,16 +107,17 @@ define MICROPERL_BUILD_CMDS
 		CC="$(HOSTCC)" bitcount.h
 	$(MAKE) -f Makefile.micro -C $(@D) \
 		CC="$(TARGET_CC)" OPTIMIZE="$(TARGET_CFLAGS)"
+	$(MICROPERL_BUILD_EXTENSIONS)
 endef
 
 # Some extensions don't need a build run
 # We try to build anyway to avoid a huge black list
 # Just ignore make_ext.pl warning/errors
 define MICROPERL_BUILD_EXTENSIONS
+	cd $(@D); rm -f miniperl; ln -s $(HOST_DIR)/usr/bin/perl miniperl;
 	for i in $(MICROPERL_MODS); do \
-	cd $(@D); ln -sf $(HOST_DIR)/usr/bin/perl miniperl; \
-		PERL5LIB=$(TARGET_DIR)/$(MICROPERL_ARCH_DIR) \
-		$(HOST_DIR)/usr/bin/perl make_ext.pl MAKE="$(MAKE)" --nonxs \
+	cd $(@D); PERL5LIB=lib \
+		./miniperl make_ext.pl MAKE="$(MAKE)" --nonxs \
 		`echo $$i|sed -e 's/.pm//'`; \
 	done
 endef
@@ -131,7 +133,6 @@ define MICROPERL_INSTALL_TARGET_CMDS
 		$(INSTALL) -m 0644 -D $(@D)/lib/$$i \
 			$(TARGET_DIR)/$(MICROPERL_MODS_DIR)/$$i; \
 	done
-	$(MICROPERL_BUILD_EXTENSIONS)
 	for i in $(MICROPERL_MODS); do \
 		j=`echo $$i|cut -d : -f 1` ; \
 		if [ -d $(@D)/lib/$$j ] ; then \
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Buildroot] [PATCH 04/12] microperl: bump version to 5.14.2
  2012-08-15 14:38 [Buildroot] [PATCH 01/12] microperl: add license info Francois Perrad
  2012-08-15 14:38 ` [Buildroot] [PATCH 02/12] microperl: how to test it ? Francois Perrad
  2012-08-15 14:38 ` [Buildroot] [PATCH 03/12] microperl: build extensions at build time Francois Perrad
@ 2012-08-15 14:38 ` Francois Perrad
  2012-08-15 14:38 ` [Buildroot] [PATCH 05/12] microperl: fix perl -V Francois Perrad
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Francois Perrad @ 2012-08-15 14:38 UTC (permalink / raw)
  To: buildroot

patches have been merged in upstream

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 .../microperl/microperl-no-signal-handlers.patch   |   22 ---------
 package/microperl/microperl-uudmap.patch           |   47 --------------------
 package/microperl/microperl.mk                     |    6 ++-
 3 files changed, 4 insertions(+), 71 deletions(-)
 delete mode 100644 package/microperl/microperl-no-signal-handlers.patch
 delete mode 100644 package/microperl/microperl-uudmap.patch

diff --git a/package/microperl/microperl-no-signal-handlers.patch b/package/microperl/microperl-no-signal-handlers.patch
deleted file mode 100644
index 3c9aa41..0000000
--- a/package/microperl/microperl-no-signal-handlers.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Backport of http://perl5.git.perl.org/perl.git/commitdiff/01d65469392dfc0a?hp=a82b5f080d91ffe184d8ac4795ac71e72e612c2f
-
-Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
-
-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);
- 
diff --git a/package/microperl/microperl-uudmap.patch b/package/microperl/microperl-uudmap.patch
deleted file mode 100644
index c72f9c9..0000000
--- a/package/microperl/microperl-uudmap.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From a82b5f080d91ffe184d8ac4795ac71e72e612c2f Mon Sep 17 00:00:00 2001
-From: David Leadbeater <dgl@dgl.cx>
-Date: Mon, 7 Mar 2011 18:40:55 +0000
-Subject: [PATCH] microperl: Update generate_uudmap in Makefile.micro
-
-Makefile.micro hadn't kept up with the changes for generate_uudmap,
-make it match the real Makefile.
----
- Makefile.micro |    8 ++++----
- 1 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/Makefile.micro b/Makefile.micro
-index 4b738f5..567d98a 100644
---- a/Makefile.micro
-+++ b/Makefile.micro
-@@ -35,7 +35,7 @@ H = av.h uconfig.h cop.h cv.h embed.h embedvar.h form.h gv.h handy.h \
- HE = $(H) EXTERN.h
- 
- clean:
--	-rm -f $(O) microperl generate_uudmap$(_X) uudmap.h
-+	-rm -f $(O) microperl generate_uudmap$(_X) uudmap.h bitcount.h
- 
- distclean:	clean
- 
-@@ -74,7 +74,7 @@ udoop$(_O):	$(HE) doop.c
- udump$(_O):	$(HE) dump.c regcomp.h regnodes.h
- 	$(CC) $(CCFLAGS) -o $@ $(CFLAGS) dump.c
- 
--uglobals$(_O):	$(H) globals.c INTERN.h perlapi.h
-+uglobals$(_O):	$(H) globals.c INTERN.h perlapi.h uudmap.h bitcount.h
- 	$(CC) $(CCFLAGS) -o $@ $(CFLAGS) globals.c
- 
- ugv$(_O):	$(HE) gv.c
-@@ -173,8 +173,8 @@ uutil$(_O):	$(HE) util.c
- uperlapi$(_O):	$(HE) perlapi.c perlapi.h
- 	$(CC) $(CCFLAGS) -o $@ $(CFLAGS) perlapi.c
- 
--uudmap.h: generate_uudmap$(_X)
--	$(RUN) ./generate_uudmap$(_X) >uudmap.h
-+uudmap.h bitcount.h: generate_uudmap$(_X)
-+	$(RUN) ./generate_uudmap$(_X) uudmap.h bitcount.h
- 
- generate_uudmap$(_O): generate_uudmap.c
- 	$(CC) $(CCFLAGS) -o $@ $(CFLAGS) generate_uudmap.c
--- 
-1.6.5.2.74.g610f9.dirty
-
diff --git a/package/microperl/microperl.mk b/package/microperl/microperl.mk
index f2a43c0..595e1fa 100644
--- a/package/microperl/microperl.mk
+++ b/package/microperl/microperl.mk
@@ -4,7 +4,8 @@
 #
 #############################################################
 
-MICROPERL_VERSION = 5.12.4
+MICROPERL_VERSION_MAJOR = 14
+MICROPERL_VERSION = 5.$(MICROPERL_VERSION_MAJOR).2
 MICROPERL_SITE = http://www.cpan.org/src/5.0
 MICROPERL_SOURCE = perl-$(MICROPERL_VERSION).tar.bz2
 MICROPERL_LICENSE = Artistic
@@ -70,7 +71,7 @@ define MICROPERL_CONFIGURE_CMDS
 		-e '/^osname=/d' -e '/^u32type=/d' -e '/^d_archlib=/d' \
 		-e '/^d_memset=/d' -e '/^i_fcntl=/d' -e '/^useperlio=/d' \
 		-e '/^need_va_copy=/d' $(@D)/uconfig.sh
-	$(SED) 's/5.12/$(MICROPERL_VERSION)/' $(@D)/uconfig.sh
+	$(SED) 's/5\.$(MICROPERL_VERSION_MAJOR)/$(MICROPERL_VERSION)/' $(@D)/uconfig.sh
 	echo "archlib='$(MICROPERL_ARCH_DIR)'" >>$(@D)/uconfig.sh
 	echo "archlibexp='$(MICROPERL_ARCH_DIR)'" >>$(@D)/uconfig.sh
 	echo "d_archlib='define'" >>$(@D)/uconfig.sh
@@ -152,6 +153,7 @@ ifdef BR2_PACKAGE_MICROPERL_INSTALL_TESTSUITE
 define MICROPERL_INSTALL_TESTSUITE
 	$(INSTALL) -m644 -D $(@D)/t/TEST                $(TARGET_DIR)/root/microperl/t/TEST
 	$(INSTALL) -m644 -D $(@D)/t/harness             $(TARGET_DIR)/root/microperl/t/harness
+	$(INSTALL) -m644 -D $(@D)/t/test.pl             $(TARGET_DIR)/root/microperl/t/test.pl
 	cp -r $(@D)/lib         $(TARGET_DIR)/root/microperl/lib
 	cp -r $(@D)/t/base      $(TARGET_DIR)/root/microperl/t/base
 	cp -r $(@D)/t/cmd       $(TARGET_DIR)/root/microperl/t/cmd
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Buildroot] [PATCH 05/12] microperl: fix perl -V
  2012-08-15 14:38 [Buildroot] [PATCH 01/12] microperl: add license info Francois Perrad
                   ` (2 preceding siblings ...)
  2012-08-15 14:38 ` [Buildroot] [PATCH 04/12] microperl: bump version to 5.14.2 Francois Perrad
@ 2012-08-15 14:38 ` Francois Perrad
  2012-08-15 14:38 ` [Buildroot] [PATCH 06/12] microperl: install more modules by default Francois Perrad
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Francois Perrad @ 2012-08-15 14:38 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 package/microperl/microperl.mk |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/package/microperl/microperl.mk b/package/microperl/microperl.mk
index 595e1fa..4229a2f 100644
--- a/package/microperl/microperl.mk
+++ b/package/microperl/microperl.mk
@@ -17,12 +17,11 @@ MICROPERL_MODS = $(call qstrip,$(BR2_PACKAGE_MICROPERL_MODULES))
 
 # Minimal set of modules required for 'perl -V' to work
 MICROPERL_ARCH_MODS = Config.pm Config_git.pl Config_heavy.pl
-MICROPERL_BASE_MODS = strict.pm
+MICROPERL_BASE_MODS = strict.pm vars.pm warnings.pm warnings/register.pm
 
 # CGI bundle
 ifeq ($(BR2_PACKAGE_MICROPERL_BUNDLE_CGI),y)
-MICROPERL_MODS += constant.pm CGI CGI.pm Carp.pm Exporter.pm overload.pm \
-	vars.pm warnings.pm warnings/register.pm
+MICROPERL_MODS += constant.pm CGI CGI.pm Carp.pm Exporter.pm overload.pm
 endif
 
 # Host microperl is actually full-blown perl
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Buildroot] [PATCH 06/12] microperl: install more modules by default
  2012-08-15 14:38 [Buildroot] [PATCH 01/12] microperl: add license info Francois Perrad
                   ` (3 preceding siblings ...)
  2012-08-15 14:38 ` [Buildroot] [PATCH 05/12] microperl: fix perl -V Francois Perrad
@ 2012-08-15 14:38 ` Francois Perrad
  2012-08-15 14:38 ` [Buildroot] [PATCH 07/12] microperl: improve configure step on 64bits platform Francois Perrad
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Francois Perrad @ 2012-08-15 14:38 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 package/microperl/microperl.mk |   45 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 44 insertions(+), 1 deletion(-)

diff --git a/package/microperl/microperl.mk b/package/microperl/microperl.mk
index 4229a2f..8cd1a42 100644
--- a/package/microperl/microperl.mk
+++ b/package/microperl/microperl.mk
@@ -19,9 +19,52 @@ MICROPERL_MODS = $(call qstrip,$(BR2_PACKAGE_MICROPERL_MODULES))
 MICROPERL_ARCH_MODS = Config.pm Config_git.pl Config_heavy.pl
 MICROPERL_BASE_MODS = strict.pm vars.pm warnings.pm warnings/register.pm
 
+# other pragma modules (from lib/)
+MICROPERL_BASE_MODS += \
+  bytes.pm \
+  deprecate.pm \
+  feature.pm \
+  integer.pm \
+  less.pm \
+  locale.pm \
+  overloading.pm \
+  overload.pm \
+  sigtrap.pm \
+  sort.pm \
+  subs.pm \
+  utf8.pm utf8_heavy.pl \
+  version.pm
+
+# some common modules (from lib/)
+MICROPERL_BASE_MODS += \
+  Benchmark.pm \
+  Carp.pm \
+  Class/Struct.pm \
+  Exporter.pm Exporter/Heavy.pm \
+  File/Basename.pm \
+  File/Compare.pm \
+  Getopt/Std.pm \
+  Tie/Array.pm \
+  Tie/Hash.pm \
+  Tie/Scalar.pm \
+  UNIVERSAL.pm
+
+# other common modules (from dist/)
+MICROPERL_MODS += \
+  Dumpvalue.pm \
+  Env.pm \
+  autouse.pm \
+  base.pm \
+  constant.pm
+
+# other common modules (from cpan/)
+MICROPERL_MODS += \
+  Getopt/Long.pm \
+  parent.pm
+
 # CGI bundle
 ifeq ($(BR2_PACKAGE_MICROPERL_BUNDLE_CGI),y)
-MICROPERL_MODS += constant.pm CGI CGI.pm Carp.pm Exporter.pm overload.pm
+MICROPERL_MODS += CGI CGI.pm
 endif
 
 # Host microperl is actually full-blown perl
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Buildroot] [PATCH 07/12] microperl: improve configure step on 64bits platform
  2012-08-15 14:38 [Buildroot] [PATCH 01/12] microperl: add license info Francois Perrad
                   ` (4 preceding siblings ...)
  2012-08-15 14:38 ` [Buildroot] [PATCH 06/12] microperl: install more modules by default Francois Perrad
@ 2012-08-15 14:38 ` Francois Perrad
  2012-08-15 14:38 ` [Buildroot] [PATCH 08/12] perl: new package Francois Perrad
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Francois Perrad @ 2012-08-15 14:38 UTC (permalink / raw)
  To: buildroot

use uconfig64.sh instead of uconfig.sh

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 package/microperl/microperl.mk |   74 ++++++++++++++++++++++------------------
 1 file changed, 41 insertions(+), 33 deletions(-)

diff --git a/package/microperl/microperl.mk b/package/microperl/microperl.mk
index 8cd1a42..aaa47be 100644
--- a/package/microperl/microperl.mk
+++ b/package/microperl/microperl.mk
@@ -15,6 +15,18 @@ MICROPERL_MODS_DIR = /usr/lib/perl5/$(MICROPERL_VERSION)
 MICROPERL_ARCH_DIR = $(MICROPERL_MODS_DIR)/$(GNU_TARGET_NAME)
 MICROPERL_MODS = $(call qstrip,$(BR2_PACKAGE_MICROPERL_MODULES))
 
+ifeq ($(BR2_ARCH_IS_64),y)
+MICROPERL_UCONFIG_SH = $(@D)/uconfig64.sh
+define MICROPERL_REGEN_CONFIG
+	$(MAKE) -C $(@D) -f Makefile.micro regen_uconfig64
+endef
+else
+MICROPERL_UCONFIG_SH = $(@D)/uconfig.sh
+define MICROPERL_REGEN_CONFIG
+	$(MAKE) -C $(@D) -f Makefile.micro regen_uconfig
+endef
+endif
+
 # Minimal set of modules required for 'perl -V' to work
 MICROPERL_ARCH_MODS = Config.pm Config_git.pl Config_heavy.pl
 MICROPERL_BASE_MODS = strict.pm vars.pm warnings.pm warnings/register.pm
@@ -84,60 +96,56 @@ endef
 
 ifeq ($(BR2_ENDIAN),"BIG")
 define MICROPERL_BIGENDIAN
-	$(SED) '/^byteorder=/d' $(@D)/uconfig.sh
-	echo "byteorder='4321'" >>$(@D)/uconfig.sh
+	$(SED) '/^byteorder=/d' $(MICROPERL_UCONFIG_SH)
+	echo "byteorder='4321'" >>$(MICROPERL_UCONFIG_SH)
 endef
 endif
 
 ifeq ($(BR2_LARGEFILE),y)
 define MICROPERL_LARGEFILE
-	$(SED) '/^uselargefiles=/d' $(@D)/uconfig.sh
-	echo "uselargefiles='define'" >>$(@D)/uconfig.sh
+	$(SED) '/^uselargefiles=/d' $(MICROPERL_UCONFIG_SH)
+	echo "uselargefiles='define'" >>$(MICROPERL_UCONFIG_SH)
 endef
 endif
 
 ifeq ($(BR2_USE_WCHAR),y)
 define MICROPERL_WCHAR
 	$(SED) '/^d_mbstowcs=/d' -e '/^d_mbtowc=/d' -e '/^d_wcstombs=/d' \
-		-e '/^d_wctomb=/d' $(@D)/uconfig.sh
-	echo "d_mbstowcs='define'" >>$(@D)/uconfig.sh
-	echo "d_mbtowc='define'" >>$(@D)/uconfig.sh
-	echo "d_wcstombs='define'" >>$(@D)/uconfig.sh
-	echo "d_wctomb='define'" >>$(@D)/uconfig.sh
+		-e '/^d_wctomb=/d' $(MICROPERL_UCONFIG_SH)
+	echo "d_mbstowcs='define'" >>$(MICROPERL_UCONFIG_SH)
+	echo "d_mbtowc='define'" >>$(MICROPERL_UCONFIG_SH)
+	echo "d_wcstombs='define'" >>$(MICROPERL_UCONFIG_SH)
+	echo "d_wctomb='define'" >>$(MICROPERL_UCONFIG_SH)
 endef
 endif
 
 define MICROPERL_CONFIGURE_CMDS
 	$(SED) '/^archlib=/d' -e '/^archlibexp=/d' -e '/^optimize=/d' \
 		-e '/^archname=/d' -e '/^d_poll=/d' -e '/^i_poll=/d' \
-		-e '/^osname=/d' -e '/^u32type=/d' -e '/^d_archlib=/d' \
-		-e '/^d_memset=/d' -e '/^i_fcntl=/d' -e '/^useperlio=/d' \
-		-e '/^need_va_copy=/d' $(@D)/uconfig.sh
-	$(SED) 's/5\.$(MICROPERL_VERSION_MAJOR)/$(MICROPERL_VERSION)/' $(@D)/uconfig.sh
-	echo "archlib='$(MICROPERL_ARCH_DIR)'" >>$(@D)/uconfig.sh
-	echo "archlibexp='$(MICROPERL_ARCH_DIR)'" >>$(@D)/uconfig.sh
-	echo "d_archlib='define'" >>$(@D)/uconfig.sh
-	echo "archname='$(GNU_TARGET_NAME)'" >>$(@D)/uconfig.sh
-	echo "osname='linux'" >>$(@D)/uconfig.sh
-	echo "cc='$(TARGET_CC)'" >>$(@D)/uconfig.sh
-	echo "ccflags='$(TARGET_CFLAGS)'" >>$(@D)/uconfig.sh
-	echo "optimize='$(TARGET_CFLAGS)'" >>$(@D)/uconfig.sh
-	echo "usecrosscompile='define'" >>$(@D)/uconfig.sh
-	echo "d_memset='define'" >>$(@D)/uconfig.sh
-	echo "i_fcntl='define'" >>$(@D)/uconfig.sh
-	echo "useperlio='define'" >>$(@D)/uconfig.sh
-	echo "u32type='unsigned int'" >>$(@D)/uconfig.sh
-	echo "need_va_copy='define'" >>$(@D)/uconfig.sh
-	echo "d_poll='define'" >>$(@D)/uconfig.sh
-	echo "i_poll='define'" >>$(@D)/uconfig.sh
-	$(SED) 's/UNKNOWN-/Buildroot $(BR2_VERSION_FULL) /' $(@D)/patchlevel.h
-	$(SED) 's/local\///' $(@D)/uconfig.sh
+		-e '/^osname=/d' -e '/^d_archlib=/d' -e '/^i_fcntl=/d' \
+		-e '/^useperlio=/d' $(MICROPERL_UCONFIG_SH)
+	$(SED) 's/5\.$(MICROPERL_VERSION_MAJOR)/$(MICROPERL_VERSION)/' $(MICROPERL_UCONFIG_SH)
+	echo "archlib='$(MICROPERL_ARCH_DIR)'" >>$(MICROPERL_UCONFIG_SH)
+	echo "archlibexp='$(MICROPERL_ARCH_DIR)'" >>$(MICROPERL_UCONFIG_SH)
+	echo "d_archlib='define'" >>$(MICROPERL_UCONFIG_SH)
+	echo "archname='$(GNU_TARGET_NAME)'" >>$(MICROPERL_UCONFIG_SH)
+	echo "osname='linux'" >>$(MICROPERL_UCONFIG_SH)
+	echo "cc='$(TARGET_CC)'" >>$(MICROPERL_UCONFIG_SH)
+	echo "ccflags='$(TARGET_CFLAGS)'" >>$(MICROPERL_UCONFIG_SH)
+	echo "optimize='$(TARGET_CFLAGS)'" >>$(MICROPERL_UCONFIG_SH)
+	echo "usecrosscompile='define'" >>$(MICROPERL_UCONFIG_SH)
+	echo "i_fcntl='define'" >>$(MICROPERL_UCONFIG_SH)
+	echo "useperlio='define'" >>$(MICROPERL_UCONFIG_SH)
+	echo "d_poll='define'" >>$(MICROPERL_UCONFIG_SH)
+	echo "i_poll='define'" >>$(MICROPERL_UCONFIG_SH)
 	$(MICROPERL_BIGENDIAN)
 	$(MICROPERL_LARGEFILE)
 	$(MICROPERL_WCHAR)
-	$(MAKE) -C $(@D) -f Makefile.micro regen_uconfig
+	$(SED) 's/local\///' $(MICROPERL_UCONFIG_SH)
+	$(SED) 's/UNKNOWN-/Buildroot $(BR2_VERSION_FULL) /' $(@D)/patchlevel.h
+	$(MICROPERL_REGEN_CONFIG)
 	cp -f $(@D)/uconfig.h $(@D)/config.h
-	cp -f $(@D)/uconfig.sh $(@D)/config.sh
+	cp -f $(MICROPERL_UCONFIG_SH) $(@D)/config.sh
 	echo "ccname='$(TARGET_CC)'" >>$(@D)/config.sh
 	echo "PERL_CONFIG_SH=true" >>$(@D)/config.sh
 	touch $(@D)/config.h    # avoid warning : out of date
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Buildroot] [PATCH 08/12] perl: new package
  2012-08-15 14:38 [Buildroot] [PATCH 01/12] microperl: add license info Francois Perrad
                   ` (5 preceding siblings ...)
  2012-08-15 14:38 ` [Buildroot] [PATCH 07/12] microperl: improve configure step on 64bits platform Francois Perrad
@ 2012-08-15 14:38 ` Francois Perrad
  2012-08-15 14:38 ` [Buildroot] [PATCH 09/12] miniperl: " Francois Perrad
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Francois Perrad @ 2012-08-15 14:38 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 package/Config.in                             |    1 +
 package/perl/Config.in                        |   31 +++++
 package/perl/perl-add-patch-Makefile-SH.patch |   82 +++++++++++++
 package/perl/perl-configure-qemu.patch        |   22 ++++
 package/perl/perl-fix-installperl.patch       |   25 ++++
 package/perl/perl-run-perl-lib.patch          |   98 ++++++++++++++++
 package/perl/perl.mk                          |  156 +++++++++++++++++++++++++
 7 files changed, 415 insertions(+)
 create mode 100644 package/perl/Config.in
 create mode 100644 package/perl/perl-add-patch-Makefile-SH.patch
 create mode 100644 package/perl/perl-configure-qemu.patch
 create mode 100644 package/perl/perl-fix-installperl.patch
 create mode 100644 package/perl/perl-run-perl-lib.patch
 create mode 100644 package/perl/perl.mk

diff --git a/package/Config.in b/package/Config.in
index f308de7..00a79ab 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -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"
diff --git a/package/perl/Config.in b/package/perl/Config.in
new file mode 100644
index 0000000..4b52e96
--- /dev/null
+++ b/package/perl/Config.in
@@ -0,0 +1,31 @@
+config BR2_PACKAGE_PERL
+	bool "perl"
+	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/
+
+if BR2_PACKAGE_PERL
+
+config BR2_PACKAGE_PERL_CUSTOM_CONFIGURE
+	string "configuration flags"
+	help
+	  Allows to add some flags to Configure.
+
+config BR2_PACKAGE_PERL_TEST_HOST
+	bool "test host"
+	help
+	  Run 'make test' after the building of host-perl.
+
+config BR2_PACKAGE_PERL_INSTALL_TESTSUITE
+	bool "install testsuite"
+	help
+	  Install the test suite (~500000 tests) on target.
+		# cd /root/perl/t
+		# rm -f perl
+		# ln -s /usr/bin/perl perl
+		# ./perl TEST
+
+endif
diff --git a/package/perl/perl-add-patch-Makefile-SH.patch b/package/perl/perl-add-patch-Makefile-SH.patch
new file mode 100644
index 0000000..ba49be7
--- /dev/null
+++ b/package/perl/perl-add-patch-Makefile-SH.patch
@@ -0,0 +1,82 @@
+add a patch which must applied only for perl (not for host-perl)
+
+Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
+
+Index: b/Cross/Makefile-buildroot-SH.patch
+===================================================================
+--- /dev/null
++++ b/Cross/Makefile-buildroot-SH.patch
+@@ -0,0 +1,73 @@
++remove rules for miniperl & generates_uudmap which come from host-perl
++
++Index: b/Makefile.SH
++===================================================================
++--- a/Makefile.SH
+++++ b/Makefile.SH
++@@ -654,10 +654,7 @@
++ bitcount.h: generate_uudmap$(HOST_EXE_EXT)
++ 	$(RUN) ./generate_uudmap$(HOST_EXE_EXT) $(generated_headers)
++ 
++-generate_uudmap$(OBJ_EXT): mg_raw.h
++-
++-generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT)
++-	$(CC) -o generate_uudmap$(EXE_EXT) $(LDFLAGS) generate_uudmap$(OBJ_EXT) $(libs)
+++# generate_uudmap$(HOST_EXE_EXT) comes from host-perl
++ 
++ miniperlmain$(OBJ_EXT): miniperlmain.c patchlevel.h
++ 	$(CCCMD) $(PLDLFLAGS) $*.c
++@@ -829,52 +826,9 @@
++ 
++ !NO!SUBS!
++ 
++-	case "${osname}${osvers}" in
++-	aix*|beos*)
++-		$spitshell >>$Makefile <<'!NO!SUBS!'
++-$(MINIPERL_EXE): $& $(mini_obj)
++-	$(CC) -o $(MINIPERL_EXE) $(CLDFLAGS) $(mini_obj) $(libs)
++-	$(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
++-!NO!SUBS!
++-		;;
++-	next4*)
++-		$spitshell >>$Makefile <<'!NO!SUBS!'
++-$(MINIPERL_EXE): $& $(mini_obj)
++-	$(CC) -o $(MINIPERL_EXE) $(mini_obj) $(libs)
++-	$(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
++-!NO!SUBS!
++-		;;
++-	darwin*)
++-		case "$osvers" in
++-		[1-6].*) ;;
++-		*) case "$ldflags" in
++-		    *"-flat_namespace"*) ;;
++-		    *) # to allow opmini.o to override stuff in libperl.dylib
++-		$spitshell >>$Makefile <<!NO!SUBS!
++-NAMESPACEFLAGS = -force_flat_namespace
++-!NO!SUBS!
++-		       ;;
++-		    esac
++-		    ;;
++-		esac
++-		$spitshell >>$Makefile <<'!NO!SUBS!'
++-$(MINIPERL_EXE): $& $(mini_obj)
++-	-@rm -f miniperl.xok
++-	$(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o $(MINIPERL_EXE) \
++-	    $(mini_obj) $(libs)
++-	$(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
++-!NO!SUBS!
++-		;;
++-	*)
++-		$spitshell >>$Makefile <<'!NO!SUBS!'
++-$(MINIPERL_EXE): $& $(mini_obj)
++-	-@rm -f miniperl.xok
++-	$(LDLIBPTH) $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
++-	    $(mini_obj) $(libs)
++-	$(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
+++	$spitshell >>$Makefile <<'!NO!SUBS!'
+++# $(MINIPERL_EXE) comes from host-perl
++ !NO!SUBS!
++-		;;
++-	esac
++ 
++ 	$spitshell >>$Makefile <<'!NO!SUBS!'
++ 
diff --git a/package/perl/perl-configure-qemu.patch b/package/perl/perl-configure-qemu.patch
new file mode 100644
index 0000000..2d9c0dd
--- /dev/null
+++ b/package/perl/perl-configure-qemu.patch
@@ -0,0 +1,22 @@
+
+Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
+
+Index: b/Configure
+===================================================================
+--- a/Configure
++++ b/Configure
+@@ -2908,6 +2908,14 @@ fi
+ $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
+ EOF
+ 	    ;;
++	qemu*)
++	    targetto=cp
++	    targetfrom=cp
++	    cat >$run <<EOF
++#!/bin/sh
++$targetrun -L $qemulib $exe \$@
++EOF
++	    ;;
+ 	*)  echo "Unknown targetrun '$targetrun'" >&4
+ 	    exit 1
+ 	    ;;
diff --git a/package/perl/perl-fix-installperl.patch b/package/perl/perl-fix-installperl.patch
new file mode 100644
index 0000000..e9a9f81
--- /dev/null
+++ b/package/perl/perl-fix-installperl.patch
@@ -0,0 +1,25 @@
+
+Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
+
+Index: b/installperl
+===================================================================
+--- a/installperl
++++ b/installperl
+@@ -3,11 +3,17 @@
+ BEGIN {
+     require 5.004;
+     chdir '..' if !-d 'lib' and -d '../lib';
++
++    my @sav = @INC;
++    my $sav = $ENV{PERL5LIB};
+     @INC = 'lib';
+     $ENV{PERL5LIB} = 'lib';
+ 
+     # This needs to be at BEGIN time, before any use of Config
+     require './install_lib.pl';
++
++    @INC = @sav;
++    $ENV{PERL5LIB} = $sav;
+ }
+ 
+ use strict;
diff --git a/package/perl/perl-run-perl-lib.patch b/package/perl/perl-run-perl-lib.patch
new file mode 100644
index 0000000..15e0edc
--- /dev/null
+++ b/package/perl/perl-run-perl-lib.patch
@@ -0,0 +1,98 @@
+RUN_PERL is overloaded by host-perl which cannot use target libraries
+
+Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
+
+Index: b/Makefile.SH
+===================================================================
+--- a/Makefile.SH
++++ b/Makefile.SH
+@@ -309,7 +309,7 @@
+ 
+ # Macros to invoke a copy of our fully operational perl during the build.
+ PERL_EXE = perl\$(EXE_EXT)
+-RUN_PERL = \$(LDLIBPTH) \$(RUN) ./perl\$(EXE_EXT)
++RUN_PERL = \$(LDLIBPTH) \$(RUN) ./perl\$(EXE_EXT) -Ilib
+ 
+ # Macros to run our tests
+ RUN_TESTS = \$(LDLIBPTH) ./runtests
+@@ -1048,7 +1048,7 @@
+ # But also this ensures that all extensions are built before we try to scan
+ # them, which picks up Devel::PPPort's documentation.
+ pod/perltoc.pod: $(perltoc_pod_prereqs)  $(PERL_EXE) $(ext) pod/buildtoc
+-	$(RUN_PERL) -f -Ilib pod/buildtoc -q
++	$(RUN_PERL) -f pod/buildtoc -q
+ 
+ pod/perlapi.pod: pod/perlintern.pod
+ 
+@@ -1071,13 +1071,13 @@
+ 	done
+ 
+ extras.make: $(PERL_EXE)
+-	- at test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib -MCPAN -e '@ARGV&&make(@ARGV)' `cat extras.lst`
++	- at test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -MCPAN -e '@ARGV&&make(@ARGV)' `cat extras.lst`
+ 
+ extras.test: $(PERL_EXE)
+-	- at test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib -MCPAN -e '@ARGV&&test(@ARGV)' `cat extras.lst`
++	- at test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -MCPAN -e '@ARGV&&test(@ARGV)' `cat extras.lst`
+ 
+ extras.install: $(PERL_EXE)
+-	- at test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst`
++	- at test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst`
+ 
+ .PHONY: install install-strip install-all install-verbose install-silent \
+ 	no-install install.perl install.man install.html
+@@ -1180,7 +1180,7 @@
+ regen_meta regen-meta:  META.yml
+ 
+ META.yml:   FORCE
+-	PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib Porting/makemeta
++	PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) Porting/makemeta
+ 
+ 
+ regen_all regen-all: regen regen_meta
+@@ -1225,7 +1225,7 @@
+ 
+ .PHONY: printconfig
+ printconfig:
+-	@eval `$(RUN_PERL) -Ilib -V:$(CONFIGVAR)`; echo $$$(CONFIGVAR)
++	@eval `$(RUN_PERL) -V:$(CONFIGVAR)`; echo $$$(CONFIGVAR)
+ 
+ .PHONY: clean _tidy _mopup _cleaner1 _cleaner2 \
+ 	realclean _realcleaner clobber _clobber \
+@@ -1540,28 +1540,28 @@
+ .PHONY: ok okfile oknack okfilenack nok nokfile noknack nokfilenack
+ 
+ ok:	utilities
+-	$(RUN_PERL) -Ilib utils/perlbug -ok -s '(UNINSTALLED)'
++	$(RUN_PERL) utils/perlbug -ok -s '(UNINSTALLED)'
+ 
+ okfile:	utilities
+-	$(RUN_PERL) -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok
++	$(RUN_PERL) utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok
+ 
+ oknack:	utilities
+-	$(RUN_PERL) -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -A
++	$(RUN_PERL) utils/perlbug -ok -s '(UNINSTALLED)' -A
+ 
+ okfilenack:	utilities
+-	$(RUN_PERL) -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok -A
++	$(RUN_PERL) utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok -A
+ 
+ nok:	utilities
+-	$(RUN_PERL) -Ilib utils/perlbug -nok -s '(UNINSTALLED)'
++	$(RUN_PERL) utils/perlbug -nok -s '(UNINSTALLED)'
+ 
+ nokfile:	utilities
+-	$(RUN_PERL) -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok
++	$(RUN_PERL) utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok
+ 
+ noknack:	utilities
+-	$(RUN_PERL) -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -A
++	$(RUN_PERL) utils/perlbug -nok -s '(UNINSTALLED)' -A
+ 
+ nokfilenack:	utilities
+-	$(RUN_PERL) -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok -A
++	$(RUN_PERL) utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok -A
+ 
+ .PHONY: clist hlist shlist
+ 
diff --git a/package/perl/perl.mk b/package/perl/perl.mk
new file mode 100644
index 0000000..f1859f0
--- /dev/null
+++ b/package/perl/perl.mk
@@ -0,0 +1,156 @@
+#############################################################
+#
+# perl
+#
+#############################################################
+
+PERL_VERSION_MAJOR = 16
+PERL_VERSION = 5.$(PERL_VERSION_MAJOR).1
+PERL_SITE = http://www.cpan.org/src/5.0
+PERL_SOURCE = perl-$(PERL_VERSION).tar.bz2
+PERL_LICENSE = Artistic
+PERL_LICENSE_FILES = Artistic
+PERL_DEPENDENCIES = host-perl
+PERL_INSTALL_STAGING = YES
+
+ifeq ($(shell expr $(PERL_VERSION_MAJOR) % 2), 1)
+PERL_USE_DEVEL=-Dusedevel
+endif
+
+# Host
+define HOST_PERL_CONFIGURE_CMDS
+	cd $(@D); ./Configure -des \
+		-Dcc="$(HOSTCC)" \
+		-Dprefix="$(HOST_DIR)/usr" \
+		$(PERL_USE_DEVEL) \
+		$(call qstrip,$(BR2_PACKAGE_PERL_CUSTOM_CONFIGURE))
+endef
+
+define HOST_PERL_BUILD_CMDS
+	$(MAKE) -C $(@D) all
+	$(HOST_PERL_MAKE_TEST)
+endef
+
+ifdef BR2_PACKAGE_PERL_TEST_HOST
+define HOST_PERL_MAKE_TEST
+	$(MAKE) -C $(@D) test
+endef
+endif
+
+define HOST_PERL_INSTALL_CMDS
+	$(MAKE) INSTALL_DEPENDENCE= \
+		-C $(@D) install
+	$(INSTALL) -m 755 $(@D)/miniperl $(HOST_DIR)/usr/bin/miniperl
+	$(INSTALL) -m 755 $(@D)/generate_uudmap $(HOST_DIR)/usr/bin/generate_uudmap
+endef
+
+define HOST_PERL_CLEAN_CMDS
+	-$(MAKE) -C $(@D) clean
+endef
+
+# Target
+PERL_ARCH=$(call qstrip,$(BR2_ARCH))
+ifeq ($(PERL_ARCH),i686)
+    PERL_ARCH=i386
+endif
+PERL_QEMU_USER_MODE=qemu-$(PERL_ARCH)
+
+define PERL_CONFIGURE_COMMON
+	rm -f $(@D)/config.sh
+	cd $(@D); ./Configure -des \
+		-Dusecrosscompile \
+		-Dtargetrun=$(PERL_QEMU_USER_MODE) \
+		-Dqemulib=$(TARGET_DIR) \
+		-Dtargethost=dummy \
+		-Dar="$(TARGET_AR)" \
+		-Dcc="$(TARGET_CC)" \
+		-Dcpp="$(TARGET_CC)" \
+		-Dld="$(TARGET_LD)" \
+		-Dnm="$(TARGET_NM)" \
+		-Dranlib="$(TARGET_RANLIB)" \
+		-Dccflags="$(TARGET_CFLAGS)" \
+		-Dldflags="$(TARGET_LDFLAGS) -l gcc_s" \
+		-Dlddlflags="-shared" \
+		-Dlibc=$(TARGET_HOST)/usr/$(GNU_TARGET_NAME)/sysroot/lib/libc.so \
+		-Duseshrplib \
+		-Dprefix=/usr \
+		-Uoptimize \
+		$(PERL_USE_DEVEL) \
+		$(call qstrip,$(BR2_PACKAGE_PERL_CUSTOM_CONFIGURE))
+	echo "# patched values"                 >>$(@D)/config.sh
+	$(SED) '/^myarchname=/d' \
+		-e '/^mydomain=/d' \
+		-e '/^myhostname=/d' \
+		-e '/^myuname=/d' \
+		-e '/^osname=/d' \
+		-e '/^osvers=/d' \
+		-e '/^perladmin=/d' \
+		-e '/^run=/d' \
+		$(@D)/config.sh
+	echo "myarchname='$(GNU_TARGET_NAME)'"                  >>$(@D)/config.sh
+	echo "mydomain=''"                                      >>$(@D)/config.sh
+	echo "myhostname='$(BR2_TARGET_GENERIC_HOSTNAME)'"      >>$(@D)/config.sh
+	echo "myuname='Buildroot $(BR2_VERSION_FULL)'"          >>$(@D)/config.sh
+	echo "osname='linux'"                                   >>$(@D)/config.sh
+	echo "osvers='$(BR2_LINUX_KERNEL_VERSION)'"             >>$(@D)/config.sh
+	echo "perladmin='root'"                                 >>$(@D)/config.sh
+	echo "run=''"                                           >>$(@D)/config.sh
+	cd $(@D); ./Configure -S
+	cp $(@D)/config.h $(@D)/xconfig.h
+endef
+
+define PERL_CONFIGURE_CMDS
+	$(PERL_CONFIGURE_COMMON)
+	cd $(@D); patch -p1 < Cross/Makefile-buildroot-SH.patch
+	$(INSTALL) -m 755 $(HOST_DIR)/usr/bin/miniperl $(@D)/miniperl
+	$(INSTALL) -m 755 $(HOST_DIR)/usr/bin/generate_uudmap $(@D)/generate_uudmap
+endef
+
+define PERL_BUILD_CMDS
+	$(MAKE) RUN_PERL=$(HOST_DIR)/usr/bin/perl \
+		-C $(@D) all
+endef
+
+define PERL_INSTALL_STAGING_CMDS
+	$(MAKE) INSTALL_DEPENDENCE= \
+		INSTALLFLAGS= \
+		RUN_PERL=$(HOST_DIR)/usr/bin/perl \
+		DESTDIR="$(STAGING_DIR)" \
+		-C $(@D) install.perl
+endef
+
+define PERL_INSTALL_TARGET_CMDS
+	$(MAKE) INSTALL_DEPENDENCE= \
+		INSTALLFLAGS=-p \
+		RUN_PERL=$(HOST_DIR)/usr/bin/perl \
+		DESTDIR="$(TARGET_DIR)" \
+		-C $(@D) install.perl
+	$(PERL_INSTALL_TESTSUITE)
+endef
+
+ifdef BR2_PACKAGE_PERL_INSTALL_TESTSUITE
+define PERL_INSTALL_TESTSUITE
+	$(INSTALL) -m644 -D $(@D)/MANIFEST $(TARGET_DIR)/root/perl/MANIFEST
+	$(SED)     '/^cpan\/CPAN/d' \
+		-e '/^cpan\/ExtUtils/d' \
+		-e '/^cpan\/Module-Build/d' \
+		-e '/^dist\/ExtUtils/d' \
+		-e '/^lib\/ExtUtils/d' \
+		$(TARGET_DIR)/root/perl/MANIFEST
+	$(INSTALL) -m644 -D $(@D)/TestInit.pm $(TARGET_DIR)/root/perl/TestInit.pm
+	cp -r $(@D)/cpan    $(TARGET_DIR)/root/perl/cpan
+	cp -r $(@D)/dist    $(TARGET_DIR)/root/perl/dist
+	cp -r $(@D)/ext     $(TARGET_DIR)/root/perl/ext
+	cp -r $(@D)/lib     $(TARGET_DIR)/root/perl/lib
+	cp -r $(@D)/regen   $(TARGET_DIR)/root/perl/regen
+	cp -r $(@D)/t       $(TARGET_DIR)/root/perl/t
+	rm -rf $(TARGET_DIR)/root/perl/t/porting
+endef
+endif
+
+define PERL_CLEAN_CMDS
+	-$(MAKE) -C $(@D) clean
+endef
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Buildroot] [PATCH 09/12] miniperl: new package
  2012-08-15 14:38 [Buildroot] [PATCH 01/12] microperl: add license info Francois Perrad
                   ` (6 preceding siblings ...)
  2012-08-15 14:38 ` [Buildroot] [PATCH 08/12] perl: new package Francois Perrad
@ 2012-08-15 14:38 ` Francois Perrad
  2012-08-15 14:38 ` [Buildroot] [PATCH 10/12] microperl: bump version to 5.16.1 Francois Perrad
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Francois Perrad @ 2012-08-15 14:38 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 package/Config.in                               |    1 +
 package/miniperl/Config.in                      |   18 ++++
 package/miniperl/miniperl-configure-qemu.patch  |   22 +++++
 package/miniperl/miniperl-fix-test.patch        |   30 ++++++
 package/miniperl/miniperl-generate-uudmap.patch |   20 ++++
 package/miniperl/miniperl-installperl.patch     |  116 +++++++++++++++++++++++
 package/miniperl/miniperl-make-ext.patch        |   17 ++++
 package/miniperl/miniperl-no-test.patch         |   19 ++++
 package/miniperl/miniperl-target-all.patch      |   17 ++++
 package/miniperl/miniperl.mk                    |   69 ++++++++++++++
 package/perl/Config.in                          |    4 +-
 package/perl/perl.mk                            |    4 +
 12 files changed, 336 insertions(+), 1 deletion(-)
 create mode 100644 package/miniperl/Config.in
 create mode 100644 package/miniperl/miniperl-configure-qemu.patch
 create mode 100644 package/miniperl/miniperl-fix-test.patch
 create mode 100644 package/miniperl/miniperl-generate-uudmap.patch
 create mode 100644 package/miniperl/miniperl-installperl.patch
 create mode 100644 package/miniperl/miniperl-make-ext.patch
 create mode 100644 package/miniperl/miniperl-no-test.patch
 create mode 100644 package/miniperl/miniperl-target-all.patch
 create mode 100644 package/miniperl/miniperl.mk

diff --git a/package/Config.in b/package/Config.in
index 00a79ab..1b8237d 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -263,6 +263,7 @@ source "package/xavante/Config.in"
 endmenu
 endif
 source "package/perl/Config.in"
+source "package/miniperl/Config.in"
 source "package/microperl/Config.in"
 source "package/php/Config.in"
 source "package/python/Config.in"
diff --git a/package/miniperl/Config.in b/package/miniperl/Config.in
new file mode 100644
index 0000000..437c358
--- /dev/null
+++ b/package/miniperl/Config.in
@@ -0,0 +1,18 @@
+config BR2_PACKAGE_MINIPERL
+	bool "miniperl"
+	help
+	  Perl without dynamic module loader.
+	  Usually used to bootstrap a full Perl (@INC contains only .).
+
+if BR2_PACKAGE_MINIPERL
+
+config BR2_PACKAGE_MINIPERL_INSTALL_TESTSUITE
+	bool "install testsuite"
+	help
+	  Install the test suite on target.
+		# cd /root/miniperl/t
+		# rm -f perl
+		# ln -s /usr/bin/miniperl perl
+		# ./perl TEST base/*.t comp/*.t cmd/*.t run/*.t io/*.t re/*.t op/*.t uni/*.t
+
+endif
diff --git a/package/miniperl/miniperl-configure-qemu.patch b/package/miniperl/miniperl-configure-qemu.patch
new file mode 100644
index 0000000..2d9c0dd
--- /dev/null
+++ b/package/miniperl/miniperl-configure-qemu.patch
@@ -0,0 +1,22 @@
+
+Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
+
+Index: b/Configure
+===================================================================
+--- a/Configure
++++ b/Configure
+@@ -2908,6 +2908,14 @@ fi
+ $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
+ EOF
+ 	    ;;
++	qemu*)
++	    targetto=cp
++	    targetfrom=cp
++	    cat >$run <<EOF
++#!/bin/sh
++$targetrun -L $qemulib $exe \$@
++EOF
++	    ;;
+ 	*)  echo "Unknown targetrun '$targetrun'" >&4
+ 	    exit 1
+ 	    ;;
diff --git a/package/miniperl/miniperl-fix-test.patch b/package/miniperl/miniperl-fix-test.patch
new file mode 100644
index 0000000..dbc127c
--- /dev/null
+++ b/package/miniperl/miniperl-fix-test.patch
@@ -0,0 +1,30 @@
+re is a XS module
+
+Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
+
+Index: b/lib/_charnames.pm
+===================================================================
+--- a/lib/_charnames.pm
++++ b/lib/_charnames.pm
+@@ -11,7 +11,7 @@
+ use unicore::Name;    # mktables-generated algorithmically-defined names
+ 
+ use bytes ();          # for $bytes::hint_bits
+-use re "/aa";          # Everything in here should be ASCII
++#use re "/aa";          # Everything in here should be ASCII
+ 
+ $Carp::Internal{ (__PACKAGE__) } = 1;
+ 
+Index: b/lib/charnames.pm
+===================================================================
+--- a/lib/charnames.pm
++++ b/lib/charnames.pm
+@@ -6,7 +6,7 @@ use unicore::Name;    # mktables-generated algorithmically-defined names
+ use _charnames ();    # The submodule for this where most of the work gets done
+ 
+ use bytes ();          # for $bytes::hint_bits
+-use re "/aa";          # Everything in here should be ASCII
++#use re "/aa";          # Everything in here should be ASCII
+ 
+ # Translate between Unicode character names and their code points.
+ # This is a wrapper around the submodule C<_charnames>.  This design allows
diff --git a/package/miniperl/miniperl-generate-uudmap.patch b/package/miniperl/miniperl-generate-uudmap.patch
new file mode 100644
index 0000000..2ffea87
--- /dev/null
+++ b/package/miniperl/miniperl-generate-uudmap.patch
@@ -0,0 +1,20 @@
+allows to overload GENERATE_UUDMAP with a host executable
+
+Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
+
+Index: b/Makefile.SH
+===================================================================
+--- a/Makefile.SH
++++ b/Makefile.SH
+@@ -651,8 +651,10 @@
+ 
+ uudmap.h mg_data.h: bitcount.h
+ 
++RUN_GENERATE_UUDMAP = $(RUN) ./generate_uudmap$(HOST_EXE_EXT)
++
+ bitcount.h: generate_uudmap$(HOST_EXE_EXT)
+-	$(RUN) ./generate_uudmap$(HOST_EXE_EXT) $(generated_headers)
++	$(RUN_GENERATE_UUDMAP) $(generated_headers)
+ 
+ generate_uudmap$(OBJ_EXT): mg_raw.h
+ 
diff --git a/package/miniperl/miniperl-installperl.patch b/package/miniperl/miniperl-installperl.patch
new file mode 100644
index 0000000..a74d950
--- /dev/null
+++ b/package/miniperl/miniperl-installperl.patch
@@ -0,0 +1,116 @@
+
+Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
+
+Index: b/installperl
+===================================================================
+--- a/installperl
++++ b/installperl
+@@ -3,11 +3,17 @@
+ BEGIN {
+     require 5.004;
+     chdir '..' if !-d 'lib' and -d '../lib';
++
++    my @sav = @INC;
++    my $sav = $ENV{PERL5LIB};
+     @INC = 'lib';
+     $ENV{PERL5LIB} = 'lib';
+ 
+     # This needs to be at BEGIN time, before any use of Config
+     require './install_lib.pl';
++
++    @INC = @sav;
++    $ENV{PERL5LIB} = $sav;
+ }
+ 
+ use strict;
+@@ -118,19 +118,19 @@
+ 
+ $versiononly = 1 if $Config{versiononly} && !defined $versiononly;
+ my (@scripts, @tolink);
+-open SCRIPTS, "utils.lst" or die "Can't open utils.lst: $!";
+-while (<SCRIPTS>) {
+-    next if /^#/;
+-    next if /a2p/; # a2p is binary, to be installed separately
+-    chomp;
+-    if (/(\S*)\s*#\s*link\s*=\s*(\S*)/) {
+-	push @scripts, $1;
+-	push @tolink, [$1, $2];
+-    } else {
+-	push @scripts, $_;
+-    }
+-}
+-close SCRIPTS;
++#open SCRIPTS, "utils.lst" or die "Can't open utils.lst: $!";
++#while (<SCRIPTS>) {
++#    next if /^#/;
++#    next if /a2p/; # a2p is binary, to be installed separately
++#    chomp;
++#    if (/(\S*)\s*#\s*link\s*=\s*(\S*)/) {
++#	push @scripts, $1;
++#	push @tolink, [$1, $2];
++#    } else {
++#	push @scripts, $_;
++#    }
++#}
++#close SCRIPTS;
+ 
+ if ($scr_ext) { @scripts = map { "$_$scr_ext" } @scripts; }
+ 
+@@ -247,7 +247,7 @@
+ 
+ if (!$Is_NetWare) {
+ if (!$Is_VMS) {
+--x 'perl' . $exe_ext	|| die "perl isn't executable!\n";
++-x 'miniperl' . $exe_ext	|| die "miniperl isn't executable!\n";
+ }
+ else {
+ -x $ndbg . 'perl' . $exe_ext	|| die "${ndbg}perl$exe_ext isn't executable!\n";
+@@ -363,7 +363,7 @@
+ }
+ 
+ # Install header files and libraries.
+-mkpath("$installarchlib/CORE", $opts{verbose}, 0777);
++#mkpath("$installarchlib/CORE", $opts{verbose}, 0777);
+ my @corefiles;
+ if ($Is_VMS) {  # We did core file selection during build
+     my $coredir = "lib/$Config{archname}/$ver/CORE";
+@@ -401,18 +401,18 @@
+ 	push(@corefiles,'mpeix/mpeixish.h');
+     }
+ }
+-foreach my $file (@corefiles) {
+-    # 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")) {
+-	if ($file =~ /\.(\Q$so\E|\Q$dlext\E)$/) {
+-	    strip("-S", "$installarchlib/CORE/$file") if $^O =~ /^(rhapsody|darwin)$/;
+-	    chmod(0555, "$installarchlib/CORE/$file");
+-	} else {
+-	    chmod(0444, "$installarchlib/CORE/$file");
+-	}
+-    }
+-}
++#foreach my $file (@corefiles) {
++#    # 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")) {
++#	if ($file =~ /\.(\Q$so\E|\Q$dlext\E)$/) {
++#	    strip("-S", "$installarchlib/CORE/$file") if $^O =~ /^(rhapsody|darwin)$/;
++#	    chmod(0555, "$installarchlib/CORE/$file");
++#	} else {
++#	    chmod(0444, "$installarchlib/CORE/$file");
++#	}
++#    }
++#}
+ 
+ # Install main perl executables
+ # Make links to ordinary names if installbin directory isn't current directory.
+@@ -773,7 +773,7 @@
+ 	  ($name =~ /^(.*)\.(?:h|lib)$/i && ($Is_W32 || $Is_NetWare)) ||
+ 	  $name=~/^Config_(heavy|git)\.pl\z/
+        ) {
+-	$installlib = $installarchlib;
++#	$installlib = $installarchlib;
+ 	return unless $do_installarchlib;
+     } else {
+ 	return unless $do_installprivlib;
diff --git a/package/miniperl/miniperl-make-ext.patch b/package/miniperl/miniperl-make-ext.patch
new file mode 100644
index 0000000..f237c04
--- /dev/null
+++ b/package/miniperl/miniperl-make-ext.patch
@@ -0,0 +1,17 @@
+
+Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
+
+Index: b/make_ext.pl
+===================================================================
+--- a/make_ext.pl
++++ b/make_ext.pl
+@@ -271,7 +271,8 @@ sub build_extension {
+     my $up = $ext_dir;
+     $up =~ s![^/]+!..!g;
+ 
+-    $perl ||= "$up/miniperl";
++    my @miniperl = split ' ', $ENV{MINIPERL};
++    $perl ||= $miniperl[-2];
+     my $return_dir = $up;
+     my $lib_dir = "$up/lib";
+     $ENV{PERL_CORE} = 1;
diff --git a/package/miniperl/miniperl-no-test.patch b/package/miniperl/miniperl-no-test.patch
new file mode 100644
index 0000000..e00ef05
--- /dev/null
+++ b/package/miniperl/miniperl-no-test.patch
@@ -0,0 +1,19 @@
+cannot run test on host
+
+Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
+
+Index: b/Makefile.SH
+===================================================================
+--- a/Makefile.SH
++++ b/Makefile.SH
+--- a/Makefile.SH
++++ b/Makefile.SH
+@@ -873,7 +873,7 @@
+ 	- at rm -f miniperl.xok
+ 	$(LDLIBPTH) $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
+ 	    $(mini_obj) $(libs)
+-	$(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
++#	$(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
+ !NO!SUBS!
+ 		;;
+ 	esac
diff --git a/package/miniperl/miniperl-target-all.patch b/package/miniperl/miniperl-target-all.patch
new file mode 100644
index 0000000..4c2f6ca
--- /dev/null
+++ b/package/miniperl/miniperl-target-all.patch
@@ -0,0 +1,17 @@
+
+Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
+
+Index: b/Makefile.SH
+===================================================================
+--- a/Makefile.SH
++++ b/Makefile.SH
+@@ -555,7 +555,8 @@
+ .c.s:
+ 	$(CCCMDSRC) -S $*.c
+ 
+-all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) $(generated_pods) $(private) $(unidatafiles) $(public) $(dynamic_ext) $(nonxs_ext) extras.make
++#all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) $(generated_pods) $(private) $(unidatafiles) $(public) $(dynamic_ext) $(nonxs_ext) extras.make
++all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) $(private) $(unidatafiles) $(nonxs_ext)
+ 	@echo " ";
+ 	@echo "	Everything is up to date. Type '$(MAKE) test' to run test suite."
+ 
diff --git a/package/miniperl/miniperl.mk b/package/miniperl/miniperl.mk
new file mode 100644
index 0000000..ae807bd
--- /dev/null
+++ b/package/miniperl/miniperl.mk
@@ -0,0 +1,69 @@
+#############################################################
+#
+# miniperl
+#
+#############################################################
+
+MINIPERL_VERSION = 5.16.1
+MINIPERL_SITE = http://www.cpan.org/src/5.0
+MINIPERL_SOURCE = perl-$(MINIPERL_VERSION).tar.bz2
+MINIPERL_LICENSE = Artistic
+MINIPERL_LICENSE_FILES = Artistic
+MINIPERL_DEPENDENCIES = host-perl
+
+define MINIPERL_CONFIGURE_CMDS
+	$(PERL_CONFIGURE_COMMON)
+	$(SED) 's/UNKNOWN-/Buildroot $(BR2_VERSION_FULL) /' $(@D)/patchlevel.h
+endef
+
+define MINIPERL_BUILD_CMDS
+	$(MAKE) RUN_GENERATE_UUDMAP=$(HOST_DIR)/usr/bin/generate_uudmap \
+		MINIPERL="$(HOST_DIR)/usr/bin/perl -Ilib" \
+		RUN_PERL=$(HOST_DIR)/usr/bin/perl \
+		-C $(@D) all
+endef
+
+define MINIPERL_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 755 $(@D)/miniperl $(TARGET_DIR)/usr/bin/miniperl
+	$(MAKE) INSTALL_DEPENDENCE= \
+		INSTALLFLAGS=-p \
+		RUN_PERL=$(HOST_DIR)/usr/bin/perl \
+		DESTDIR="$(TARGET_DIR)" \
+		-C $(@D) install.perl
+	# File::Spec is a pure module but packaged in a XS module
+	$(INSTALL) -m644 -D $(@D)/dist/Cwd/lib/File/Spec.pm             $(TARGET_DIR)/usr/lib/perl5/$(MINIPERL_VERSION)/File/Spec.pm
+	$(INSTALL) -m644 -D $(@D)/dist/Cwd/lib/File/Spec/Functions.pm   $(TARGET_DIR)/usr/lib/perl5/$(MINIPERL_VERSION)/File/Spec/Functions.pm
+	$(INSTALL) -m644 -D $(@D)/dist/Cwd/lib/File/Spec/Unix.pm        $(TARGET_DIR)/usr/lib/perl5/$(MINIPERL_VERSION)/File/Spec/Unix.pm
+	$(MINIPERL_INSTALL_TESTSUITE)
+endef
+
+ifdef BR2_PACKAGE_MINIPERL_INSTALL_TESTSUITE
+define MINIPERL_INSTALL_TESTSUITE
+	$(INSTALL) -m644 -D $(@D)/MANIFEST              $(TARGET_DIR)/root/miniperl/MANIFEST
+	$(INSTALL) -m644 -D $(@D)/t/TEST                $(TARGET_DIR)/root/miniperl/t/TEST
+	$(INSTALL) -m644 -D $(@D)/t/harness             $(TARGET_DIR)/root/miniperl/t/harness
+	$(INSTALL) -m644 -D $(@D)/t/test.pl             $(TARGET_DIR)/root/miniperl/t/test.pl
+	$(INSTALL) -m644 -D $(@D)/t/thread_it.pl        $(TARGET_DIR)/root/miniperl/t/thread_it.pl
+	cp -r $(@D)/lib         $(TARGET_DIR)/root/miniperl/lib
+	cp -r $(@D)/t/base      $(TARGET_DIR)/root/miniperl/t/base
+	cp -r $(@D)/t/comp      $(TARGET_DIR)/root/miniperl/t/comp
+	cp -r $(@D)/t/cmd       $(TARGET_DIR)/root/miniperl/t/cmd
+	cp -r $(@D)/t/run       $(TARGET_DIR)/root/miniperl/t/run
+	cp -r $(@D)/t/io        $(TARGET_DIR)/root/miniperl/t/io
+	cp -r $(@D)/t/lib       $(TARGET_DIR)/root/miniperl/t/lib
+	cp -r $(@D)/t/re        $(TARGET_DIR)/root/miniperl/t/re
+	cp -r $(@D)/t/op        $(TARGET_DIR)/root/miniperl/t/op
+	cp -r $(@D)/t/uni       $(TARGET_DIR)/root/miniperl/t/uni
+	echo "BEGIN { chdir 't' if -d 't'; @INC = ('../lib', '.'); } 1;" > $(TARGET_DIR)/root/miniperl/TestInit.pm
+	# File::Spec is a pure module but packaged in a XS module
+	$(INSTALL) -m644 -D $(@D)/dist/Cwd/lib/File/Spec.pm             $(TARGET_DIR)/root/miniperl/lib/File/Spec.pm
+	$(INSTALL) -m644 -D $(@D)/dist/Cwd/lib/File/Spec/Functions.pm   $(TARGET_DIR)/root/miniperl/lib/File/Spec/Functions.pm
+	$(INSTALL) -m644 -D $(@D)/dist/Cwd/lib/File/Spec/Unix.pm        $(TARGET_DIR)/root/miniperl/lib/File/Spec/Unix.pm
+endef
+endif
+
+define MINIPERL_CLEAN_CMDS
+	-$(MAKE) -C $(@D) clean
+endef
+
+$(eval $(generic-package))
diff --git a/package/perl/Config.in b/package/perl/Config.in
index 4b52e96..06b31d4 100644
--- a/package/perl/Config.in
+++ b/package/perl/Config.in
@@ -7,13 +7,15 @@ config BR2_PACKAGE_PERL
 
 	  http://www.perl.org/
 
-if BR2_PACKAGE_PERL
 
 config BR2_PACKAGE_PERL_CUSTOM_CONFIGURE
 	string "configuration flags"
+	depends on BR2_PACKAGE_PERL || BR2_PACKAGE_MINIPERL
 	help
 	  Allows to add some flags to Configure.
 
+if BR2_PACKAGE_PERL
+
 config BR2_PACKAGE_PERL_TEST_HOST
 	bool "test host"
 	help
diff --git a/package/perl/perl.mk b/package/perl/perl.mk
index f1859f0..9fcba89 100644
--- a/package/perl/perl.mk
+++ b/package/perl/perl.mk
@@ -17,6 +17,10 @@ ifeq ($(shell expr $(PERL_VERSION_MAJOR) % 2), 1)
 PERL_USE_DEVEL=-Dusedevel
 endif
 
+ifneq ($(MINIPERL_VERSION), $(PERL_VERSION))
+$(error "MINIPERL_VERSION must be aligned with PERL_VERSION")
+endif
+
 # Host
 define HOST_PERL_CONFIGURE_CMDS
 	cd $(@D); ./Configure -des \
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Buildroot] [PATCH 10/12] microperl: bump version to 5.16.1
  2012-08-15 14:38 [Buildroot] [PATCH 01/12] microperl: add license info Francois Perrad
                   ` (7 preceding siblings ...)
  2012-08-15 14:38 ` [Buildroot] [PATCH 09/12] miniperl: " Francois Perrad
@ 2012-08-15 14:38 ` Francois Perrad
  2012-08-15 14:38 ` [Buildroot] [PATCH 11/12] microperl: remove host-microperl Francois Perrad
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Francois Perrad @ 2012-08-15 14:38 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 package/microperl/microperl-fix-build.patch |   76 +++++++++++++++++++++++++++
 package/microperl/microperl.mk              |    8 +--
 2 files changed, 80 insertions(+), 4 deletions(-)
 create mode 100644 package/microperl/microperl-fix-build.patch

diff --git a/package/microperl/microperl-fix-build.patch b/package/microperl/microperl-fix-build.patch
new file mode 100644
index 0000000..fe01395
--- /dev/null
+++ b/package/microperl/microperl-fix-build.patch
@@ -0,0 +1,76 @@
+Backport of http://perl5.git.perl.org/perl.git/commitdiff/d40eae8f110fb9900e82648a2c44710def9f117d
+
+Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
+
+From: Nicholas Clark <nick@ccl4.org>
+Date: Fri, 27 Jul 2012 17:36:40 +0200
+Subject: [PATCH] Restore microperl, which has been unable to build since January.
+
+microperl was broken by commit 82ad65bb0613be64 on 2012-01-16, which used
+IN_LOCALE_COMPILETIME for the first time in the C code. Unlike
+IN_LOCALE_RUNTIME, it had no fallback definition for microperl.
+
+Commit f90a9a0230170cc0 on 2012-01-28 added the first use of Strtol(),
+which means that microperl now needs to assume that the system has strtol().
+(Which is not unreasonable, as it's part of C89).
+---
+ perl.h       |    1 +
+ uconfig.h    |    2 +-
+ uconfig.sh   |    2 +-
+ uconfig64.sh |    2 +-
+ 4 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/perl.h b/perl.h
+index e532af2..9e92ae4 100644
+--- a/perl.h
++++ b/perl.h
+@@ -5311,6 +5311,7 @@ typedef struct am_table_short AMTS;
+ #define RESTORE_NUMERIC_STANDARD()	/**/
+ #define Atof				my_atof
+ #define IN_LOCALE_RUNTIME		0
++#define IN_LOCALE_COMPILETIME		0
+ 
+ #endif /* !USE_LOCALE_NUMERIC */
+ 
+diff --git a/uconfig.h b/uconfig.h
+index 20b1f23..60c7ca7 100644
+--- a/uconfig.h
++++ b/uconfig.h
+@@ -527,7 +527,7 @@
+  *	This symbol, if defined, indicates that the strtol routine is available
+  *	to provide better numeric string conversion than atoi() and friends.
+  */
+-/*#define HAS_STRTOL	/ **/
++#define HAS_STRTOL	/**/
+ 
+ /* HAS_STRXFRM:
+  *	This symbol, if defined, indicates that the strxfrm() routine is
+diff --git a/uconfig.sh b/uconfig.sh
+index e96b7e8..d761d5c 100644
+--- a/uconfig.sh
++++ b/uconfig.sh
+@@ -424,7 +424,7 @@ d_strftime='undef'
+ d_strlcat='undef'
+ d_strlcpy='undef'
+ d_strtod='undef'
+-d_strtol='undef'
++d_strtol='define'
+ d_strtold='undef'
+ d_strtoll='undef'
+ d_strtoq='undef'
+diff --git a/uconfig64.sh b/uconfig64.sh
+index 80e6f7f..f57c979 100644
+--- a/uconfig64.sh
++++ b/uconfig64.sh
+@@ -425,7 +425,7 @@ d_strftime='undef'
+ d_strlcat='undef'
+ d_strlcpy='undef'
+ d_strtod='undef'
+-d_strtol='undef'
++d_strtol='define'
+ d_strtold='undef'
+ d_strtoll='undef'
+ d_strtoq='undef'
+-- 
+1.7.9.5
+
diff --git a/package/microperl/microperl.mk b/package/microperl/microperl.mk
index aaa47be..e4846b4 100644
--- a/package/microperl/microperl.mk
+++ b/package/microperl/microperl.mk
@@ -4,8 +4,8 @@
 #
 #############################################################
 
-MICROPERL_VERSION_MAJOR = 14
-MICROPERL_VERSION = 5.$(MICROPERL_VERSION_MAJOR).2
+MICROPERL_VERSION_MAJOR = 16
+MICROPERL_VERSION = 5.$(MICROPERL_VERSION_MAJOR).1
 MICROPERL_SITE = http://www.cpan.org/src/5.0
 MICROPERL_SOURCE = perl-$(MICROPERL_VERSION).tar.bz2
 MICROPERL_LICENSE = Artistic
@@ -50,7 +50,6 @@ MICROPERL_BASE_MODS += \
 # some common modules (from lib/)
 MICROPERL_BASE_MODS += \
   Benchmark.pm \
-  Carp.pm \
   Class/Struct.pm \
   Exporter.pm Exporter/Heavy.pm \
   File/Basename.pm \
@@ -63,6 +62,7 @@ MICROPERL_BASE_MODS += \
 
 # other common modules (from dist/)
 MICROPERL_MODS += \
+  Carp.pm \
   Dumpvalue.pm \
   Env.pm \
   autouse.pm \
@@ -155,7 +155,7 @@ endef
 
 define MICROPERL_BUILD_CMDS
 	$(MAKE) -f Makefile.micro -C $(@D) \
-		CC="$(HOSTCC)" bitcount.h
+		CC="$(HOSTCC)" ubitcount.h
 	$(MAKE) -f Makefile.micro -C $(@D) \
 		CC="$(TARGET_CC)" OPTIMIZE="$(TARGET_CFLAGS)"
 	$(MICROPERL_BUILD_EXTENSIONS)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Buildroot] [PATCH 11/12] microperl: remove host-microperl
  2012-08-15 14:38 [Buildroot] [PATCH 01/12] microperl: add license info Francois Perrad
                   ` (8 preceding siblings ...)
  2012-08-15 14:38 ` [Buildroot] [PATCH 10/12] microperl: bump version to 5.16.1 Francois Perrad
@ 2012-08-15 14:38 ` Francois Perrad
  2012-08-15 14:38 ` [Buildroot] [PATCH 12/12] cpanminus: new package Francois Perrad
  2012-08-15 16:07 ` [Buildroot] [PATCH 01/12] microperl: add license info Thomas Petazzoni
  11 siblings, 0 replies; 16+ messages in thread
From: Francois Perrad @ 2012-08-15 14:38 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 package/microperl/microperl.mk |   18 +-----------------
 package/perl/perl.mk           |    3 +++
 2 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/package/microperl/microperl.mk b/package/microperl/microperl.mk
index e4846b4..f130666 100644
--- a/package/microperl/microperl.mk
+++ b/package/microperl/microperl.mk
@@ -10,7 +10,7 @@ MICROPERL_SITE = http://www.cpan.org/src/5.0
 MICROPERL_SOURCE = perl-$(MICROPERL_VERSION).tar.bz2
 MICROPERL_LICENSE = Artistic
 MICROPERL_LICENSE_FILES = Artistic
-MICROPERL_DEPENDENCIES = host-microperl
+MICROPERL_DEPENDENCIES = host-perl
 MICROPERL_MODS_DIR = /usr/lib/perl5/$(MICROPERL_VERSION)
 MICROPERL_ARCH_DIR = $(MICROPERL_MODS_DIR)/$(GNU_TARGET_NAME)
 MICROPERL_MODS = $(call qstrip,$(BR2_PACKAGE_MICROPERL_MODULES))
@@ -79,21 +79,6 @@ ifeq ($(BR2_PACKAGE_MICROPERL_BUNDLE_CGI),y)
 MICROPERL_MODS += CGI CGI.pm
 endif
 
-# Host microperl is actually full-blown perl
-define HOST_MICROPERL_CONFIGURE_CMDS
-	cd $(@D) ; \
-	./Configure -Dcc="$(HOSTCC)" -Dprefix="$(HOST_DIR)/usr" \
-		-Dloclibpth='/lib /lib64 /usr/lib /usr/lib64' -des
-endef
-
-define HOST_MICROPERL_BUILD_CMDS
-	$(MAKE) -C $(@D)
-endef
-
-define HOST_MICROPERL_INSTALL_CMDS
-	$(MAKE) -C $(@D) install
-endef
-
 ifeq ($(BR2_ENDIAN),"BIG")
 define MICROPERL_BIGENDIAN
 	$(SED) '/^byteorder=/d' $(MICROPERL_UCONFIG_SH)
@@ -218,4 +203,3 @@ define MICROPERL_UNINSTALL_TARGET_CMDS
 endef
 
 $(eval $(generic-package))
-$(eval $(host-generic-package))
diff --git a/package/perl/perl.mk b/package/perl/perl.mk
index 9fcba89..a7b94e0 100644
--- a/package/perl/perl.mk
+++ b/package/perl/perl.mk
@@ -20,6 +20,9 @@ endif
 ifneq ($(MINIPERL_VERSION), $(PERL_VERSION))
 $(error "MINIPERL_VERSION must be aligned with PERL_VERSION")
 endif
+ifneq ($(MICROPERL_VERSION), $(PERL_VERSION))
+$(error "MICROPERL_VERSION must be aligned with PERL_VERSION")
+endif
 
 # Host
 define HOST_PERL_CONFIGURE_CMDS
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Buildroot] [PATCH 12/12] cpanminus: new package
  2012-08-15 14:38 [Buildroot] [PATCH 01/12] microperl: add license info Francois Perrad
                   ` (9 preceding siblings ...)
  2012-08-15 14:38 ` [Buildroot] [PATCH 11/12] microperl: remove host-microperl Francois Perrad
@ 2012-08-15 14:38 ` Francois Perrad
  2012-08-15 16:07 ` [Buildroot] [PATCH 01/12] microperl: add license info Thomas Petazzoni
  11 siblings, 0 replies; 16+ messages in thread
From: Francois Perrad @ 2012-08-15 14:38 UTC (permalink / raw)
  To: buildroot

and adjust sitelib in perl & microperl

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 package/Config.in              |    5 +++++
 package/cpanminus/Config.in    |   24 ++++++++++++++++++++++++
 package/cpanminus/cpanminus.mk |   37 +++++++++++++++++++++++++++++++++++++
 package/microperl/microperl.mk |    5 ++++-
 package/perl/perl.mk           |   12 ++++++++++++
 5 files changed, 82 insertions(+), 1 deletion(-)
 create mode 100644 package/cpanminus/Config.in
 create mode 100644 package/cpanminus/cpanminus.mk

diff --git a/package/Config.in b/package/Config.in
index 1b8237d..986fc89 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -263,6 +263,11 @@ source "package/xavante/Config.in"
 endmenu
 endif
 source "package/perl/Config.in"
+if BR2_PACKAGE_PERL || BR2_PACKAGE_MINIPERL || BR2_PACKAGE_MICROPERL
+menu "Perl libraries/modules"
+source "package/cpanminus/Config.in"
+endmenu
+endif
 source "package/miniperl/Config.in"
 source "package/microperl/Config.in"
 source "package/php/Config.in"
diff --git a/package/cpanminus/Config.in b/package/cpanminus/Config.in
new file mode 100644
index 0000000..9db7b2e
--- /dev/null
+++ b/package/cpanminus/Config.in
@@ -0,0 +1,24 @@
+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.
+	  cpanm run on host, so you cannot use it for XS modules.
+
+endif
diff --git a/package/cpanminus/cpanminus.mk b/package/cpanminus/cpanminus.mk
new file mode 100644
index 0000000..6df9f73
--- /dev/null
+++ b/package/cpanminus/cpanminus.mk
@@ -0,0 +1,37 @@
+#############################################################
+#
+# cpanminus
+#
+#############################################################
+
+CPANMINUS_VERSION = 1.5017
+CPANMINUS_SITE = http://search.cpan.org/CPAN/authors/id/M/MI/MIYAGAWA
+CPANMINUS_SOURCE = App-cpanminus-$(CPANMINUS_VERSION).tar.gz
+CPANMINUS_DEPENDENCIES = host-perl host-cpanminus
+CPANMINUS_MODS = $(call qstrip,$(BR2_PACKAGE_CPANMINUS_MODULES))
+
+define HOST_CPANMINUS_CONFIGURE_CMDS
+	cd $(@D); $(HOST_DIR)/usr/bin/perl Makefile.PL
+endef
+
+define HOST_CPANMINUS_INSTALL_CMDS
+	$(MAKE) -C $(@D) install
+endef
+
+define CPANMINUS_INSTALL_TARGET_CMDS
+	for i in $(CPANMINUS_MODS); do \
+		cd $(@D); $(HOST_DIR)/usr/bin/cpanm -L $(TARGET_DIR)/usr/local $$i; \
+	done
+	# show XS modules
+	find $(TARGET_DIR)/usr/local/lib/perl5 -name *.so -print
+	# remove XS modules
+	rm -Rf $(TARGET_DIR)/usr/local/lib/perl5/$(shell $(HOST_DIR)/usr/bin/perl -MConfig -e "print Config->{archname}")
+	# fix shebang
+	touch $(TARGET_DIR)/usr/local/bin/dummy
+	for i in $(TARGET_DIR)/usr/local/bin/*; do \
+		$(SED) 's/$(subst /,\/,$(HOST_DIR))//' $$i; \
+	done
+endef
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))
diff --git a/package/microperl/microperl.mk b/package/microperl/microperl.mk
index f130666..544702f 100644
--- a/package/microperl/microperl.mk
+++ b/package/microperl/microperl.mk
@@ -108,11 +108,15 @@ define MICROPERL_CONFIGURE_CMDS
 	$(SED) '/^archlib=/d' -e '/^archlibexp=/d' -e '/^optimize=/d' \
 		-e '/^archname=/d' -e '/^d_poll=/d' -e '/^i_poll=/d' \
 		-e '/^osname=/d' -e '/^d_archlib=/d' -e '/^i_fcntl=/d' \
+		-e '/^sitelib=/d' -e '/^sitelibexp=/d' \
 		-e '/^useperlio=/d' $(MICROPERL_UCONFIG_SH)
 	$(SED) 's/5\.$(MICROPERL_VERSION_MAJOR)/$(MICROPERL_VERSION)/' $(MICROPERL_UCONFIG_SH)
+	$(SED) 's/local\///' $(MICROPERL_UCONFIG_SH)
 	echo "archlib='$(MICROPERL_ARCH_DIR)'" >>$(MICROPERL_UCONFIG_SH)
 	echo "archlibexp='$(MICROPERL_ARCH_DIR)'" >>$(MICROPERL_UCONFIG_SH)
 	echo "d_archlib='define'" >>$(MICROPERL_UCONFIG_SH)
+	echo "sitelib='/usr/local/lib/perl5'" >>$(MICROPERL_UCONFIG_SH)
+	echo "sitelibexp='/usr/local/lib/perl5'" >>$(MICROPERL_UCONFIG_SH)
 	echo "archname='$(GNU_TARGET_NAME)'" >>$(MICROPERL_UCONFIG_SH)
 	echo "osname='linux'" >>$(MICROPERL_UCONFIG_SH)
 	echo "cc='$(TARGET_CC)'" >>$(MICROPERL_UCONFIG_SH)
@@ -126,7 +130,6 @@ define MICROPERL_CONFIGURE_CMDS
 	$(MICROPERL_BIGENDIAN)
 	$(MICROPERL_LARGEFILE)
 	$(MICROPERL_WCHAR)
-	$(SED) 's/local\///' $(MICROPERL_UCONFIG_SH)
 	$(SED) 's/UNKNOWN-/Buildroot $(BR2_VERSION_FULL) /' $(@D)/patchlevel.h
 	$(MICROPERL_REGEN_CONFIG)
 	cp -f $(@D)/uconfig.h $(@D)/config.h
diff --git a/package/perl/perl.mk b/package/perl/perl.mk
index a7b94e0..dc67dd0 100644
--- a/package/perl/perl.mk
+++ b/package/perl/perl.mk
@@ -81,6 +81,7 @@ define PERL_CONFIGURE_COMMON
 		-Dlibc=$(TARGET_HOST)/usr/$(GNU_TARGET_NAME)/sysroot/lib/libc.so \
 		-Duseshrplib \
 		-Dprefix=/usr \
+		-Dsitelib=/usr/local/lib/perl5 \
 		-Uoptimize \
 		$(PERL_USE_DEVEL) \
 		$(call qstrip,$(BR2_PACKAGE_PERL_CUSTOM_CONFIGURE))
@@ -113,9 +114,20 @@ define PERL_CONFIGURE_CMDS
 	$(INSTALL) -m 755 $(HOST_DIR)/usr/bin/generate_uudmap $(@D)/generate_uudmap
 endef
 
+# example of hack for XS module (cpanminus handles only pure Perl modules)
+#define PERL_HACK_4_XS_MODULES
+#	cd $(@D)/cpan; tar xfz $(BUILDROOT_DL_DIR)/HTML-Parser-3.69.tar.gz
+#endef
+
+PERL_PRE_CONFIGURE_HOOKS += PERL_HACK_4_XS_MODULES
+
 define PERL_BUILD_CMDS
 	$(MAKE) RUN_PERL=$(HOST_DIR)/usr/bin/perl \
 		-C $(@D) all
+# example of hack for XS module
+#	cd $(@D); \
+#		$(HOST_DIR)/usr/bin/perl -Ilib make_ext.pl MAKE="$(MAKE)" LIBPERL_A=libperl.a LINKTYPE=dynamic \
+#			HTML-Parser-3.69
 endef
 
 define PERL_INSTALL_STAGING_CMDS
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [Buildroot] [PATCH 01/12] microperl: add license info
  2012-08-15 14:38 [Buildroot] [PATCH 01/12] microperl: add license info Francois Perrad
                   ` (10 preceding siblings ...)
  2012-08-15 14:38 ` [Buildroot] [PATCH 12/12] cpanminus: new package Francois Perrad
@ 2012-08-15 16:07 ` Thomas Petazzoni
  11 siblings, 0 replies; 16+ messages in thread
From: Thomas Petazzoni @ 2012-08-15 16:07 UTC (permalink / raw)
  To: buildroot

Le Wed, 15 Aug 2012 16:38:23 +0200,
Francois Perrad <fperrad@gmail.com> a ?crit :

> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>

Applied to next, thanks!

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Buildroot] [PATCH 02/12] microperl: how to test it ?
  2012-08-15 14:38 ` [Buildroot] [PATCH 02/12] microperl: how to test it ? Francois Perrad
@ 2012-08-15 16:08   ` Thomas Petazzoni
  2012-08-16  7:50     ` François Perrad
  0 siblings, 1 reply; 16+ messages in thread
From: Thomas Petazzoni @ 2012-08-15 16:08 UTC (permalink / raw)
  To: buildroot

Le Wed, 15 Aug 2012 16:38:24 +0200,
Francois Perrad <fperrad@gmail.com> a ?crit :

> +ifdef BR2_PACKAGE_MICROPERL_INSTALL_TESTSUITE
> +define MICROPERL_INSTALL_TESTSUITE
> +	$(INSTALL) -m644 -D $(@D)/t/TEST                $(TARGET_DIR)/root/microperl/t/TEST

Isn't this one a script that should be installed 755?

> +	$(INSTALL) -m644 -D $(@D)/t/harness             $(TARGET_DIR)/root/microperl/t/harness
> +	cp -r $(@D)/lib         $(TARGET_DIR)/root/microperl/lib
> +	cp -r $(@D)/t/base      $(TARGET_DIR)/root/microperl/t/base
> +	cp -r $(@D)/t/cmd       $(TARGET_DIR)/root/microperl/t/cmd

Is /root/ really the right place to install this? Isn't
some /usr/share/perl/ or /usr/lib/perl/ a better place?

> +	echo "BEGIN { chdir 't' if -d 't'; @INC = ('../lib', '.'); } 1;" > $(TARGET_DIR)/root/microperl/TestInit.pm

I think I would prefer a TestInit.pm file added in package/microperl/
rather than echo'ing it here.

Thanks!

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Buildroot] [PATCH 02/12] microperl: how to test it ?
  2012-08-15 16:08   ` Thomas Petazzoni
@ 2012-08-16  7:50     ` François Perrad
  2012-08-20  7:28       ` François Perrad
  0 siblings, 1 reply; 16+ messages in thread
From: François Perrad @ 2012-08-16  7:50 UTC (permalink / raw)
  To: buildroot

rem1: microperl is not fully supported by the Perl community.
the build in Perl 5.16 serie is broken, see
http://www.nntp.perl.org/group/perl.perl5.porters/2012/08/msg190323.html
people ask about its interest, see
http://www.nntp.perl.org/group/perl.perl5.porters/2012/08/msg190422.html

rem2: in this commit, I introduce a testing scheme, and I reuse it for
perl & miniperl packages.
I want a reproducible and documented recipe for run the
perl/miniperl/microerl test suite.

2012/8/15 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>:
> Le Wed, 15 Aug 2012 16:38:24 +0200,
> Francois Perrad <fperrad@gmail.com> a ?crit :
>
>> +ifdef BR2_PACKAGE_MICROPERL_INSTALL_TESTSUITE
>> +define MICROPERL_INSTALL_TESTSUITE
>> +     $(INSTALL) -m644 -D $(@D)/t/TEST                $(TARGET_DIR)/root/microperl/t/TEST
>
> Isn't this one a script that should be installed 755?

Intentional. The help string in Config.in describes how to run the test suite.

>
>> +     $(INSTALL) -m644 -D $(@D)/t/harness             $(TARGET_DIR)/root/microperl/t/harness
>> +     cp -r $(@D)/lib         $(TARGET_DIR)/root/microperl/lib
>> +     cp -r $(@D)/t/base      $(TARGET_DIR)/root/microperl/t/base
>> +     cp -r $(@D)/t/cmd       $(TARGET_DIR)/root/microperl/t/cmd
>
> Is /root/ really the right place to install this? Isn't
> some /usr/share/perl/ or /usr/lib/perl/ a better place?

On host-dev, testing in done in the build tree, so the test suite is
never installed.
With cross-dev, a part of the build tree must be copied on target in
order to run test; but you do this only during porting or debugging
the package.
I choice the /root directory, because it is an unusual location. If
you find these files in /root directory in a final image, you see your
mistake.
I do not want to pollute /usr with test suite.
(I try the /tmp directory, but it doesn't work)

>
>> +     echo "BEGIN { chdir 't' if -d 't'; @INC = ('../lib', '.'); } 1;" > $(TARGET_DIR)/root/microperl/TestInit.pm
>
> I think I would prefer a TestInit.pm file added in package/microperl/
> rather than echo'ing it here.

TestInit.pm is a preamble for each test, and a 'standard' version is
included in the Perl distribution.
But this 'standard' version is too convoluted (for all OS, for the
whole test suite).
This one-liner version is enough for microperl test suite and make
debugging more easy.

I don't want a patch which will never merged in upstream.

Fran?ois

>
> 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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Buildroot] [PATCH 02/12] microperl: how to test it ?
  2012-08-16  7:50     ` François Perrad
@ 2012-08-20  7:28       ` François Perrad
  0 siblings, 0 replies; 16+ messages in thread
From: François Perrad @ 2012-08-20  7:28 UTC (permalink / raw)
  To: buildroot

I'll send a new patch serie which supercedes this one.

Fran?ois

2012/8/16 Fran?ois Perrad <francois.perrad@gadz.org>:
> rem1: microperl is not fully supported by the Perl community.
> the build in Perl 5.16 serie is broken, see
> http://www.nntp.perl.org/group/perl.perl5.porters/2012/08/msg190323.html
> people ask about its interest, see
> http://www.nntp.perl.org/group/perl.perl5.porters/2012/08/msg190422.html
>
> rem2: in this commit, I introduce a testing scheme, and I reuse it for
> perl & miniperl packages.
> I want a reproducible and documented recipe for run the
> perl/miniperl/microerl test suite.
>
> 2012/8/15 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>:
>> Le Wed, 15 Aug 2012 16:38:24 +0200,
>> Francois Perrad <fperrad@gmail.com> a ?crit :
>>
>>> +ifdef BR2_PACKAGE_MICROPERL_INSTALL_TESTSUITE
>>> +define MICROPERL_INSTALL_TESTSUITE
>>> +     $(INSTALL) -m644 -D $(@D)/t/TEST                $(TARGET_DIR)/root/microperl/t/TEST
>>
>> Isn't this one a script that should be installed 755?
>
> Intentional. The help string in Config.in describes how to run the test suite.
>
>>
>>> +     $(INSTALL) -m644 -D $(@D)/t/harness             $(TARGET_DIR)/root/microperl/t/harness
>>> +     cp -r $(@D)/lib         $(TARGET_DIR)/root/microperl/lib
>>> +     cp -r $(@D)/t/base      $(TARGET_DIR)/root/microperl/t/base
>>> +     cp -r $(@D)/t/cmd       $(TARGET_DIR)/root/microperl/t/cmd
>>
>> Is /root/ really the right place to install this? Isn't
>> some /usr/share/perl/ or /usr/lib/perl/ a better place?
>
> On host-dev, testing in done in the build tree, so the test suite is
> never installed.
> With cross-dev, a part of the build tree must be copied on target in
> order to run test; but you do this only during porting or debugging
> the package.
> I choice the /root directory, because it is an unusual location. If
> you find these files in /root directory in a final image, you see your
> mistake.
> I do not want to pollute /usr with test suite.
> (I try the /tmp directory, but it doesn't work)
>
>>
>>> +     echo "BEGIN { chdir 't' if -d 't'; @INC = ('../lib', '.'); } 1;" > $(TARGET_DIR)/root/microperl/TestInit.pm
>>
>> I think I would prefer a TestInit.pm file added in package/microperl/
>> rather than echo'ing it here.
>
> TestInit.pm is a preamble for each test, and a 'standard' version is
> included in the Perl distribution.
> But this 'standard' version is too convoluted (for all OS, for the
> whole test suite).
> This one-liner version is enough for microperl test suite and make
> debugging more easy.
>
> I don't want a patch which will never merged in upstream.
>
> Fran?ois
>
>>
>> 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

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2012-08-20  7:28 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-15 14:38 [Buildroot] [PATCH 01/12] microperl: add license info Francois Perrad
2012-08-15 14:38 ` [Buildroot] [PATCH 02/12] microperl: how to test it ? Francois Perrad
2012-08-15 16:08   ` Thomas Petazzoni
2012-08-16  7:50     ` François Perrad
2012-08-20  7:28       ` François Perrad
2012-08-15 14:38 ` [Buildroot] [PATCH 03/12] microperl: build extensions at build time Francois Perrad
2012-08-15 14:38 ` [Buildroot] [PATCH 04/12] microperl: bump version to 5.14.2 Francois Perrad
2012-08-15 14:38 ` [Buildroot] [PATCH 05/12] microperl: fix perl -V Francois Perrad
2012-08-15 14:38 ` [Buildroot] [PATCH 06/12] microperl: install more modules by default Francois Perrad
2012-08-15 14:38 ` [Buildroot] [PATCH 07/12] microperl: improve configure step on 64bits platform Francois Perrad
2012-08-15 14:38 ` [Buildroot] [PATCH 08/12] perl: new package Francois Perrad
2012-08-15 14:38 ` [Buildroot] [PATCH 09/12] miniperl: " Francois Perrad
2012-08-15 14:38 ` [Buildroot] [PATCH 10/12] microperl: bump version to 5.16.1 Francois Perrad
2012-08-15 14:38 ` [Buildroot] [PATCH 11/12] microperl: remove host-microperl Francois Perrad
2012-08-15 14:38 ` [Buildroot] [PATCH 12/12] cpanminus: new package Francois Perrad
2012-08-15 16:07 ` [Buildroot] [PATCH 01/12] microperl: add license info Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox