diff options
author | Tom Rini <tom_rini@mentor.com> | 2011-07-19 08:49:42 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-07-21 10:59:18 +0100 |
commit | 27ba6fbda84041b297a798b6d35de38272e74ea6 (patch) | |
tree | b3d65906da533b57dd40e0020e84ee078b97bdb7 /meta/recipes-devtools/perl | |
parent | 57f771164d0936cff47f6a0dd24376ded60401b7 (diff) | |
download | poky-27ba6fbda84041b297a798b6d35de38272e74ea6.tar.gz |
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.
(From OE-Core rev: 48c1e10f53894e666283aac086e61444d2c1ed69)
Signed-off-by: Tom Rini <tom_rini@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/perl')
-rw-r--r-- | meta/recipes-devtools/perl/perl-native_5.12.3.bb | 17 |
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 63f7e13e01..945ebd4ba1 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" | |||
4 | LICENSE = "Artistic|GPL" | 4 | LICENSE = "Artistic|GPL" |
5 | LIC_FILES_CHKSUM = "file://Copying;md5=2b4c6ffbcfcbdee469f02565f253d81a \ | 5 | LIC_FILES_CHKSUM = "file://Copying;md5=2b4c6ffbcfcbdee469f02565f253d81a \ |
6 | file://Artistic;md5=f921793d03cc6d63ec4b15e9be8fd3f8" | 6 | file://Artistic;md5=f921793d03cc6d63ec4b15e9be8fd3f8" |
7 | PR = "r3" | 7 | PR = "r4" |
8 | 8 | ||
9 | LIC_FILES_CHKSUM = "file://Copying;md5=2b4c6ffbcfcbdee469f02565f253d81a \ | 9 | LIC_FILES_CHKSUM = "file://Copying;md5=2b4c6ffbcfcbdee469f02565f253d81a \ |
10 | file://Artistic;md5=f921793d03cc6d63ec4b15e9be8fd3f8" | 10 | file://Artistic;md5=f921793d03cc6d63ec4b15e9be8fd3f8" |
@@ -102,3 +102,18 @@ do_install () { | |||
102 | create_wrapper ${D}${bindir}/perl PERL5LIB='$PERL5LIB:${STAGING_LIBDIR}/perl/${PV}:${STAGING_LIBDIR}/perl/' | 102 | create_wrapper ${D}${bindir}/perl PERL5LIB='$PERL5LIB:${STAGING_LIBDIR}/perl/${PV}:${STAGING_LIBDIR}/perl/' |
103 | create_wrapper ${D}${bindir}/perl${PV} PERL5LIB='$PERL5LIB:${STAGING_LIBDIR}/perl/${PV}:${STAGING_LIBDIR}/perl/' | 103 | create_wrapper ${D}${bindir}/perl${PV} PERL5LIB='$PERL5LIB:${STAGING_LIBDIR}/perl/${PV}:${STAGING_LIBDIR}/perl/' |
104 | } | 104 | } |
105 | |||
106 | SYSROOT_PREPROCESS_FUNCS += "perl_sysroot_create_wrapper" | ||
107 | |||
108 | perl_sysroot_create_wrapper () { | ||
109 | mkdir -p ${SYSROOT_DESTDIR}${bindir} | ||
110 | # Create a wrapper that /usr/bin/env perl will use to get perl-native. | ||
111 | # This MUST live in the normal bindir. | ||
112 | cat > ${SYSROOT_DESTDIR}${bindir}/../nativeperl << EOF | ||
113 | #!/bin/sh | ||
114 | realpath=\`readlink -fn \$0\` | ||
115 | exec \`dirname \$realpath\`/perl-native/perl "\$@" | ||
116 | EOF | ||
117 | chmod 0755 ${SYSROOT_DESTDIR}${bindir}/../nativeperl | ||
118 | cat ${SYSROOT_DESTDIR}${bindir}/../nativeperl | ||
119 | } | ||