Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | # |
| 2 | # This is for perl modules that use the new Build.PL build system |
| 3 | # |
| 4 | inherit cpan-base perlnative |
| 5 | |
| 6 | EXTRA_CPAN_BUILD_FLAGS ?= "" |
| 7 | |
| 8 | # Env var which tells perl if it should use host (no) or target (yes) settings |
| 9 | export PERLCONFIGTARGET = "${@is_target(d)}" |
| 10 | export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}" |
| 11 | export LD = "${CCLD}" |
| 12 | |
| 13 | cpan_build_do_configure () { |
| 14 | if [ "${@is_target(d)}" = "yes" ]; then |
| 15 | # build for target |
| 16 | . ${STAGING_LIBDIR}/perl/config.sh |
| 17 | fi |
| 18 | |
| 19 | perl Build.PL --installdirs vendor \ |
| 20 | --destdir ${D} \ |
| 21 | --install_path arch="${libdir}/perl" \ |
| 22 | --install_path script=${bindir} \ |
| 23 | --install_path bin=${bindir} \ |
| 24 | --install_path bindoc=${mandir}/man1 \ |
| 25 | --install_path libdoc=${mandir}/man3 \ |
| 26 | ${EXTRA_CPAN_BUILD_FLAGS} |
| 27 | } |
| 28 | |
| 29 | cpan_build_do_compile () { |
| 30 | perl Build |
| 31 | } |
| 32 | |
| 33 | cpan_build_do_install () { |
| 34 | perl Build install |
| 35 | } |
| 36 | |
| 37 | EXPORT_FUNCTIONS do_configure do_compile do_install |