2024-09-09 08:52:07 +00:00
|
|
|
#
|
|
|
|
# This is for perl modules that use the new Build.PL build system
|
|
|
|
#
|
2024-09-09 08:57:42 +00:00
|
|
|
inherit cpan-base perlnative
|
|
|
|
|
|
|
|
EXTRA_CPAN_BUILD_FLAGS ?= ""
|
|
|
|
|
|
|
|
# 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}"
|
2024-09-09 08:52:07 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# 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):
|
2024-09-09 08:57:42 +00:00
|
|
|
if d.getVar('CPAN_BUILD_DEPS', True):
|
2024-09-09 08:52:07 +00:00
|
|
|
return ''
|
2024-09-09 08:57:42 +00:00
|
|
|
pn = d.getVar('PN', True)
|
2024-09-09 08:52:07 +00:00
|
|
|
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 () {
|
2024-09-09 08:57:42 +00:00
|
|
|
if [ "${@is_target(d)}" = "yes" ]; then
|
2024-09-09 08:52:07 +00:00
|
|
|
# build for target
|
|
|
|
. ${STAGING_LIBDIR}/perl/config.sh
|
2024-09-09 08:57:42 +00:00
|
|
|
fi
|
2024-09-09 08:52:07 +00:00
|
|
|
|
2024-09-09 08:57:42 +00:00
|
|
|
perl Build.PL --installdirs vendor \
|
2024-09-09 08:52:07 +00:00
|
|
|
--destdir ${D} \
|
|
|
|
--install_path arch="${libdir}/perl" \
|
|
|
|
--install_path script=${bindir} \
|
|
|
|
--install_path bin=${bindir} \
|
|
|
|
--install_path bindoc=${mandir}/man1 \
|
2024-09-09 08:57:42 +00:00
|
|
|
--install_path libdoc=${mandir}/man3 \
|
|
|
|
${EXTRA_CPAN_BUILD_FLAGS}
|
2024-09-09 08:52:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
cpan_build_do_compile () {
|
|
|
|
perl Build
|
|
|
|
}
|
|
|
|
|
|
|
|
cpan_build_do_install () {
|
|
|
|
perl Build install
|
|
|
|
}
|
|
|
|
|
|
|
|
EXPORT_FUNCTIONS do_configure do_compile do_install
|