1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-03 01:40:07 +00:00

perl: Update from OE.dev and convert to use do_install for staging

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
Richard Purdie
2009-11-18 20:05:55 +00:00
parent 06685d7558
commit ca5f36ee6a
13 changed files with 189 additions and 273 deletions
+1 -12
View File
@@ -24,20 +24,10 @@ def get_perl_version(d):
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"
# Determine where the library directories are
def perl_get_libdirs(d):
libdir = bb.data.getVar('libdir', d, 1)
if is_new_perl(d) == "yes":
libdirs = libdir + '/perl5'
else:
libdirs = libdir + '/*/*/perl5'
libdirs = libdir + '/*/*/perl5'
return libdirs
def is_target(d):
@@ -45,7 +35,6 @@ def is_target(d):
return "yes"
return "no"
IS_NEW_PERL = "${@is_new_perl(d)}"
PERLLIBDIRS = "${@perl_get_libdirs(d)}"
FILES_${PN}-dbg += "${PERLLIBDIRS}/auto/*/.debug \
+10 -38
View File
@@ -14,54 +14,26 @@ export PERL_LIB = "${STAGING_DATADIR}/perl/${@get_perl_version(d)}"
export PERL_ARCHLIB = "${STAGING_LIBDIR}/perl/${@get_perl_version(d)}"
cpan_do_configure () {
export PERL5LIB="${PERL_ARCHLIB}"
yes '' | perl Makefile.PL ${EXTRA_CPANFLAGS}
if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
. ${STAGING_LIBDIR}/perl/config.sh
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_LIBDIR_NATIVE}:\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_LIBDIR_NATIVE}:\1${STAGING_LIBDIR}:" \
Makefile
fi
# Use find since there can be a Makefile generated for each Makefile.PL
for f in `find -name Makefile.PL`; do
f2=`echo $f | sed -e 's/.PL//'`
sed -i -e "s:\(PERL_ARCHLIB = \).*:\1${PERL_ARCHLIB}:" \
$f2
done
fi
}
cpan_do_compile () {
if [ "${IS_NEW_PERL}" = "yes" ]; then
oe_runmake PASTHRU_INC="${CFLAGS}" CCFLAGS="${CFLAGS}" LD="${CCLD}"
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
oe_runmake PASTHRU_INC="${CFLAGS}" CCFLAGS="${CFLAGS}" LD="${CCLD}"
}
NATIVE_INSTALL_WORKS = "1"
cpan_do_install () {
if [ ${@is_target(d)} = "yes" ]; then
oe_runmake install_vendor
fi
oe_runmake DESTDIR="${D}" install_vendor
}
cpan_do_stage () {
if [ ${@is_target(d)} = "no" ]; then
oe_runmake install_vendor
fi
}
EXPORT_FUNCTIONS do_configure do_compile do_install do_stage
+4 -21
View File
@@ -23,7 +23,7 @@ cpan_build_do_configure () {
if [ ${@is_target(d)} == "yes" ]; then
# build for target
. ${STAGING_LIBDIR}/perl/config.sh
if [ "${IS_NEW_PERL}" = "yes" ]; then
perl Build.PL --installdirs vendor \
--destdir ${D} \
--install_path lib="${datadir}/perl5" \
@@ -32,19 +32,9 @@ cpan_build_do_configure () {
--install_path bin=${bindir} \
--install_path bindoc=${mandir}/man1 \
--install_path libdoc=${mandir}/man3
else
perl Build.PL --installdirs vendor \
--destdir ${D} \
--install_path lib="${libdir}/perl5/site_perl/${version}" \
--install_path arch="${libdir}/perl5/site_perl/${version}/${TARGET_SYS}" \
--install_path script=${bindir} \
--install_path bin=${bindir} \
--install_path bindoc=${mandir}/man1 \
--install_path libdoc=${mandir}/man3
fi
else
# build for host
perl Build.PL --installdirs site
perl Build.PL --installdirs site --destdir ${D}
fi
}
@@ -52,16 +42,9 @@ cpan_build_do_compile () {
perl Build
}
NATIVE_INSTALL_WORKS = "1"
cpan_build_do_install () {
if [ ${@is_target(d)} == "yes" ]; then
perl Build install
fi
}
do_stage () {
if [ ${@is_target(d)} == "no" ]; then
perl Build install
fi
perl Build install
}
EXPORT_FUNCTIONS do_configure do_compile do_install