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-base.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-base.bbclass')
-rw-r--r-- | meta/classes/cpan-base.bbclass | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/meta/classes/cpan-base.bbclass b/meta/classes/cpan-base.bbclass new file mode 100644 index 0000000000..7e1e8d0d6b --- /dev/null +++ b/meta/classes/cpan-base.bbclass | |||
@@ -0,0 +1,51 @@ | |||
1 | # | ||
2 | # cpan-base providers various perl related information needed for building | ||
3 | # cpan modules | ||
4 | # | ||
5 | FILES_${PN} += "${libdir}/perl ${datadir}/perl" | ||
6 | |||
7 | DEPENDS += "${@["perl", "perl-native"][(bb.data.inherits_class('native', d))]}" | ||
8 | RDEPENDS_${PN} += "${@["perl", ""][(bb.data.inherits_class('native', d))]}" | ||
9 | |||
10 | PERL_OWN_DIR = "${@["", "/perl-native"][(bb.data.inherits_class('native', d))]}" | ||
11 | |||
12 | # Determine the staged version of perl from the perl configuration file | ||
13 | def get_perl_version(d): | ||
14 | import re | ||
15 | cfg = d.expand('${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/config.sh') | ||
16 | try: | ||
17 | f = open(cfg, 'r') | ||
18 | except IOError: | ||
19 | return None | ||
20 | l = f.readlines(); | ||
21 | f.close(); | ||
22 | r = re.compile("^version='(\d*\.\d*\.\d*)'") | ||
23 | for s in l: | ||
24 | m = r.match(s) | ||
25 | if m: | ||
26 | return m.group(1) | ||
27 | return None | ||
28 | |||
29 | # Determine where the library directories are | ||
30 | def perl_get_libdirs(d): | ||
31 | libdir = d.getVar('libdir', True) | ||
32 | if is_target(d) == "no": | ||
33 | libdir += '/perl-native' | ||
34 | libdir += '/perl' | ||
35 | return libdir | ||
36 | |||
37 | def is_target(d): | ||
38 | if not bb.data.inherits_class('native', d): | ||
39 | return "yes" | ||
40 | return "no" | ||
41 | |||
42 | PERLLIBDIRS := "${@perl_get_libdirs(d)}" | ||
43 | PERLVERSION := "${@get_perl_version(d)}" | ||
44 | |||
45 | FILES_${PN}-dbg += "${PERLLIBDIRS}/auto/*/.debug \ | ||
46 | ${PERLLIBDIRS}/auto/*/*/.debug \ | ||
47 | ${PERLLIBDIRS}/auto/*/*/*/.debug \ | ||
48 | ${PERLLIBDIRS}/vendor_perl/${PERLVERSION}/auto/*/.debug \ | ||
49 | ${PERLLIBDIRS}/vendor_perl/${PERLVERSION}/auto/*/*/.debug \ | ||
50 | ${PERLLIBDIRS}/vendor_perl/${PERLVERSION}/auto/*/*/*/.debug \ | ||
51 | " | ||