From 55764a7c52979405d4d7c07fd92c3c5f64744494 Mon Sep 17 00:00:00 2001 From: Jamie Lenehan Date: Fri, 4 May 2007 01:24:59 +0000 Subject: perl: Extract common functionality from cpan and cpan_build classes into a cpan-base class and update cpan_build to work with the new perl layout that was added with perl 5.8.8. --- classes/cpan-base.bbclass | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 classes/cpan-base.bbclass (limited to 'classes/cpan-base.bbclass') diff --git a/classes/cpan-base.bbclass b/classes/cpan-base.bbclass new file mode 100644 index 0000000000..e10148aba8 --- /dev/null +++ b/classes/cpan-base.bbclass @@ -0,0 +1,51 @@ +# +# This is for perl modules that use the old Makefile.PL build system +# +FILES_${PN} += '${libdir}/perl5 ${datadir}/perl5' +EXTRA_CPANFLAGS ?= "" + +DEPENDS += "perl perl-native" +RDEPENDS += "perl" + +# Determine the staged version of perl from the perl configuration file +def get_perl_version(d): + import os, bb, re + cfg = bb.data.expand('${STAGING_DIR}/${HOST_SYS}/perl/config.sh', d) + try: + f = open(cfg, 'r') + except IOError: + return None + l = f.readlines(); + f.close(); + r = re.compile("version='(\d\.\d\.\d)'") + for s in l: + m = r.match(s) + if m: + return m.group(1) + return None + +# Only 5.8.7 and 5.8.4 existed at the time we moved to the new layout +def is_new_perl(d): + ver = get_perl_version(d) + if ver == "5.8.4" or ver == "5.8.7": + return "no" + return "yes" + +# Determine where the library directories are +def perl_get_libdirs(d): + import bb + libdir = bb.data.getVar('libdir', d, 1) + if is_new_perl(d) == "yes": + libdirs = libdir + '/perl5' + else: + 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)}" -- cgit v1.2.3 From bafa9b3ec1bd91cd710d587a31b58db4c1e2a503 Mon Sep 17 00:00:00 2001 From: Jamie Lenehan Date: Fri, 4 May 2007 02:09:42 +0000 Subject: perl: Add the .debug directories that to FILES_${PN}-dbg in the cpan-base.bbclass, and then update the cpan modules to no longer manually specify this. Also remove references to the new removed .packlist files. --- classes/cpan-base.bbclass | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'classes/cpan-base.bbclass') diff --git a/classes/cpan-base.bbclass b/classes/cpan-base.bbclass index e10148aba8..a5fdb33895 100644 --- a/classes/cpan-base.bbclass +++ b/classes/cpan-base.bbclass @@ -1,8 +1,8 @@ # -# This is for perl modules that use the old Makefile.PL build system +# cpan-base providers various perl related information needed for building +# cpan modules # -FILES_${PN} += '${libdir}/perl5 ${datadir}/perl5' -EXTRA_CPANFLAGS ?= "" +FILES_${PN} += "${libdir}/perl5 ${datadir}/perl5" DEPENDS += "perl perl-native" RDEPENDS += "perl" @@ -49,3 +49,7 @@ def is_target(d): IS_NEW_PERL = "${@is_new_perl(d)}" PERLLIBDIRS = "${@perl_get_libdirs(d)}" + +FILES_${PN}-dbg += "${PERLLIBDIRS}/auto/*/.debug \ + ${PERLLIBDIRS}/auto/*/*/.debug \ + ${PERLLIBDIRS}/auto/*/*/*/.debug" -- cgit v1.2.3 From 80ca3b81c1abf44a356604814ba859c7f833248f Mon Sep 17 00:00:00 2001 From: Jamie Lenehan Date: Wed, 30 May 2007 22:10:32 +0000 Subject: cpan-base.bbclass: Update the perl depenedencies: * For native modules DEPEND on perl-native and for others DEPEND on perl (which in turn depends on perl-native) rather then always depending on both perl and perl-native. * Only RDEPEND for non-native modules rather then both native and non-native. These changes are to allow you to build native modules without have to build perl. Previously the dependencies would result in perl being built even though it didn't actually need to. Thanks to hrw for pointing out what was happening here. --- classes/cpan-base.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'classes/cpan-base.bbclass') diff --git a/classes/cpan-base.bbclass b/classes/cpan-base.bbclass index a5fdb33895..cc0d11e515 100644 --- a/classes/cpan-base.bbclass +++ b/classes/cpan-base.bbclass @@ -4,8 +4,8 @@ # FILES_${PN} += "${libdir}/perl5 ${datadir}/perl5" -DEPENDS += "perl perl-native" -RDEPENDS += "perl" +DEPENDS += "${@["perl", "perl-native"][(bb.data.inherits_class('native', d))]}" +RDEPENDS += "${@["perl", ""][(bb.data.inherits_class('native', d))]}" # Determine the staged version of perl from the perl configuration file def get_perl_version(d): -- cgit v1.2.3