diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2009-11-18 20:05:55 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2009-11-18 20:05:55 +0000 |
commit | ca5f36ee6ad756e1e540288a56a504c1d8ecc7a3 (patch) | |
tree | 9ad90f44e75c449f54f30bb702aa797ee8083a78 /meta/classes | |
parent | 06685d7558891dc50b439cf82c394cfadc3ee1d4 (diff) | |
download | poky-ca5f36ee6ad756e1e540288a56a504c1d8ecc7a3.tar.gz |
perl: Update from OE.dev and convert to use do_install for staging
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/cpan-base.bbclass | 13 | ||||
-rw-r--r-- | meta/classes/cpan.bbclass | 48 | ||||
-rw-r--r-- | meta/classes/cpan_build.bbclass | 25 |
3 files changed, 15 insertions, 71 deletions
diff --git a/meta/classes/cpan-base.bbclass b/meta/classes/cpan-base.bbclass index 82fd5b459a..c90a8fbc27 100644 --- a/meta/classes/cpan-base.bbclass +++ b/meta/classes/cpan-base.bbclass | |||
@@ -24,20 +24,10 @@ def get_perl_version(d): | |||
24 | return m.group(1) | 24 | return m.group(1) |
25 | return None | 25 | return None |
26 | 26 | ||
27 | # Only 5.8.7 and 5.8.4 existed at the time we moved to the new layout | ||
28 | def is_new_perl(d): | ||
29 | ver = get_perl_version(d) | ||
30 | if ver == "5.8.4" or ver == "5.8.7": | ||
31 | return "no" | ||
32 | return "yes" | ||
33 | |||
34 | # Determine where the library directories are | 27 | # Determine where the library directories are |
35 | def perl_get_libdirs(d): | 28 | def perl_get_libdirs(d): |
36 | libdir = bb.data.getVar('libdir', d, 1) | 29 | libdir = bb.data.getVar('libdir', d, 1) |
37 | if is_new_perl(d) == "yes": | 30 | libdirs = libdir + '/*/*/perl5' |
38 | libdirs = libdir + '/perl5' | ||
39 | else: | ||
40 | libdirs = libdir + '/*/*/perl5' | ||
41 | return libdirs | 31 | return libdirs |
42 | 32 | ||
43 | def is_target(d): | 33 | def is_target(d): |
@@ -45,7 +35,6 @@ def is_target(d): | |||
45 | return "yes" | 35 | return "yes" |
46 | return "no" | 36 | return "no" |
47 | 37 | ||
48 | IS_NEW_PERL = "${@is_new_perl(d)}" | ||
49 | PERLLIBDIRS = "${@perl_get_libdirs(d)}" | 38 | PERLLIBDIRS = "${@perl_get_libdirs(d)}" |
50 | 39 | ||
51 | FILES_${PN}-dbg += "${PERLLIBDIRS}/auto/*/.debug \ | 40 | FILES_${PN}-dbg += "${PERLLIBDIRS}/auto/*/.debug \ |
diff --git a/meta/classes/cpan.bbclass b/meta/classes/cpan.bbclass index 66054bc755..3b1280c07b 100644 --- a/meta/classes/cpan.bbclass +++ b/meta/classes/cpan.bbclass | |||
@@ -14,54 +14,26 @@ export PERL_LIB = "${STAGING_DATADIR}/perl/${@get_perl_version(d)}" | |||
14 | export PERL_ARCHLIB = "${STAGING_LIBDIR}/perl/${@get_perl_version(d)}" | 14 | export PERL_ARCHLIB = "${STAGING_LIBDIR}/perl/${@get_perl_version(d)}" |
15 | 15 | ||
16 | cpan_do_configure () { | 16 | cpan_do_configure () { |
17 | export PERL5LIB="${PERL_ARCHLIB}" | ||
17 | yes '' | perl Makefile.PL ${EXTRA_CPANFLAGS} | 18 | yes '' | perl Makefile.PL ${EXTRA_CPANFLAGS} |
18 | if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then | 19 | if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then |
19 | . ${STAGING_LIBDIR}/perl/config.sh | 20 | . ${STAGING_LIBDIR}/perl/config.sh |
20 | if [ "${IS_NEW_PERL}" = "yes" ]; then | 21 | # Use find since there can be a Makefile generated for each Makefile.PL |
21 | sed -i -e "s:\(SITELIBEXP = \).*:\1${sitelibexp}:" \ | 22 | for f in `find -name Makefile.PL`; do |
22 | -e "s:\(SITEARCHEXP = \).*:\1${sitearchexp}:" \ | 23 | f2=`echo $f | sed -e 's/.PL//'` |
23 | -e "s:\(INSTALLVENDORLIB = \).*:\1${D}${datadir}/perl5:" \ | 24 | sed -i -e "s:\(PERL_ARCHLIB = \).*:\1${PERL_ARCHLIB}:" \ |
24 | -e "s:\(INSTALLVENDORARCH = \).*:\1${D}${libdir}/perl5:" \ | 25 | $f2 |
25 | -e "s:\(LDDLFLAGS.*\)${STAGING_LIBDIR_NATIVE}:\1${STAGING_LIBDIR}:" \ | 26 | done |
26 | Makefile | ||
27 | else | ||
28 | sed -i -e "s:\(SITELIBEXP = \).*:\1${sitelibexp}:" \ | ||
29 | -e "s:\(SITEARCHEXP = \).*:\1${sitearchexp}:" \ | ||
30 | -e "s:\(INSTALLVENDORLIB = \).*:\1${D}${libdir}/perl5/site_perl/${version}:" \ | ||
31 | -e "s:\(INSTALLVENDORARCH = \).*:\1${D}${libdir}/perl5/site_perl/${version}:" \ | ||
32 | -e "s:\(LDDLFLAGS.*\)${STAGING_LIBDIR_NATIVE}:\1${STAGING_LIBDIR}:" \ | ||
33 | Makefile | ||
34 | fi | ||
35 | fi | 27 | fi |
36 | } | 28 | } |
37 | 29 | ||
38 | cpan_do_compile () { | 30 | cpan_do_compile () { |
39 | if [ "${IS_NEW_PERL}" = "yes" ]; then | 31 | oe_runmake PASTHRU_INC="${CFLAGS}" CCFLAGS="${CFLAGS}" LD="${CCLD}" |
40 | oe_runmake PASTHRU_INC="${CFLAGS}" CCFLAGS="${CFLAGS}" LD="${CCLD}" | ||
41 | else | ||
42 | # You must use gcc to link on sh | ||
43 | OPTIONS="" | ||
44 | if test ${TARGET_ARCH} = "sh3" -o ${TARGET_ARCH} = "sh4"; then | ||
45 | OPTIONS="LD=${TARGET_ARCH}-${TARGET_OS}-gcc" | ||
46 | fi | ||
47 | if test ${TARGET_ARCH} = "powerpc" ; then | ||
48 | OPTIONS="LD=${TARGET_ARCH}-${TARGET_OS}-gcc" | ||
49 | fi | ||
50 | oe_runmake PASTHRU_INC="${CFLAGS}" CCFLAGS="${CFLAGS}" $OPTIONS | ||
51 | fi | ||
52 | } | 32 | } |
53 | 33 | ||
34 | NATIVE_INSTALL_WORKS = "1" | ||
54 | cpan_do_install () { | 35 | cpan_do_install () { |
55 | if [ ${@is_target(d)} = "yes" ]; then | 36 | oe_runmake DESTDIR="${D}" install_vendor |
56 | oe_runmake install_vendor | ||
57 | fi | ||
58 | } | ||
59 | |||
60 | cpan_do_stage () { | ||
61 | if [ ${@is_target(d)} = "no" ]; then | ||
62 | oe_runmake install_vendor | ||
63 | fi | ||
64 | } | 37 | } |
65 | |||
66 | 38 | ||
67 | EXPORT_FUNCTIONS do_configure do_compile do_install do_stage | 39 | EXPORT_FUNCTIONS do_configure do_compile do_install do_stage |
diff --git a/meta/classes/cpan_build.bbclass b/meta/classes/cpan_build.bbclass index 6cac85c5fe..944e8d4ac0 100644 --- a/meta/classes/cpan_build.bbclass +++ b/meta/classes/cpan_build.bbclass | |||
@@ -23,7 +23,7 @@ cpan_build_do_configure () { | |||
23 | if [ ${@is_target(d)} == "yes" ]; then | 23 | if [ ${@is_target(d)} == "yes" ]; then |
24 | # build for target | 24 | # build for target |
25 | . ${STAGING_LIBDIR}/perl/config.sh | 25 | . ${STAGING_LIBDIR}/perl/config.sh |
26 | if [ "${IS_NEW_PERL}" = "yes" ]; then | 26 | |
27 | perl Build.PL --installdirs vendor \ | 27 | perl Build.PL --installdirs vendor \ |
28 | --destdir ${D} \ | 28 | --destdir ${D} \ |
29 | --install_path lib="${datadir}/perl5" \ | 29 | --install_path lib="${datadir}/perl5" \ |
@@ -32,19 +32,9 @@ cpan_build_do_configure () { | |||
32 | --install_path bin=${bindir} \ | 32 | --install_path bin=${bindir} \ |
33 | --install_path bindoc=${mandir}/man1 \ | 33 | --install_path bindoc=${mandir}/man1 \ |
34 | --install_path libdoc=${mandir}/man3 | 34 | --install_path libdoc=${mandir}/man3 |
35 | else | ||
36 | perl Build.PL --installdirs vendor \ | ||
37 | --destdir ${D} \ | ||
38 | --install_path lib="${libdir}/perl5/site_perl/${version}" \ | ||
39 | --install_path arch="${libdir}/perl5/site_perl/${version}/${TARGET_SYS}" \ | ||
40 | --install_path script=${bindir} \ | ||
41 | --install_path bin=${bindir} \ | ||
42 | --install_path bindoc=${mandir}/man1 \ | ||
43 | --install_path libdoc=${mandir}/man3 | ||
44 | fi | ||
45 | else | 35 | else |
46 | # build for host | 36 | # build for host |
47 | perl Build.PL --installdirs site | 37 | perl Build.PL --installdirs site --destdir ${D} |
48 | fi | 38 | fi |
49 | } | 39 | } |
50 | 40 | ||
@@ -52,16 +42,9 @@ cpan_build_do_compile () { | |||
52 | perl Build | 42 | perl Build |
53 | } | 43 | } |
54 | 44 | ||
45 | NATIVE_INSTALL_WORKS = "1" | ||
55 | cpan_build_do_install () { | 46 | cpan_build_do_install () { |
56 | if [ ${@is_target(d)} == "yes" ]; then | 47 | perl Build install |
57 | perl Build install | ||
58 | fi | ||
59 | } | ||
60 | |||
61 | do_stage () { | ||
62 | if [ ${@is_target(d)} == "no" ]; then | ||
63 | perl Build install | ||
64 | fi | ||
65 | } | 48 | } |
66 | 49 | ||
67 | EXPORT_FUNCTIONS do_configure do_compile do_install | 50 | EXPORT_FUNCTIONS do_configure do_compile do_install |