diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 13:38:32 +0100 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 13:50:20 +0100 |
commit | e2e6f6fe07049f33cb6348780fa975162752e421 (patch) | |
tree | b1813295411235d1297a0ed642b1346b24fdfb12 /meta/classes/cpan_build.bbclass | |
download | poky-e2e6f6fe07049f33cb6348780fa975162752e421.tar.gz |
initial commit of Enea Linux 3.1
Migrated from the internal git server on the dora-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'meta/classes/cpan_build.bbclass')
-rw-r--r-- | meta/classes/cpan_build.bbclass | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/meta/classes/cpan_build.bbclass b/meta/classes/cpan_build.bbclass new file mode 100644 index 0000000000..eaba40a06f --- /dev/null +++ b/meta/classes/cpan_build.bbclass | |||
@@ -0,0 +1,51 @@ | |||
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 lib="${datadir}/perl" \ | ||
36 | --install_path arch="${libdir}/perl" \ | ||
37 | --install_path script=${bindir} \ | ||
38 | --install_path bin=${bindir} \ | ||
39 | --install_path bindoc=${mandir}/man1 \ | ||
40 | --install_path libdoc=${mandir}/man3 | ||
41 | } | ||
42 | |||
43 | cpan_build_do_compile () { | ||
44 | perl Build | ||
45 | } | ||
46 | |||
47 | cpan_build_do_install () { | ||
48 | perl Build install | ||
49 | } | ||
50 | |||
51 | EXPORT_FUNCTIONS do_configure do_compile do_install | ||