Patchwork [RFC,v1,12/16] cpan.bbclass, cpan-base.bbclas: update them for the perlnative change

login
register
mail settings
Submitter Dexuan Cui
Date June 1, 2011, 1:18 p.m.
Message ID <086ec028392862da34949cb461cbf546d58823e8.1306931849.git.dexuan.cui@intel.com>
Download mbox | patch
Permalink /patch/5219/
State New, archived
Headers show

Comments

Dexuan Cui - June 1, 2011, 1:18 p.m.
Since perl-native now populates into its own dir, here we need
change accordingly.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
---
 meta/classes/cpan-base.bbclass |   10 +++++++---
 meta/classes/cpan.bbclass      |   12 ++++++------
 2 files changed, 13 insertions(+), 9 deletions(-)

Patch

diff --git a/meta/classes/cpan-base.bbclass b/meta/classes/cpan-base.bbclass
index 6cd2aa3..b5dbdae 100644
--- a/meta/classes/cpan-base.bbclass
+++ b/meta/classes/cpan-base.bbclass
@@ -7,10 +7,12 @@  FILES_${PN} += "${libdir}/perl ${datadir}/perl"
 DEPENDS  += "${@["perl", "perl-native"][(bb.data.inherits_class('native', d))]}"
 RDEPENDS  += "${@["perl", ""][(bb.data.inherits_class('native', d))]}"
 
+PERL_OWN_DIR = "${@["", "/perl-native"][(bb.data.inherits_class('native', d))]}"
+
 # Determine the staged version of perl from the perl configuration file
 def get_perl_version(d):
 	import re
-    	cfg = bb.data.expand('${STAGING_LIBDIR}/perl/config.sh', d)
+    	cfg = bb.data.expand('${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/config.sh', d)
 	try:
 		f = open(cfg, 'r')
 	except IOError:
@@ -27,8 +29,10 @@  def get_perl_version(d):
 # Determine where the library directories are
 def perl_get_libdirs(d):
 	libdir = bb.data.getVar('libdir', d, 1)
-	libdirs = libdir + '/perl'
-	return libdirs
+	if is_target(d) == "no":
+		libdir += '/perl-native'
+	libdir += '/perl'
+	return libdir
 
 def is_target(d):
     if not bb.data.inherits_class('native', d):
diff --git a/meta/classes/cpan.bbclass b/meta/classes/cpan.bbclass
index 9b8431b..cbf428d 100644
--- a/meta/classes/cpan.bbclass
+++ b/meta/classes/cpan.bbclass
@@ -1,7 +1,7 @@ 
 #
 # This is for perl modules that use the old Makefile.PL build system
 #
-inherit cpan-base
+inherit cpan-base perlnative
 
 EXTRA_CPANFLAGS ?= ""
 EXTRA_PERLFLAGS ?= ""
@@ -10,16 +10,16 @@  EXTRA_PERLFLAGS ?= ""
 export PERLCONFIGTARGET = "${@is_target(d)}"
 
 # Env var which tells perl where the perl include files are
-export PERL_INC = "${STAGING_LIBDIR}/perl/${@get_perl_version(d)}/CORE"
-export PERL_LIB = "${STAGING_LIBDIR}/perl/${@get_perl_version(d)}"
-export PERL_ARCHLIB = "${STAGING_LIBDIR}/perl/${@get_perl_version(d)}"
-export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl/${@get_perl_version(d)}/"
+export PERL_INC = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}/CORE"
+export PERL_LIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
+export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
+export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${@get_perl_version(d)}/"
 
 cpan_do_configure () {
 	export PERL5LIB="${PERL_ARCHLIB}"
 	yes '' | perl ${EXTRA_PERLFLAGS} Makefile.PL ${EXTRA_CPANFLAGS}
 	if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
-		. ${STAGING_LIBDIR}/perl/config.sh
+		. ${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/config.sh
 		# Use find since there can be a Makefile generated for each Makefile.PL
 		for f in `find -name Makefile.PL`; do
 			f2=`echo $f | sed -e 's/.PL//'`