netbase: fix non working wpa_supplicant detection in network restarts. Push PR.
[openembedded.git] / classes / cpan_build.bbclass
1 #
2 # This is for perl modules that use the new Build.PL build system
3 #
4 inherit cpan-base
5
6 INHIBIT_NATIVE_STAGE_INSTALL = "1"
7
8 #
9 # We also need to have built libmodule-build-perl-native for
10 # everything except libmodule-build-perl-native itself (which uses
11 # this class, but uses itself as the provider of
12 # libmodule-build-perl)
13 #
14 def cpan_build_dep_prepend(d):
15         if bb.data.getVar('CPAN_BUILD_DEPS', d, 1):
16                 return ''
17         pn = bb.data.getVar('PN', d, 1)
18         if pn in ['libmodule-build-perl', 'libmodule-build-perl-native']:
19                 return ''
20         return 'libmodule-build-perl-native '
21
22 DEPENDS_prepend = "${@cpan_build_dep_prepend(d)}"
23
24 cpan_build_do_configure () {
25         if [ ${@is_target(d)} == "yes" ]; then
26                 # build for target
27                 . ${STAGING_LIBDIR}/perl/config.sh
28                 if [ "${IS_NEW_PERL}" = "yes" ]; then
29                         perl Build.PL --installdirs vendor \
30                                 --destdir ${D} \
31                                 --install_path lib="${datadir}/perl5" \
32                                 --install_path arch="${libdir}/perl5" \
33                                 --install_path script=${bindir} \
34                                 --install_path bin=${bindir} \
35                                 --install_path bindoc=${mandir}/man1 \
36                                 --install_path libdoc=${mandir}/man3
37                 else
38                         perl Build.PL --installdirs vendor \
39                                 --destdir ${D} \
40                                 --install_path lib="${libdir}/perl5/site_perl/${version}" \
41                                 --install_path arch="${libdir}/perl5/site_perl/${version}/${TARGET_SYS}" \
42                                 --install_path script=${bindir} \
43                                 --install_path bin=${bindir} \
44                                 --install_path bindoc=${mandir}/man1 \
45                                 --install_path libdoc=${mandir}/man3
46                 fi
47         else
48                 # build for host
49                 perl Build.PL --installdirs site
50         fi
51 }
52
53 cpan_build_do_compile () {
54         perl Build
55 }
56
57 cpan_build_do_install () {
58         if [ ${@is_target(d)} == "yes" ]; then
59                 perl Build install
60         fi
61 }
62
63 do_stage_append () {
64         if [ ${@is_target(d)} == "no" ]; then
65                 perl Build install
66         fi
67 }
68
69 EXPORT_FUNCTIONS do_configure do_compile do_install