2 # This is for perl modules that use the new Build.PL build system
4 INHIBIT_NATIVE_STAGE_INSTALL = "1"
5 FILES_${PN} += '${libdir}/perl5'
7 DEPENDS += "perl-native"
11 # We also need to have built libmodule-build-perl-native for
12 # everything except libmodule-build-perl-native itself (which uses
13 # this class, but uses itself as the probider of
14 # libmodule-build-perl)
16 def cpan_build_dep_prepend(d):
18 if bb.data.getVar('CPAN_BUILD_DEPS', d, 1):
20 pn = bb.data.getVar('PN', d, 1)
21 if pn in ['libmodule-build-perl', 'libmodule-build-perl-native']:
23 return 'libmodule-build-perl-native '
25 DEPENDS_prepend = "${@cpan_build_dep_prepend(d)}"
27 def is_crosscompiling(d):
29 if not bb.data.inherits_class('native', d):
33 cpan_build_do_configure () {
34 if [ ${@is_crosscompiling(d)} == "yes" ]; then
36 . ${STAGING_DIR}/${TARGET_SYS}/perl/config.sh
37 perl Build.PL --installdirs vendor \
39 --install_path lib="${libdir}/perl5/site_perl/${version}" \
40 --install_path arch="${libdir}/perl5/site_perl/${version}/${TARGET_SYS}" \
41 --install_path script=${bindir} \
42 --install_path bin=${bindir} \
43 --install_path bindoc=${mandir}/man1 \
44 --install_path libdoc=${mandir}/man3
47 perl Build.PL --installdirs site
51 cpan_build_do_compile () {
55 cpan_build_do_install () {
56 if [ ${@is_crosscompiling(d)} == "yes" ]; then
62 if [ ${@is_crosscompiling(d)} == "no" ]; then
67 EXPORT_FUNCTIONS do_configure do_compile do_install