Patchwork [07/17] perl_5.14.2.bb: fix dependecies

login
register
mail settings
Submitter Hongxu Jia
Date March 11, 2013, 11:04 a.m.
Message ID <32cd9a6d068bae27dc7825d460d261bc2fd2bcaf.1362985569.git.hongxu.jia@windriver.com>
Download mbox | patch
Permalink /patch/45879/
State New
Headers show

Comments

Hongxu Jia - March 11, 2013, 11:04 a.m.
This patch fixes 2 problems.

The first one is that when run "perl -V" on target, it fails with lack
of some .pm files. So add these perl module files to package perl itself
to fix this failure.

The second problem is that package nativesdk-perl-modules doesn't depends
on the single perl modules.

In the .bb file, dependencies of perl-modules are set by:
RRECOMMENDS_perl-modules = "${@d.getVar('PACKAGES', True)...}"
The PACKAGES would be reset by do_split_packages since:

PACKAGES_DYNAMIC = "perl-module-*"
PACKAGES_DYNAMIC_virtclass-nativesdk = "nativesdk-perl-module-*"

Then:
1) The target perl-modules RRECOMMENDS on perl-module-*, this is what
   we expect.
2) But the nativesdk-perl-modules doesn't RRECOMMENDS on
   nativesdk-perl-module-*, this is not what we expect.
The value of PACKAGES after do_split_packages has been set correctly (it
contains the nativesdk-perl-module-* packages)

But the:RRECOMMENDS_perl-modules = "${@d.getVar('PACKAGES', True)...}"
doesn't work correctly for nativesdk, the
d.getVar('RRECOMMENDS_perl-modules', True)
doesn't get the new value of the PACKAGES, it gets the value of PACKAGES
before the do_split_packages.

Cherry-pick commit 51cbb5ae76a22d465e2f6c5ef923ec2682624e3b

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-devtools/perl/perl_5.14.2.bb |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/recipes-devtools/perl/perl_5.14.2.bb b/meta/recipes-devtools/perl/perl_5.14.2.bb
index d3f6ffd..860080c 100644
--- a/meta/recipes-devtools/perl/perl_5.14.2.bb
+++ b/meta/recipes-devtools/perl/perl_5.14.2.bb
@@ -244,7 +244,13 @@  perl_package_preprocess () {
 
 PACKAGES = "perl-dbg perl perl-misc perl-dev perl-pod perl-doc perl-lib \
             perl-module-cpan perl-module-cpanplus perl-module-unicore"
-FILES_${PN} = "${bindir}/perl ${bindir}/perl${PV}"
+FILES_${PN} = "${bindir}/perl ${bindir}/perl${PV} \
+               ${libdir}/perl/${PV}/Config.pm \
+               ${libdir}/perl/${PV}/strict.pm \
+               ${libdir}/perl/${PV}/warnings.pm \
+               ${libdir}/perl/${PV}/warnings \
+               ${libdir}/perl/${PV}/vars.pm \
+              "
 FILES_${PN}-dev = "${libdir}/perl/${PV}/CORE"
 FILES_${PN}-lib = "${libdir}/libperl.so* \
                    ${libdir}/perl5 \
@@ -295,7 +301,6 @@  FILES_perl-module-unicore += "${libdir}/perl/${PV}/unicore"
 # packages (actually the non modules packages and not created too)
 ALLOW_EMPTY_perl-modules = "1"
 PACKAGES_append = " perl-modules "
-RRECOMMENDS_perl-modules = "${@d.getVar('PACKAGES', True).replace('${PN}-modules ', '').replace('${PN}-dbg ', '').replace('${PN}-misc ', '').replace('${PN}-dev ', '').replace('${PN}-pod ', '').replace('${PN}-doc ', '')}"
 
 python populate_packages_prepend () {
     libdir = d.expand('${libdir}/perl/${PV}')
@@ -303,6 +308,7 @@  python populate_packages_prepend () {
     do_split_packages(d, libdir, 'auto/([^/]*)/.*', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
     do_split_packages(d, libdir, 'Module/([^\/]*).*', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
     do_split_packages(d, libdir, '(^(?!(CPAN\/|CPANPLUS\/|Module\/|unicore\/|auto\/)[^\/]).*)\.(pm|pl|e2x)', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
+    d.setVar("RRECOMMENDS_${PN}-modules", d.getVar('PACKAGES', True).replace('${PN}-modules ', '').replace('${PN}-dbg ', '').replace('${PN}-misc ', '').replace('${PN}-dev ', '').replace('${PN}-pod ', '').replace('${PN}-doc ', ''))
 }
 
 PACKAGES_DYNAMIC = "perl-module-*"