2007-05-30 09:32:36 +00:00
|
|
|
#
|
|
|
|
# This is for perl modules that use the new Build.PL build system
|
|
|
|
#
|
2013-01-19 23:48:13 +00:00
|
|
|
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}"
|
2007-05-30 09:32:36 +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):
|
2012-03-03 10:59:25 +00:00
|
|
|
if d.getVar('CPAN_BUILD_DEPS', True):
|
2007-05-30 09:32:36 +00:00
|
|
|
return ''
|
2012-03-03 10:59:25 +00:00
|
|
|
pn = d.getVar('PN', True)
|
2007-05-30 09:32:36 +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 () {
|
2013-01-19 23:31:37 +00:00
|
|
|
if [ "${@is_target(d)}" = "yes" ]; then
|
2007-05-30 09:32:36 +00:00
|
|
|
# build for target
|
2009-11-16 10:56:17 +00:00
|
|
|
. ${STAGING_LIBDIR}/perl/config.sh
|
2012-09-25 21:33:01 +00:00
|
|
|
fi
|
2009-11-18 20:05:55 +00:00
|
|
|
|
2012-09-25 21:33:01 +00:00
|
|
|
perl Build.PL --installdirs vendor \
|
2007-05-30 09:32:36 +00:00
|
|
|
--destdir ${D} \
|
2010-12-30 20:27:54 +00:00
|
|
|
--install_path lib="${datadir}/perl" \
|
|
|
|
--install_path arch="${libdir}/perl" \
|
2007-05-30 09:32:36 +00:00
|
|
|
--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 () {
|
2009-11-18 20:05:55 +00:00
|
|
|
perl Build install
|
2007-05-30 09:32:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
EXPORT_FUNCTIONS do_configure do_compile do_install
|