blob: f3fb4666ef33fa2bf56f81d3e81f561c12a7c49a [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001#
2# This is for perl modules that use the new Build.PL build system
3#
4inherit cpan-base perlnative
5
6EXTRA_CPAN_BUILD_FLAGS ?= ""
7
8# Env var which tells perl if it should use host (no) or target (yes) settings
9export PERLCONFIGTARGET = "${@is_target(d)}"
Brad Bishop19323692019-04-05 15:28:33 -040010export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}/${@get_perl_arch(d)}"
11export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl5/${@get_perl_version(d)}/"
12export PERLHOSTARCHLIB = "${STAGING_LIBDIR_NATIVE}/perl5/${@get_perl_version(d)}/${@get_perl_hostarch(d)}/"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050013export LD = "${CCLD}"
14
15cpan_build_do_configure () {
16 if [ "${@is_target(d)}" = "yes" ]; then
17 # build for target
Brad Bishop19323692019-04-05 15:28:33 -040018 . ${STAGING_LIBDIR}/perl5/config.sh
Patrick Williamsc124f4f2015-09-15 14:41:29 -050019 fi
20
Patrick Williamsf1e5d692016-03-30 15:21:19 -050021 perl Build.PL --installdirs vendor --destdir ${D} \
22 ${EXTRA_CPAN_BUILD_FLAGS}
23
24 # Build.PLs can exit with success without generating a
25 # Build, e.g. in cases of missing configure time
26 # dependencies. This is considered a best practice by
27 # cpantesters.org. See:
28 # * http://wiki.cpantesters.org/wiki/CPANAuthorNotes
29 # * http://www.nntp.perl.org/group/perl.qa/2008/08/msg11236.html
30 [ -e Build ] || bbfatal "No Build was generated by Build.PL"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050031}
32
33cpan_build_do_compile () {
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080034 perl Build --perl "${bindir}/perl" verbose=1
Patrick Williamsc124f4f2015-09-15 14:41:29 -050035}
36
37cpan_build_do_install () {
Patrick Williamsf1e5d692016-03-30 15:21:19 -050038 perl Build install --destdir ${D}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050039}
40
41EXPORT_FUNCTIONS do_configure do_compile do_install