summaryrefslogtreecommitdiffstats
path: root/meta/classes/cpan_build.bbclass
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2014-10-16 03:05:19 +0200
committerTudor Florea <tudor.florea@enea.com>2014-10-16 03:05:19 +0200
commitc527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch)
treebb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /meta/classes/cpan_build.bbclass
downloadpoky-daisy-140929.tar.gz
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea <tudor.florea@enea.com>
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 0000000000..5b0ad61b4c
--- /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