blob: 55ac0526953a7911458db40e07e83d73bd5bebc6 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001#
2# cpan-base providers various perl related information needed for building
3# cpan modules
4#
5FILES_${PN} += "${libdir}/perl ${datadir}/perl"
6
7DEPENDS += "${@["perl", "perl-native"][(bb.data.inherits_class('native', d))]}"
8RDEPENDS_${PN} += "${@["perl", ""][(bb.data.inherits_class('native', d))]}"
9
10PERL_OWN_DIR = "${@["", "/perl-native"][(bb.data.inherits_class('native', d))]}"
11
12# Determine the staged version of perl from the perl configuration file
13# Assign vardepvalue, because otherwise signature is changed before and after
14# perl is built (from None to real version in config.sh).
15get_perl_version[vardepvalue] = "${PERL_OWN_DIR}"
16def get_perl_version(d):
17 import re
18 cfg = d.expand('${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/config.sh')
19 try:
20 f = open(cfg, 'r')
21 except IOError:
22 return None
23 l = f.readlines();
24 f.close();
25 r = re.compile("^version='(\d*\.\d*\.\d*)'")
26 for s in l:
27 m = r.match(s)
28 if m:
29 return m.group(1)
30 return None
31
Patrick Williamsc124f4f2015-09-15 14:41:29 -050032def is_target(d):
33 if not bb.data.inherits_class('native', d):
34 return "yes"
35 return "no"
36
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050037PERLLIBDIRS = "${libdir}/perl"
38PERLLIBDIRS_class-native = "${libdir}/perl-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050039PERLVERSION := "${@get_perl_version(d)}"
40PERLVERSION[vardepvalue] = ""