Update drivers
[vuplus_openembedded] / classes / cpan-base.bbclass
1 #
2 # cpan-base providers various perl related information needed for building
3 # cpan modules
4 #
5 FILES_${PN} += "${libdir}/perl5 ${datadir}/perl5"
6
7 DEPENDS  += "${@["perl", "perl-native"][(bb.data.inherits_class('native', d))]}"
8 RDEPENDS  += "${@["perl", ""][(bb.data.inherits_class('native', d))]}"
9
10 # Determine the staged version of perl from the perl configuration file
11 def get_perl_version(d):
12         import re
13         cfg = bb.data.expand('${STAGING_LIBDIR}/perl/config.sh', d)
14         try:
15                 f = open(cfg, 'r')
16         except IOError:
17                 return None
18         l = f.readlines();
19         f.close();
20         r = re.compile("version='(\d\.\d\.\d)'")
21         for s in l:
22                 m = r.match(s)
23                 if m:
24                         return m.group(1)
25         return None
26
27 # Only 5.8.7 and 5.8.4 existed at the time we moved to the new layout
28 def is_new_perl(d):
29         ver = get_perl_version(d)
30         if ver == "5.8.4" or ver == "5.8.7":
31                 return "no"
32         return "yes"
33
34 # Determine where the library directories are
35 def perl_get_libdirs(d):
36         libdir = bb.data.getVar('libdir', d, 1)
37         if is_new_perl(d) == "yes":
38                 libdirs = libdir + '/perl5'
39         else:
40                 libdirs = libdir + '/*/*/perl5'
41         return libdirs
42
43 def is_target(d):
44     if not bb.data.inherits_class('native', d):
45         return "yes"
46     return "no"
47
48 IS_NEW_PERL = "${@is_new_perl(d)}"
49 PERLLIBDIRS = "${@perl_get_libdirs(d)}"
50
51 FILES_${PN}-dbg += "${PERLLIBDIRS}/auto/*/.debug \
52                     ${PERLLIBDIRS}/auto/*/*/.debug \
53                     ${PERLLIBDIRS}/auto/*/*/*/.debug"