[OE-core] how to add new perl modules to stock OE build?
Robert P. J. Day
rpjday at crashcourse.ca
Thu Oct 27 09:52:17 UTC 2016
(followup to earlier thread, but now that i have a better idea of
what i'm trying to do, i decided to start a new thread that should be
more focused. apologies for dragging this out just a bit longer.)
as i posted earlier, i want to add some perl modules to a basic poky
build; in this case, building core-image-minimal for qemuppc, if that
makes any difference.
initially, i went hunting for existing recipes for the modules i
wanted (meta-perl, meta-cpan, ...), until i noticed that the perl
recipe directory contains a "perl-rdepends_5.22.1.inc" file, which as
i read it defines all of the modules to be incorporated into the
"perl-modules" package, so that *appears* to be the solution -- just
extend the set of modules to be built by extending the contents of
that file.
so, first, is that the recommended (or even correct) approach? as an
example, i want to add Text::Template; would that involve adding lines
similar to the following?
RDEPENDS_${PN}-module-text-template += "${PN}-module-exporter"
RDEPENDS_${PN}-module-text-template += "${PN}-module-strict"
RDEPENDS_${PN}-module-text-template += "${PN}-module-vars"
(not saying that would be the *complete* set of lines for that module,
only that that looks like a starting point.)
next, if that's a valid approach, i can see the code near the bottom
of perl_5.22.1.bb that appears to be taking care of creating the
perl-modules package:
===== start =====
# Create a perl-modules package recommending all the other perl
# packages (actually the non modules packages and not created too)
ALLOW_EMPTY_perl-modules = "1"
PACKAGES_append = " perl-modules "
PACKAGESPLITFUNCS_prepend = "split_perl_packages "
python split_perl_packages () {
libdir = d.expand('${libdir}/perl/${PV}')
do_split_packages(d, libdir, 'auto/([^.]*)/[^/]*\.(so|ld|ix|al)', 'perl-module-%s', 'perl module %s', recursive=True, match_path=True, prepend=False)
do_split_packages(d, libdir, 'Module/([^\/]*)\.pm', '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)
# perl-modules should recommend every perl module, and only the
# modules. Don't attempt to use the result of do_split_packages() as some
# modules are manually split (eg. perl-module-unicore).
packages = filter(lambda p: 'perl-module-' in p, d.getVar('PACKAGES', True).split())
d.setVar(d.expand("RRECOMMENDS_${PN}-modules"), ' '.join(packages))
}
PACKAGES_DYNAMIC += "^perl-module-.*"
===== end =====
i sort of see what that's doing -- don't understand it completely,
but i'm assuming it's processing the contents of that .inc file to
list all modules to be built and incorporated into the "perl-modules"
dynamic package.
is this even remotely the right approach? is there an OE/YP manual
that explains this somewhere? thanks.
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
More information about the Openembedded-core
mailing list