summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Balister <philip@balister.org>2007-04-25 02:02:01 +0000
committerPhilip Balister <philip@balister.org>2007-04-25 02:02:01 +0000
commit68cd011ec6ba2ab673b204977481b2348108795f (patch)
treecf2089d77909ab03a0f7a402bfe8b00aabf632f9
parent08718da7c1578850caa36b9511a5f44386a8e213 (diff)
parente8a6d182baff2ced6027f8810eee8eb07030fd32 (diff)
merge of '32161ed8fe97769fa75537a6e2cce7e2a202a301'
and 'bb1689f72c4d6e5659fe4a1b0b32c2ce23922e8a'
-rw-r--r--classes/cpan.bbclass74
-rw-r--r--packages/perl/perl-rdepends_5.8.8.inc8
-rw-r--r--packages/perl/perl_5.8.8.bb13
3 files changed, 65 insertions, 30 deletions
diff --git a/classes/cpan.bbclass b/classes/cpan.bbclass
index a566f0fa42..9915bf6f67 100644
--- a/classes/cpan.bbclass
+++ b/classes/cpan.bbclass
@@ -1,38 +1,74 @@
#
# This is for perl modules that use the old Makefile.PL build system
#
-FILES_${PN} += '${libdir}/perl5'
-EXTRA_CPANFLAGS = ""
+FILES_${PN} += '${libdir}/perl5 ${datadir}/perl5'
+EXTRA_CPANFLAGS ?= ""
DEPENDS += "perl-native"
RDEPENDS += "perl"
+# Determine the staged version of perl from the perl configuration file
+def get_perl_version(d):
+ import os, bb, re
+ cfg = bb.data.expand('${STAGING_DIR}/${HOST_SYS}/perl/config.sh', d)
+ try:
+ f = open(cfg, 'r')
+ except IOError:
+ return None
+ l = f.readlines();
+ f.close();
+ r = re.compile("version='(\d\.\d\.\d)'")
+ for s in l:
+ m = r.match(s)
+ if m:
+ return m.group(1)
+ return None
+
+# Only 5.8.7 and 5.8.4 existed at the time we moved to the new layout
+def is_new_perl(d):
+ ver = get_perl_version(d)
+ if ver == "5.8.4" or ver == "5.8.7":
+ return "no"
+ return "yes"
+
+IS_NEW_PERL = "${@is_new_perl(d)}"
+
cpan_do_configure () {
perl Makefile.PL ${EXTRA_CPANFLAGS}
if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
. ${STAGING_DIR}/${TARGET_SYS}/perl/config.sh
- sed -i -e "s:\(SITELIBEXP = \).*:\1${sitelibexp}:" \
- -e "s:\(SITEARCHEXP = \).*:\1${sitearchexp}:" \
- -e "s:\(INSTALLVENDORLIB = \).*:\1${D}${libdir}/perl5/site_perl/${version}:" \
- -e "s:\(INSTALLVENDORARCH = \).*:\1${D}${libdir}/perl5/site_perl/${version}:" \
- -e "s:\(LDDLFLAGS.*\)${STAGING_DIR}/${BUILD_SYS}/lib:\1${STAGING_LIBDIR}:" \
- Makefile
+ if [ "${IS_NEW_PERL}" = "yes" ]; then
+ sed -i -e "s:\(SITELIBEXP = \).*:\1${sitelibexp}:" \
+ -e "s:\(SITEARCHEXP = \).*:\1${sitearchexp}:" \
+ -e "s:\(INSTALLVENDORLIB = \).*:\1${D}${datadir}/perl5:" \
+ -e "s:\(INSTALLVENDORARCH = \).*:\1${D}${libdir}/perl5:" \
+ -e "s:\(LDDLFLAGS.*\)${STAGING_DIR}/${BUILD_SYS}/lib:\1${STAGING_LIBDIR}:" \
+ Makefile
+ else
+ sed -i -e "s:\(SITELIBEXP = \).*:\1${sitelibexp}:" \
+ -e "s:\(SITEARCHEXP = \).*:\1${sitearchexp}:" \
+ -e "s:\(INSTALLVENDORLIB = \).*:\1${D}${libdir}/perl5/site_perl/${version}:" \
+ -e "s:\(INSTALLVENDORARCH = \).*:\1${D}${libdir}/perl5/site_perl/${version}:" \
+ -e "s:\(LDDLFLAGS.*\)${STAGING_DIR}/${BUILD_SYS}/lib:\1${STAGING_LIBDIR}:" \
+ Makefile
+ fi
fi
}
cpan_do_compile () {
- # You must use gcc to link on sh
- OPTIONS=""
- if test ${TARGET_ARCH} = "sh3" -o ${TARGET_ARCH} = "sh4"; then
- OPTIONS="LD=${TARGET_ARCH}-${TARGET_OS}-gcc"
+ if [ "${IS_NEW_PERL}" = "yes" ]; then
+ oe_runmake PASTHRU_INC="${CFLAGS}" CCFLAGS="${CFLAGS}" LD=${TARGET_SYS}-gcc
+ else
+ # You must use gcc to link on sh
+ OPTIONS=""
+ if test ${TARGET_ARCH} = "sh3" -o ${TARGET_ARCH} = "sh4"; then
+ OPTIONS="LD=${TARGET_ARCH}-${TARGET_OS}-gcc"
+ fi
+ if test ${TARGET_ARCH} = "powerpc" ; then
+ OPTIONS="LD=${TARGET_ARCH}-${TARGET_OS}-gcc"
+ fi
+ oe_runmake PASTHRU_INC="${CFLAGS}" CCFLAGS="${CFLAGS}" $OPTIONS
fi
-
- if test ${TARGET_ARCH} = "powerpc" ; then
- OPTIONS="LD=${TARGET_ARCH}-${TARGET_OS}-gcc"
- fi
-
-
- oe_runmake PASTHRU_INC="${CFLAGS}" CCFLAGS="${CFLAGS}" $OPTIONS
}
cpan_do_install () {
diff --git a/packages/perl/perl-rdepends_5.8.8.inc b/packages/perl/perl-rdepends_5.8.8.inc
index 905edbdaaf..1ce5ad0375 100644
--- a/packages/perl/perl-rdepends_5.8.8.inc
+++ b/packages/perl/perl-rdepends_5.8.8.inc
@@ -1,3 +1,11 @@
+# To create/update the perl-rdepends_${PV}.inc use this piece of ugly script (modified for your arch/paths etc):
+# daka@DaKa2:/home/slug/slugos/tmp/work/perl-5.8.7-r14/install$ egrep -r "use|require" * | grep ";$" | egrep ".pm:use |.pm:require " | grep -v v5.6.0 | grep -v 5.00 | grep -v \$module | sed -e "s, \+, ,g" | cut -f1,2 -d" " | sed -e "s,;, ,g" | sed -e "s,(), ,g" | sed -e "s,::,-,g" | sort | uniq | tr [:upper:] [:lower:] | sed -e "s,/[^ ]\+ , += \"perl-module-,g" | sed -e "s, \?$, \",g" | sed -e "s,_,-,g" | sed -e "s,^,RDEPENDS_,g" | sed -e "s,armeb-linux,\$\{TARGET_ARCH\}-\$\{TARGET_OS\},g" | egrep -v "perl-module-5|perl-module-tk|perl-module-mac-internetconfig|perl-module-ndbm-file|perl-module-html-treebuilder|perl-module-lwp-simple|perl-module-vms-filespec|perl-module-fcgi|perl-module-vms-stdio|perl-module-mac-buildtools" > /home/slug/openembedded/packages/perl/rdepends.tmp
+
+# Some additional dependencies that the above doesn't manage to figure out
+RDEPENDS_perl-module-math-bigint += "perl-module-math-bigint-calc "
+RDEPENDS_perl-module-math-bigint-calc += "perl-module-integer "
+
+# Depends list
RDEPENDS_perl-misc += "perl-module-exporter "
RDEPENDS_perl-misc += "perl-module-strict "
RDEPENDS_perl-misc += "perl-module-warnings "
diff --git a/packages/perl/perl_5.8.8.bb b/packages/perl/perl_5.8.8.bb
index 6e79066afa..d97cd4cfe9 100644
--- a/packages/perl/perl_5.8.8.bb
+++ b/packages/perl/perl_5.8.8.bb
@@ -5,7 +5,7 @@ LICENSE = "Artistic|GPL"
PRIORITY = "optional"
# We need gnugrep (for -I)
DEPENDS = "virtual/db perl-native grep-native"
-PR = "r3"
+PR = "r4"
# Major part of version
PVM = "5.8"
@@ -94,7 +94,7 @@ do_compile() {
do_install() {
oe_runmake install
- # Add versioned perl interpereter
+ # Add perl pointing at current version
ln -sf perl${PV} ${D}/usr/bin/perl
# Fix up versioned directories
@@ -152,16 +152,7 @@ python populate_packages_prepend () {
do_split_packages(d, datadir, '(.*)\.(pm|pl)', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True)
}
-
require perl-rdepends_${PV}.inc
-
-# To create/update the perl-rdepends_${PV}.inc use this piece of ugly script (modified for your arch/paths etc):
-# daka@DaKa2:/home/slug/slugos/tmp/work/perl-5.8.7-r14/install$ egrep -r "use|require" * | grep ";$" | egrep ".pm:use |.pm:require " | grep -v v5.6.0 | grep -v 5.00 | grep -v \$module | sed -e "s, \+, ,g" | cut -f1,2 -d" " | sed -e "s,;, ,g" | sed -e "s,(), ,g" | sed -e "s,::,-,g" | sort | uniq | tr [:upper:] [:lower:] | sed -e "s,/[^ ]\+ , += \"perl-module-,g" | sed -e "s, \?$, \",g" | sed -e "s,_,-,g" | sed -e "s,^,RDEPENDS_,g" | sed -e "s,armeb-linux,\$\{TARGET_ARCH\}-\$\{TARGET_OS\},g" | egrep -v "perl-module-5|perl-module-tk|perl-module-mac-internetconfig|perl-module-ndbm-file|perl-module-html-treebuilder|perl-module-lwp-simple|perl-module-vms-filespec|perl-module-fcgi|perl-module-vms-stdio|perl-module-mac-buildtools" > /home/slug/openembedded/packages/perl/perl-rdepends_5.8.7.inc
-
-# Some additional dependencies that the above doesn't manage to figure out
-DEPENDS_perl-module-math-bigint += "perl-module-math-bigint-calc "
-DEPENDS_perl-module-math-bigint-calc += "perl-module-integer "
-
require perl-rprovides.inc
PARALLEL_MAKE = ""