summaryrefslogtreecommitdiffstats
path: root/meta/classes/cpan_build.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/cpan_build.bbclass')
-rw-r--r--meta/classes/cpan_build.bbclass50
1 files changed, 50 insertions, 0 deletions
diff --git a/meta/classes/cpan_build.bbclass b/meta/classes/cpan_build.bbclass
new file mode 100644
index 0000000..5b0ad61
--- /dev/null
+++ b/meta/classes/cpan_build.bbclass
@@ -0,0 +1,50 @@
1#
2# This is for perl modules that use the new Build.PL build system
3#
4inherit cpan-base perlnative
5
6# Env var which tells perl if it should use host (no) or target (yes) settings
7export PERLCONFIGTARGET = "${@is_target(d)}"
8export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
9export LD = "${CCLD}"
10
11#
12# We also need to have built libmodule-build-perl-native for
13# everything except libmodule-build-perl-native itself (which uses
14# this class, but uses itself as the provider of
15# libmodule-build-perl)
16#
17def cpan_build_dep_prepend(d):
18 if d.getVar('CPAN_BUILD_DEPS', True):
19 return ''
20 pn = d.getVar('PN', True)
21 if pn in ['libmodule-build-perl', 'libmodule-build-perl-native']:
22 return ''
23 return 'libmodule-build-perl-native '
24
25DEPENDS_prepend = "${@cpan_build_dep_prepend(d)}"
26
27cpan_build_do_configure () {
28 if [ "${@is_target(d)}" = "yes" ]; then
29 # build for target
30 . ${STAGING_LIBDIR}/perl/config.sh
31 fi
32
33 perl Build.PL --installdirs vendor \
34 --destdir ${D} \
35 --install_path arch="${libdir}/perl" \
36 --install_path script=${bindir} \
37 --install_path bin=${bindir} \
38 --install_path bindoc=${mandir}/man1 \
39 --install_path libdoc=${mandir}/man3
40}
41
42cpan_build_do_compile () {
43 perl Build
44}
45
46cpan_build_do_install () {
47 perl Build install
48}
49
50EXPORT_FUNCTIONS do_configure do_compile do_install