diff options
author | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
commit | c527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch) | |
tree | bb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /meta/classes/cpan_build.bbclass | |
download | poky-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.bbclass | 50 |
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 | # | ||
4 | inherit cpan-base perlnative | ||
5 | |||
6 | # Env var which tells perl if it should use host (no) or target (yes) settings | ||
7 | export PERLCONFIGTARGET = "${@is_target(d)}" | ||
8 | export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}" | ||
9 | export 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 | # | ||
17 | def 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 | |||
25 | DEPENDS_prepend = "${@cpan_build_dep_prepend(d)}" | ||
26 | |||
27 | cpan_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 | |||
42 | cpan_build_do_compile () { | ||
43 | perl Build | ||
44 | } | ||
45 | |||
46 | cpan_build_do_install () { | ||
47 | perl Build install | ||
48 | } | ||
49 | |||
50 | EXPORT_FUNCTIONS do_configure do_compile do_install | ||