summaryrefslogtreecommitdiffstats
path: root/meta/classes/perl-version.bbclass
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2018-12-02 12:52:00 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-01-11 10:39:09 +0000
commitd460892f32fd6ec0a26231db9eead27a1ec7fcb4 (patch)
treef57fcfe3b6777295894feff4dedfc654741f4412 /meta/classes/perl-version.bbclass
parent00b9e7011e1e468a94fdd4dd5fc321d6adc90b79 (diff)
downloadpoky-d460892f32fd6ec0a26231db9eead27a1ec7fcb4.tar.gz
meta/classes: adjust perl-related classes to the new recipes
This mostly means tweaking the paths to match upstream defaults. get_perl_arch() functions are taken from the patch by Jens Rehsack: http://lists.openembedded.org/pipermail/openembedded-core/2018-November/276546.html (From OE-Core rev: d6b36b1babb4d3e8d41278111e71c71fde9af39e) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/perl-version.bbclass')
-rw-r--r--meta/classes/perl-version.bbclass46
1 files changed, 44 insertions, 2 deletions
diff --git a/meta/classes/perl-version.bbclass b/meta/classes/perl-version.bbclass
index bafd96518a..84b67b8180 100644
--- a/meta/classes/perl-version.bbclass
+++ b/meta/classes/perl-version.bbclass
@@ -1,4 +1,4 @@
1PERL_OWN_DIR = "${@["", "/perl-native"][(bb.data.inherits_class('native', d))]}" 1PERL_OWN_DIR = ""
2 2
3# Determine the staged version of perl from the perl configuration file 3# Determine the staged version of perl from the perl configuration file
4# Assign vardepvalue, because otherwise signature is changed before and after 4# Assign vardepvalue, because otherwise signature is changed before and after
@@ -6,7 +6,7 @@ PERL_OWN_DIR = "${@["", "/perl-native"][(bb.data.inherits_class('native', d))]}"
6get_perl_version[vardepvalue] = "${PERL_OWN_DIR}" 6get_perl_version[vardepvalue] = "${PERL_OWN_DIR}"
7def get_perl_version(d): 7def get_perl_version(d):
8 import re 8 import re
9 cfg = d.expand('${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/config.sh') 9 cfg = d.expand('${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/config.sh')
10 try: 10 try:
11 f = open(cfg, 'r') 11 f = open(cfg, 'r')
12 except IOError: 12 except IOError:
@@ -22,3 +22,45 @@ def get_perl_version(d):
22 22
23PERLVERSION := "${@get_perl_version(d)}" 23PERLVERSION := "${@get_perl_version(d)}"
24PERLVERSION[vardepvalue] = "" 24PERLVERSION[vardepvalue] = ""
25
26
27# Determine the staged arch of perl from the perl configuration file
28# Assign vardepvalue, because otherwise signature is changed before and after
29# perl is built (from None to real version in config.sh).
30def get_perl_arch(d):
31 import re
32 cfg = d.expand('${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/config.sh')
33 try:
34 f = open(cfg, 'r')
35 except IOError:
36 return None
37 l = f.readlines();
38 f.close();
39 r = re.compile("^archname='([^']*)'")
40 for s in l:
41 m = r.match(s)
42 if m:
43 return m.group(1)
44 return None
45
46PERLARCH := "${@get_perl_arch(d)}"
47PERLARCH[vardepvalue] = ""
48
49# Determine the staged arch of perl-native from the perl configuration file
50# Assign vardepvalue, because otherwise signature is changed before and after
51# perl is built (from None to real version in config.sh).
52def get_perl_hostarch(d):
53 import re
54 cfg = d.expand('${STAGING_LIBDIR_NATIVE}/perl5/config.sh')
55 try:
56 f = open(cfg, 'r')
57 except IOError:
58 return None
59 l = f.readlines();
60 f.close();
61 r = re.compile("^archname='([^']*)'")
62 for s in l:
63 m = r.match(s)
64 if m:
65 return m.group(1)
66 return None