diff options
-rw-r--r-- | meta/classes/cpan-base.bbclass | 6 | ||||
-rw-r--r-- | meta/classes/cpan.bbclass | 11 | ||||
-rw-r--r-- | meta/classes/cpan_build.bbclass | 7 | ||||
-rw-r--r-- | meta/classes/perl-version.bbclass | 46 |
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 | # |
5 | FILES_${PN} += "${libdir}/perl ${datadir}/perl" | 5 | FILES_${PN} += "${libdir}/perl5 ${datadir}/perl5" |
6 | 6 | ||
7 | DEPENDS += "${@["perl", "perl-native"][(bb.data.inherits_class('native', d))]}" | 7 | DEPENDS += "${@["perl", "perl-native"][(bb.data.inherits_class('native', d))]}" |
8 | RDEPENDS_${PN} += "${@["perl", ""][(bb.data.inherits_class('native', d))]}" | 8 | RDEPENDS_${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 | ||
17 | PERLLIBDIRS = "${libdir}/perl" | 17 | PERLLIBDIRS = "${libdir}/perl5" |
18 | PERLLIBDIRS_class-native = "${libdir}/perl-native" | 18 | PERLLIBDIRS_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 ?= "" | |||
10 | export PERLCONFIGTARGET = "${@is_target(d)}" | 10 | export 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 |
13 | export PERL_INC = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}/CORE" | 13 | export PERL_INC = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}/${@get_perl_arch(d)}/CORE" |
14 | export PERL_LIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}" | 14 | export PERL_LIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}" |
15 | export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}" | 15 | export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}/${@get_perl_arch(d)}" |
16 | export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${@get_perl_version(d)}/" | 16 | export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl5/${@get_perl_version(d)}/" |
17 | export PERLHOSTARCHLIB = "${STAGING_LIBDIR_NATIVE}/perl5/${@get_perl_version(d)}/${@get_perl_hostarch(d)}/" | ||
17 | 18 | ||
18 | cpan_do_configure () { | 19 | cpan_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 |
9 | export PERLCONFIGTARGET = "${@is_target(d)}" | 9 | export PERLCONFIGTARGET = "${@is_target(d)}" |
10 | export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}" | 10 | export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}/${@get_perl_arch(d)}" |
11 | export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${@get_perl_version(d)}/" | 11 | export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl5/${@get_perl_version(d)}/" |
12 | export PERLHOSTARCHLIB = "${STAGING_LIBDIR_NATIVE}/perl5/${@get_perl_version(d)}/${@get_perl_hostarch(d)}/" | ||
12 | export LD = "${CCLD}" | 13 | export LD = "${CCLD}" |
13 | 14 | ||
14 | cpan_build_do_configure () { | 15 | cpan_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 @@ | |||
1 | PERL_OWN_DIR = "${@["", "/perl-native"][(bb.data.inherits_class('native', d))]}" | 1 | PERL_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))]}" | |||
6 | get_perl_version[vardepvalue] = "${PERL_OWN_DIR}" | 6 | get_perl_version[vardepvalue] = "${PERL_OWN_DIR}" |
7 | def get_perl_version(d): | 7 | def 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 | ||
23 | PERLVERSION := "${@get_perl_version(d)}" | 23 | PERLVERSION := "${@get_perl_version(d)}" |
24 | PERLVERSION[vardepvalue] = "" | 24 | PERLVERSION[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). | ||
30 | def 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 | |||
46 | PERLARCH := "${@get_perl_arch(d)}" | ||
47 | PERLARCH[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). | ||
52 | def 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 | ||