diff options
| author | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
|---|---|---|
| committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
| commit | c527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch) | |
| tree | bb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /meta/classes/cpan-base.bbclass | |
| download | poky-daisy-140929.tar.gz | |
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/classes/cpan-base.bbclass')
| -rw-r--r-- | meta/classes/cpan-base.bbclass | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/meta/classes/cpan-base.bbclass b/meta/classes/cpan-base.bbclass new file mode 100644 index 0000000000..d9817ba6b6 --- /dev/null +++ b/meta/classes/cpan-base.bbclass | |||
| @@ -0,0 +1,55 @@ | |||
| 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 | # Assign vardepvalue, because otherwise signature is changed before and after | ||
| 14 | # perl is built (from None to real version in config.sh). | ||
| 15 | get_perl_version[vardepvalue] = "${PERL_OWN_DIR}" | ||
| 16 | def 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 | |||
| 32 | # Determine where the library directories are | ||
| 33 | def perl_get_libdirs(d): | ||
| 34 | libdir = d.getVar('libdir', True) | ||
| 35 | if is_target(d) == "no": | ||
| 36 | libdir += '/perl-native' | ||
| 37 | libdir += '/perl' | ||
| 38 | return libdir | ||
| 39 | |||
| 40 | def is_target(d): | ||
| 41 | if not bb.data.inherits_class('native', d): | ||
| 42 | return "yes" | ||
| 43 | return "no" | ||
| 44 | |||
| 45 | PERLLIBDIRS := "${@perl_get_libdirs(d)}" | ||
| 46 | PERLVERSION := "${@get_perl_version(d)}" | ||
| 47 | PERLVERSION[vardepvalue] = "" | ||
| 48 | |||
| 49 | FILES_${PN}-dbg += "${PERLLIBDIRS}/auto/*/.debug \ | ||
| 50 | ${PERLLIBDIRS}/auto/*/*/.debug \ | ||
| 51 | ${PERLLIBDIRS}/auto/*/*/*/.debug \ | ||
| 52 | ${PERLLIBDIRS}/vendor_perl/${PERLVERSION}/auto/*/.debug \ | ||
| 53 | ${PERLLIBDIRS}/vendor_perl/${PERLVERSION}/auto/*/*/.debug \ | ||
| 54 | ${PERLLIBDIRS}/vendor_perl/${PERLVERSION}/auto/*/*/*/.debug \ | ||
| 55 | " | ||
