summaryrefslogtreecommitdiff
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorTom Rini <tom_rini@mentor.com>2011-07-19 08:49:42 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-07-21 10:45:00 +0100
commit48c1e10f53894e666283aac086e61444d2c1ed69 (patch)
tree4680930b3dc3f29cf89274047c613c23d425eca4 /meta/recipes-devtools
parentcf2fae0ea64ad1b24cbd50545ffffa80e3ef8510 (diff)
downloadopenembedded-core-48c1e10f53894e666283aac086e61444d2c1ed69.tar.gz
openembedded-core-48c1e10f53894e666283aac086e61444d2c1ed69.tar.bz2
openembedded-core-48c1e10f53894e666283aac086e61444d2c1ed69.tar.xz
openembedded-core-48c1e10f53894e666283aac086e61444d2c1ed69.zip
perl-native: Add a perl-native wrapper in the normal bindir
We need this to allow for scripts to do #!/usr/bin/env perl-native and not require an 'inherit perlnative' per user of a package. Signed-off-by: Tom Rini <tom_rini@mentor.com>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/perl/perl-native_5.12.3.bb17
1 files changed, 16 insertions, 1 deletions
diff --git a/meta/recipes-devtools/perl/perl-native_5.12.3.bb b/meta/recipes-devtools/perl/perl-native_5.12.3.bb
index 63f7e13e0..945ebd4ba 100644
--- a/meta/recipes-devtools/perl/perl-native_5.12.3.bb
+++ b/meta/recipes-devtools/perl/perl-native_5.12.3.bb
@@ -4,7 +4,7 @@ SECTION = "libs"
LICENSE = "Artistic|GPL"
LIC_FILES_CHKSUM = "file://Copying;md5=2b4c6ffbcfcbdee469f02565f253d81a \
file://Artistic;md5=f921793d03cc6d63ec4b15e9be8fd3f8"
-PR = "r3"
+PR = "r4"
LIC_FILES_CHKSUM = "file://Copying;md5=2b4c6ffbcfcbdee469f02565f253d81a \
file://Artistic;md5=f921793d03cc6d63ec4b15e9be8fd3f8"
@@ -102,3 +102,18 @@ do_install () {
create_wrapper ${D}${bindir}/perl PERL5LIB='$PERL5LIB:${STAGING_LIBDIR}/perl/${PV}:${STAGING_LIBDIR}/perl/'
create_wrapper ${D}${bindir}/perl${PV} PERL5LIB='$PERL5LIB:${STAGING_LIBDIR}/perl/${PV}:${STAGING_LIBDIR}/perl/'
}
+
+SYSROOT_PREPROCESS_FUNCS += "perl_sysroot_create_wrapper"
+
+perl_sysroot_create_wrapper () {
+ mkdir -p ${SYSROOT_DESTDIR}${bindir}
+ # Create a wrapper that /usr/bin/env perl will use to get perl-native.
+ # This MUST live in the normal bindir.
+ cat > ${SYSROOT_DESTDIR}${bindir}/../nativeperl << EOF
+#!/bin/sh
+realpath=\`readlink -fn \$0\`
+exec \`dirname \$realpath\`/perl-native/perl "\$@"
+EOF
+ chmod 0755 ${SYSROOT_DESTDIR}${bindir}/../nativeperl
+ cat ${SYSROOT_DESTDIR}${bindir}/../nativeperl
+}