From 48c1e10f53894e666283aac086e61444d2c1ed69 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Tue, 19 Jul 2011 08:49:42 -0700 Subject: 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 --- meta/recipes-devtools/perl/perl-native_5.12.3.bb | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'meta/recipes-devtools') 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 +} -- cgit v1.2.3