Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | require perl.inc |
| 2 | |
| 3 | SRC_URI += "\ |
| 4 | file://Configure-multilib.patch \ |
| 5 | file://perl-configpm-switch.patch \ |
| 6 | file://native-nopacklist.patch \ |
| 7 | file://native-perlinc.patch \ |
| 8 | file://MM_Unix.pm.patch \ |
| 9 | file://debian/errno_ver.diff \ |
| 10 | file://dynaloaderhack.patch \ |
| 11 | file://perl-PathTools-don-t-filter-out-blib-from-INC.patch \ |
| 12 | " |
| 13 | |
| 14 | SRC_URI[md5sum] = "ff0f09b17de426eff323426cb140ee79" |
| 15 | SRC_URI[sha256sum] = "be83ead0c5c26cbbe626fa4bac1a4beabe23a9eebc15d35ba49ccde11878e196" |
| 16 | |
| 17 | inherit native |
| 18 | |
| 19 | NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}" |
| 20 | |
| 21 | export LD="${CCLD}" |
| 22 | |
| 23 | do_configure () { |
| 24 | ./Configure \ |
| 25 | -Dcc="${CC}" \ |
| 26 | -Dcflags="${CFLAGS}" \ |
| 27 | -Dldflags="${LDFLAGS}" \ |
| 28 | -Dcf_by="Open Embedded" \ |
| 29 | -Dprefix=${prefix} \ |
| 30 | -Dvendorprefix=${prefix} \ |
| 31 | -Dvendorprefix=${prefix} \ |
| 32 | -Dsiteprefix=${prefix} \ |
| 33 | \ |
| 34 | -Dbin=${STAGING_BINDIR}/${PN} \ |
| 35 | -Dprivlib=${STAGING_LIBDIR}/perl/${PV} \ |
| 36 | -Darchlib=${STAGING_LIBDIR}/perl/${PV} \ |
| 37 | -Dvendorlib=${STAGING_LIBDIR}/perl/${PV} \ |
| 38 | -Dvendorarch=${STAGING_LIBDIR}/perl/${PV} \ |
| 39 | -Dsitelib=${STAGING_LIBDIR}/perl/${PV} \ |
| 40 | -Dsitearch=${STAGING_LIBDIR}/perl/${PV} \ |
| 41 | \ |
| 42 | -Duseshrplib \ |
| 43 | -Dusethreads \ |
| 44 | -Duseithreads \ |
| 45 | -Duselargefiles \ |
| 46 | -Dnoextensions=ODBM_File \ |
| 47 | -Ud_dosuid \ |
| 48 | -Ui_db \ |
| 49 | -Ui_ndbm \ |
| 50 | -Ui_gdbm \ |
| 51 | -Ui_gdbm_ndbm \ |
| 52 | -Ui_gdbmndbm \ |
| 53 | -Di_shadow \ |
| 54 | -Di_syslog \ |
| 55 | -Duseperlio \ |
| 56 | -Dman3ext=3pm \ |
| 57 | -Dsed=/bin/sed \ |
| 58 | -Uafs \ |
| 59 | -Ud_csh \ |
| 60 | -Uusesfio \ |
| 61 | -Uusenm -des |
| 62 | } |
| 63 | |
| 64 | do_install () { |
| 65 | oe_runmake 'DESTDIR=${D}' install |
| 66 | |
| 67 | # We need a hostperl link for building perl |
| 68 | ln -sf perl${PV} ${D}${bindir}/hostperl |
| 69 | |
| 70 | ln -sf perl ${D}${libdir}/perl5 |
| 71 | |
| 72 | install -d ${D}${libdir}/perl/${PV}/CORE \ |
| 73 | ${D}${datadir}/perl/${PV}/ExtUtils |
| 74 | |
| 75 | # Save native config |
| 76 | install config.sh ${D}${libdir}/perl |
| 77 | install lib/Config.pm ${D}${libdir}/perl/${PV}/ |
| 78 | install lib/ExtUtils/typemap ${D}${libdir}/perl/${PV}/ExtUtils/ |
| 79 | |
| 80 | # perl shared library headers |
| 81 | # reference perl 5.20.0-1 in debian: |
| 82 | # https://packages.debian.org/experimental/i386/perl/filelist |
| 83 | for i in av.h bitcount.h charclass_invlists.h config.h cop.h cv.h dosish.h \ |
| 84 | embed.h embedvar.h EXTERN.h fakesdio.h feature.h form.h git_version.h \ |
| 85 | gv.h handy.h hv_func.h hv.h inline.h INTERN.h intrpvar.h iperlsys.h \ |
| 86 | keywords.h l1_char_class_tab.h malloc_ctl.h metaconfig.h mg_data.h \ |
| 87 | mg.h mg_raw.h mg_vtable.h mydtrace.h nostdio.h opcode.h op.h \ |
| 88 | opnames.h op_reg_common.h overload.h pad.h parser.h patchlevel.h \ |
| 89 | perlapi.h perl.h perlio.h perliol.h perlsdio.h perlvars.h perly.h \ |
| 90 | pp.h pp_proto.h proto.h reentr.h regcharclass.h regcomp.h regexp.h \ |
| 91 | regnodes.h scope.h sv.h thread.h time64_config.h time64.h uconfig.h \ |
| 92 | unicode_constants.h unixish.h utf8.h utfebcdic.h util.h uudmap.h \ |
| 93 | vutil.h warnings.h XSUB.h |
| 94 | do |
| 95 | install $i ${D}${libdir}/perl/${PV}/CORE |
| 96 | done |
| 97 | |
| 98 | create_wrapper ${D}${bindir}/perl PERL5LIB='$PERL5LIB:${STAGING_LIBDIR}/perl/${PV}:${STAGING_LIBDIR}/perl:${STAGING_LIBDIR}/perl/site_perl/${PV}:${STAGING_LIBDIR}/perl/vendor_perl/${PV}' |
| 99 | create_wrapper ${D}${bindir}/perl${PV} PERL5LIB='$PERL5LIB:${STAGING_LIBDIR}/perl/${PV}:${STAGING_LIBDIR}/perl${STAGING_LIBDIR}/perl:${STAGING_LIBDIR}/perl/site_perl/${PV}:${STAGING_LIBDIR}/perl/vendor_perl/${PV}' |
| 100 | |
| 101 | # Use /usr/bin/env nativeperl for the perl script. |
| 102 | for f in `grep -Il '#! *${bindir}/perl' ${D}/${bindir}/*`; do |
| 103 | sed -i -e 's|${bindir}/perl|/usr/bin/env nativeperl|' $f |
| 104 | done |
| 105 | } |
| 106 | |
| 107 | SYSROOT_PREPROCESS_FUNCS += "perl_sysroot_create_wrapper" |
| 108 | |
| 109 | perl_sysroot_create_wrapper () { |
| 110 | mkdir -p ${SYSROOT_DESTDIR}${bindir} |
| 111 | # Create a wrapper that /usr/bin/env perl will use to get perl-native. |
| 112 | # This MUST live in the normal bindir. |
| 113 | cat > ${SYSROOT_DESTDIR}${bindir}/../nativeperl << EOF |
| 114 | #!/bin/sh |
| 115 | realpath=\`readlink -fn \$0\` |
| 116 | exec \`dirname \$realpath\`/perl-native/perl "\$@" |
| 117 | EOF |
| 118 | chmod 0755 ${SYSROOT_DESTDIR}${bindir}/../nativeperl |
| 119 | cat ${SYSROOT_DESTDIR}${bindir}/../nativeperl |
| 120 | } |
| 121 | |
| 122 | # Fix the path in sstate |
| 123 | SSTATE_SCAN_FILES += "*.pm *.pod *.h *.pl *.sh" |