[oe-commits] org.oe.dev perl 5.8.8: Improvements for cpan modules:

lenehan commit openembedded-commits at lists.openembedded.org
Mon Apr 30 04:34:33 UTC 2007


perl 5.8.8: Improvements for cpan modules:
* Modify perl to install a copy of it's configuration during staging. This
  will allow us to get at the perl settings for the target when building
  cpan modules.
* Modify perl-native to allow selection of the host or target configuration
  based on an environment variable. This will allow the cpan class to select
  the appropriate configuration based on if we are building the native
  package or not.
* Modify cpan.bbclass to set the environment variable to an appropriate
  value to tell perl native to select the appropriate settings based on if
  we are building native or target modules.
This change fixes some modules that were compiled for the host instead of
the target (libversion-perl for example) and fixes up some of cpan modules
that include additional subdirectories with their own makefiles.

Author: lenehan at openembedded.org
Branch: org.openembedded.dev
Revision: e1f2e3537870e6d4a997727168dd4b5fc7824f14
ViewMTN: http://monotone.openembedded.org/revision.psp?id=e1f2e3537870e6d4a997727168dd4b5fc7824f14
Files:
1
packages/perl/perl-5.8.8/perl-configpm-switch.patch
classes/cpan.bbclass
packages/perl/perl-native_5.8.8.bb
packages/perl/perl_5.8.8.bb
Diffs:

#
# mt diff -r3267272c84aca4cba0b1f3d43c934a2d3be05af4 -re1f2e3537870e6d4a997727168dd4b5fc7824f14
#
# 
# 
# add_file "packages/perl/perl-5.8.8/perl-configpm-switch.patch"
#  content [85b0aeb910c756d06158c7a3172b369cf264b02f]
# 
# patch "classes/cpan.bbclass"
#  from [d09dc33e6742a5205337eab16edb0ab7da321296]
#    to [481e36f5234d7b355038316b3d8ce9b8eb971b2a]
# 
# patch "packages/perl/perl-native_5.8.8.bb"
#  from [952fe897dd6f8f0d0bd3877b7e06ba8dea751e6e]
#    to [b2290a3cf42bf873cda4c15ccf6735339d50e8bb]
# 
# patch "packages/perl/perl_5.8.8.bb"
#  from [1afcba9e1ad2cec68c604aaa9eecfdc308900263]
#    to [ca1acef3f57d4920cfd1da64f35141df9091e3aa]
# 
============================================================
--- packages/perl/perl-5.8.8/perl-configpm-switch.patch	85b0aeb910c756d06158c7a3172b369cf264b02f
+++ packages/perl/perl-5.8.8/perl-configpm-switch.patch	85b0aeb910c756d06158c7a3172b369cf264b02f
@@ -0,0 +1,34 @@
+This patch is used for perl-native only. It enables the switching of
+configuration files between Config_heavy.pl and
+Config_heavy-target.pl by setting the environment variables
+PERLCONFIGTARGET - the later containing settings for the target while
+the former contains those for the host. This will allow cpan.bbclass
+to use the settings appropriate for the native and/or target builds
+as required. This also disables the use of the cache since the cached
+values would be valid for the host only.
+
+--- perl-5.8.8/configpm	2007/04/30 03:10:43	1.1
++++ perl-5.8.8/configpm	2007/04/30 03:11:56
+@@ -374,7 +374,7 @@
+     my($self, $key) = @_;
+ 
+     # check for cached value (which may be undef so we use exists not defined)
+-    return $self->{$key} if exists $self->{$key};
++    #return $self->{$key} if exists $self->{$key};
+ 
+     return $self->fetch_string($key);
+ }
+@@ -530,7 +530,12 @@
+ sub DESTROY { }
+ 
+ sub AUTOLOAD {
+-    require 'Config_heavy.pl';
++    my $cfgfile = 'Config_heavy.pl';
++    if (defined $ENV{PERLCONFIGTARGET} and $ENV{PERLCONFIGTARGET} eq "yes")
++    {
++        $cfgfile = 'Config_heavy-target.pl';
++    }
++    require $cfgfile;
+     goto \&launcher unless $Config::AUTOLOAD =~ /launcher$/;
+     die "&Config::AUTOLOAD failed on $Config::AUTOLOAD";
+ }
============================================================
--- classes/cpan.bbclass	d09dc33e6742a5205337eab16edb0ab7da321296
+++ classes/cpan.bbclass	481e36f5234d7b355038316b3d8ce9b8eb971b2a
@@ -41,9 +41,18 @@ def perl_get_libdirs(d):
 		libdirs = libdir + '/*/*/perl5'
 	return libdirs
 
+def is_target(d):
+    import bb
+    if not bb.data.inherits_class('native', d):
+        return "yes"
+    return "no"
+
 IS_NEW_PERL = "${@is_new_perl(d)}"
 PERLLIBDIRS = "${@perl_get_libdirs(d)}"
 
+# Env var which tells perl if it should use host (no) or target (yes) settings
+export PERLCONFIGTARGET = "${@is_target(d)}"
+
 cpan_do_configure () {
 	perl Makefile.PL ${EXTRA_CPANFLAGS}
 	if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
============================================================
--- packages/perl/perl-native_5.8.8.bb	952fe897dd6f8f0d0bd3877b7e06ba8dea751e6e
+++ packages/perl/perl-native_5.8.8.bb	b2290a3cf42bf873cda4c15ccf6735339d50e8bb
@@ -1,14 +1,17 @@ DEPENDS = "virtual/db-native gdbm-native
 DESCRIPTION = "Perl is a popular scripting language."
 HOMEPAGE = "http://www.perl.org/"
 SECTION = "libs"
 LICENSE = "Artistic|GPL"
 DEPENDS = "virtual/db-native gdbm-native"
-PR = "r0"
+PR = "r1"
 
+FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/perl-${PV}"
+
 DEFAULT_PREFERENCE = "-1"
 
 SRC_URI = "http://ftp.funet.fi/pub/CPAN/src/perl-${PV}.tar.gz \
-           file://Configure-multilib.patch;patch=1"
+           file://Configure-multilib.patch;patch=1 \
+           file://perl-configpm-switch.patch;patch=1"
 
 S = "${WORKDIR}/perl-${PV}"
 
============================================================
--- packages/perl/perl_5.8.8.bb	1afcba9e1ad2cec68c604aaa9eecfdc308900263
+++ packages/perl/perl_5.8.8.bb	ca1acef3f57d4920cfd1da64f35141df9091e3aa
@@ -5,7 +5,7 @@ DEPENDS = "virtual/db perl-native grep-n
 PRIORITY = "optional"
 # We need gnugrep (for -I)
 DEPENDS = "virtual/db perl-native grep-native"
-PR = "r7"
+PR = "r8"
 
 # Major part of version
 PVM = "5.8"
@@ -127,6 +127,7 @@ do_stage() {
 do_stage() {
         install -d ${STAGING_DIR}/${HOST_SYS}/perl/
         install config.sh ${STAGING_DIR}/${HOST_SYS}/perl/
+        install lib/Config_heavy.pl ${STAGING_DIR}/${BUILD_SYS}/lib/perl5/${PV}/Config_heavy-target.pl
 }
 
 PACKAGES = "perl-dbg perl perl-misc perl-lib perl-dev perl-pod perl-doc"






More information about the Openembedded-commits mailing list