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)}" |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 11 | export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${@get_perl_version(d)}/" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 12 | export LD = "${CCLD}" |
| 13 | |
| 14 | cpan_build_do_configure () { |
| 15 | if [ "${@is_target(d)}" = "yes" ]; then |
| 16 | # build for target |
| 17 | . ${STAGING_LIBDIR}/perl/config.sh |
| 18 | fi |
| 19 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 20 | perl Build.PL --installdirs vendor --destdir ${D} \ |
| 21 | ${EXTRA_CPAN_BUILD_FLAGS} |
| 22 | |
| 23 | # Build.PLs can exit with success without generating a |
| 24 | # Build, e.g. in cases of missing configure time |
| 25 | # dependencies. This is considered a best practice by |
| 26 | # cpantesters.org. See: |
| 27 | # * http://wiki.cpantesters.org/wiki/CPANAuthorNotes |
| 28 | # * http://www.nntp.perl.org/group/perl.qa/2008/08/msg11236.html |
| 29 | [ -e Build ] || bbfatal "No Build was generated by Build.PL" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | cpan_build_do_compile () { |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 33 | perl Build --perl "${bindir}/perl" verbose=1 |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | cpan_build_do_install () { |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 37 | perl Build install --destdir ${D} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 38 | } |
| 39 | |
| 40 | EXPORT_FUNCTIONS do_configure do_compile do_install |