From c527fd1f14c27855a37f2e8ac5346ce8d940ced2 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Thu, 16 Oct 2014 03:05:19 +0200 Subject: initial commit for Enea Linux 4.0-140929 Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea --- meta/classes/cpan_build.bbclass | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 meta/classes/cpan_build.bbclass (limited to 'meta/classes/cpan_build.bbclass') diff --git a/meta/classes/cpan_build.bbclass b/meta/classes/cpan_build.bbclass new file mode 100644 index 0000000000..5b0ad61b4c --- /dev/null +++ b/meta/classes/cpan_build.bbclass @@ -0,0 +1,50 @@ +# +# This is for perl modules that use the new Build.PL build system +# +inherit cpan-base perlnative + +# Env var which tells perl if it should use host (no) or target (yes) settings +export PERLCONFIGTARGET = "${@is_target(d)}" +export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}" +export LD = "${CCLD}" + +# +# We also need to have built libmodule-build-perl-native for +# everything except libmodule-build-perl-native itself (which uses +# this class, but uses itself as the provider of +# libmodule-build-perl) +# +def cpan_build_dep_prepend(d): + if d.getVar('CPAN_BUILD_DEPS', True): + return '' + pn = d.getVar('PN', True) + if pn in ['libmodule-build-perl', 'libmodule-build-perl-native']: + return '' + return 'libmodule-build-perl-native ' + +DEPENDS_prepend = "${@cpan_build_dep_prepend(d)}" + +cpan_build_do_configure () { + if [ "${@is_target(d)}" = "yes" ]; then + # build for target + . ${STAGING_LIBDIR}/perl/config.sh + fi + + perl Build.PL --installdirs vendor \ + --destdir ${D} \ + --install_path arch="${libdir}/perl" \ + --install_path script=${bindir} \ + --install_path bin=${bindir} \ + --install_path bindoc=${mandir}/man1 \ + --install_path libdoc=${mandir}/man3 +} + +cpan_build_do_compile () { + perl Build +} + +cpan_build_do_install () { + perl Build install +} + +EXPORT_FUNCTIONS do_configure do_compile do_install -- cgit v1.2.3-54-g00ecf