summaryrefslogtreecommitdiffstats
path: root/meta/classes
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
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')
-rw-r--r--meta/classes/cpan-base.bbclass6
-rw-r--r--meta/classes/cpan.bbclass11
-rw-r--r--meta/classes/cpan_build.bbclass7
-rw-r--r--meta/classes/perl-version.bbclass46
4 files changed, 57 insertions, 13 deletions
diff --git a/meta/classes/cpan-base.bbclass b/meta/classes/cpan-base.bbclass
index 577fcd63ce..867edf8707 100644
--- a/meta/classes/cpan-base.bbclass
+++ b/meta/classes/cpan-base.bbclass
@@ -2,7 +2,7 @@
2# cpan-base providers various perl related information needed for building 2# cpan-base providers various perl related information needed for building
3# cpan modules 3# cpan modules
4# 4#
5FILES_${PN} += "${libdir}/perl ${datadir}/perl" 5FILES_${PN} += "${libdir}/perl5 ${datadir}/perl5"
6 6
7DEPENDS += "${@["perl", "perl-native"][(bb.data.inherits_class('native', d))]}" 7DEPENDS += "${@["perl", "perl-native"][(bb.data.inherits_class('native', d))]}"
8RDEPENDS_${PN} += "${@["perl", ""][(bb.data.inherits_class('native', d))]}" 8RDEPENDS_${PN} += "${@["perl", ""][(bb.data.inherits_class('native', d))]}"
@@ -14,5 +14,5 @@ def is_target(d):
14 return "yes" 14 return "yes"
15 return "no" 15 return "no"
16 16
17PERLLIBDIRS = "${libdir}/perl" 17PERLLIBDIRS = "${libdir}/perl5"
18PERLLIBDIRS_class-native = "${libdir}/perl-native" 18PERLLIBDIRS_class-native = "${libdir}/perl5"
diff --git a/meta/classes/cpan.bbclass b/meta/classes/cpan.bbclass
index 511fe3fb92..e9908ae4b8 100644
--- a/meta/classes/cpan.bbclass
+++ b/meta/classes/cpan.bbclass
@@ -10,10 +10,11 @@ EXTRA_PERLFLAGS ?= ""
10export PERLCONFIGTARGET = "${@is_target(d)}" 10export PERLCONFIGTARGET = "${@is_target(d)}"
11 11
12# Env var which tells perl where the perl include files are 12# Env var which tells perl where the perl include files are
13export PERL_INC = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}/CORE" 13export PERL_INC = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}/${@get_perl_arch(d)}/CORE"
14export PERL_LIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}" 14export PERL_LIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}"
15export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}" 15export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}/${@get_perl_arch(d)}"
16export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${@get_perl_version(d)}/" 16export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl5/${@get_perl_version(d)}/"
17export PERLHOSTARCHLIB = "${STAGING_LIBDIR_NATIVE}/perl5/${@get_perl_version(d)}/${@get_perl_hostarch(d)}/"
17 18
18cpan_do_configure () { 19cpan_do_configure () {
19 yes '' | perl ${EXTRA_PERLFLAGS} Makefile.PL INSTALLDIRS=vendor NO_PERLLOCAL=1 NO_PACKLIST=1 PERL=$(which perl) ${EXTRA_CPANFLAGS} 20 yes '' | perl ${EXTRA_PERLFLAGS} Makefile.PL INSTALLDIRS=vendor NO_PERLLOCAL=1 NO_PACKLIST=1 PERL=$(which perl) ${EXTRA_CPANFLAGS}
@@ -27,7 +28,7 @@ cpan_do_configure () {
27 [ -e Makefile ] || bbfatal "No Makefile was generated by Makefile.PL" 28 [ -e Makefile ] || bbfatal "No Makefile was generated by Makefile.PL"
28 29
29 if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then 30 if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
30 . ${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/config.sh 31 . ${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/config.sh
31 # Use find since there can be a Makefile generated for each Makefile.PL 32 # Use find since there can be a Makefile generated for each Makefile.PL
32 for f in `find -name Makefile.PL`; do 33 for f in `find -name Makefile.PL`; do
33 f2=`echo $f | sed -e 's/.PL//'` 34 f2=`echo $f | sed -e 's/.PL//'`
diff --git a/meta/classes/cpan_build.bbclass b/meta/classes/cpan_build.bbclass
index 9a2ad895ef..f3fb4666ef 100644
--- a/meta/classes/cpan_build.bbclass
+++ b/meta/classes/cpan_build.bbclass
@@ -7,14 +7,15 @@ EXTRA_CPAN_BUILD_FLAGS ?= ""
7 7
8# Env var which tells perl if it should use host (no) or target (yes) settings 8# Env var which tells perl if it should use host (no) or target (yes) settings
9export PERLCONFIGTARGET = "${@is_target(d)}" 9export PERLCONFIGTARGET = "${@is_target(d)}"
10export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}" 10export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}/${@get_perl_arch(d)}"
11export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${@get_perl_version(d)}/" 11export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl5/${@get_perl_version(d)}/"
12export PERLHOSTARCHLIB = "${STAGING_LIBDIR_NATIVE}/perl5/${@get_perl_version(d)}/${@get_perl_hostarch(d)}/"
12export LD = "${CCLD}" 13export LD = "${CCLD}"
13 14
14cpan_build_do_configure () { 15cpan_build_do_configure () {
15 if [ "${@is_target(d)}" = "yes" ]; then 16 if [ "${@is_target(d)}" = "yes" ]; then
16 # build for target 17 # build for target
17 . ${STAGING_LIBDIR}/perl/config.sh 18 . ${STAGING_LIBDIR}/perl5/config.sh
18 fi 19 fi
19 20
20 perl Build.PL --installdirs vendor --destdir ${D} \ 21 perl Build.PL --installdirs vendor --destdir ${D} \
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