1SUMMARY = "Perl scripting language"
2HOMEPAGE = "http://www.perl.org/"
3DESCRIPTION = "Perl is a highly capable, feature-rich programming language"
4SECTION = "devel"
5LICENSE = "Artistic-1.0 | GPL-1.0-or-later"
6LIC_FILES_CHKSUM = "file://Copying;md5=5b122a36d0f6dc55279a0ebc69f3c60b \
7                    file://Artistic;md5=71a4d5d9acc18c0952a6df2218bb68da \
8                    "
9
10
11SRC_URI = "https://www.cpan.org/src/5.0/perl-${PV}.tar.gz;name=perl \
12           file://perl-rdepends.txt \
13           file://0001-Somehow-this-module-breaks-through-the-perl-wrapper-.patch \
14           file://errno_ver.diff \
15           file://native-perlinc.patch \
16           file://perl-dynloader.patch \
17           file://0002-Constant-Fix-up-shebang.patch \
18           file://determinism.patch \
19           file://0001-cpan-Sys-Syslog-Makefile.PL-Fix-_PATH_LOG-for-determ.patch \
20           file://0001-Fix-intermittent-failure-of-test-t-op-sigsystem.t.patch \
21           "
22SRC_URI:append:class-native = " \
23           file://perl-configpm-switch.patch \
24"
25SRC_URI:append:class-target = " \
26           file://encodefix.patch \
27"
28
29SRC_URI[perl.sha256sum] = "a0a31534451eb7b83c7d6594a497543a54d488bc90ca00f5e34762577f40655e"
30
31B = "${WORKDIR}/perl-${PV}-build"
32
33inherit upstream-version-is-even update-alternatives
34
35DEPENDS += "perlcross-native zlib virtual/crypt"
36# make 4.1 has race issues with the double-colon usage of MakeMaker, see #14096
37DEPENDS += "make-native"
38
39PERL_LIB_VER = "${@'.'.join(d.getVar('PV').split('.')[0:2])}.0"
40
41PACKAGECONFIG ??= "gdbm"
42PACKAGECONFIG:append:libc-musl = " anylocale"
43PACKAGECONFIG[bdb] = ",-Ui_db,db"
44PACKAGECONFIG[gdbm] = ",-Ui_gdbm,gdbm"
45PACKAGECONFIG[anylocale] = "-Dd_setlocale_accepts_any_locale_name=define,,"
46
47# Don't generate comments in enc2xs output files. They are not reproducible
48export ENC2XS_NO_COMMENTS = "1"
49
50CFLAGS += "-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
51
52do_configure:prepend() {
53    rm -rf ${B}
54    cp -rfp ${S} ${B}
55    cp -rfp ${STAGING_DATADIR_NATIVE}/perl-cross/* ${B}
56    cd ${B}
57}
58
59do_configure:class-target() {
60    ./configure --prefix=${prefix} --libdir=${libdir} \
61    --target=${TARGET_SYS} \
62    -Duse64bitint \
63    -Duseshrplib \
64    -Dusethreads \
65    -Dsoname=libperl.so.5 \
66    -Dvendorprefix=${prefix} \
67    -Dvendorlibdir=${libdir} \
68    -Darchlibexp=${STAGING_LIBDIR}/perl5/${PV}/${TARGET_ARCH}-linux \
69    -Dlibpth='${libdir} ${base_libdir}' \
70    -Dglibpth='${libdir} ${base_libdir}' \
71    -Alddlflags=' ${LDFLAGS}' \
72    -Dd_gnulibc=define \
73    ${PACKAGECONFIG_CONFARGS}
74
75    #perl.c uses an ARCHLIB_EXP define to generate compile-time code that
76    #adds the archlibexp path to @INC during run-time initialization of a
77    #new perl interpreter.
78
79    #Because we've changed this value in a temporary way to make it
80    #possible to use ExtUtils::Embed in the target build (the temporary
81    #value in config.sh gets re-stripped out during packaging), the
82    #ARCHLIB_EXP value that gets generated still uses the temporary version
83    #instead of the original expected version (i.e. becauses it's in the
84    #generated config.h, it doesn't get stripped out during packaging like
85    #the others in config.sh).
86
87    sed -i -e "s,${STAGING_LIBDIR},${libdir},g" config.h
88}
89
90do_configure:class-nativesdk() {
91    ./configure --prefix=${prefix} \
92    --target=${TARGET_SYS} \
93    -Duseshrplib \
94    -Dusethreads \
95    -Dsoname=libperl.so.5 \
96    -Dvendorprefix=${prefix} \
97    -Darchlibexp=${STAGING_LIBDIR}/perl5/${PV}/${TARGET_ARCH}-linux \
98    -Alddlflags=' ${LDFLAGS}' \
99    ${PACKAGECONFIG_CONFARGS}
100
101    # See the comment above
102    sed -i -e "s,${STAGING_LIBDIR},${libdir},g" config.h
103}
104
105do_configure:class-native() {
106    ./configure --prefix=${prefix} \
107    -Dbin=${bindir}/perl-native \
108    -Duseshrplib \
109    -Dusethreads \
110    -Dsoname=libperl.so.5 \
111    -Dvendorprefix=${prefix} \
112    -Ui_xlocale \
113    -Alddlflags=' ${LDFLAGS}' \
114    ${PACKAGECONFIG_CONFARGS}
115
116    # This prevents leakage of build paths into perl-native binaries, which
117    # causes non-deterministic troubles when those paths no longer exist or aren't accessible.
118    sed -i -e "s,${STAGING_LIBDIR},/completelyboguspath,g" config.h
119}
120
121do_configure:append() {
122    if [ -n "$SOURCE_DATE_EPOCH" ]; then
123        PERL_BUILD_DATE="$(${PYTHON} -c "\
124from datetime import datetime, timezone; \
125print(datetime.fromtimestamp($SOURCE_DATE_EPOCH, timezone.utc).strftime('%a %b %d %H:%M:%S %Y')) \
126            ")"
127        echo "#define PERL_BUILD_DATE \"$PERL_BUILD_DATE\"" >> config.h
128    fi
129}
130
131do_compile() {
132    oe_runmake
133}
134
135do_install() {
136    oe_runmake 'DESTDIR=${D}' install
137
138    install -d ${D}${libdir}/perl5
139    install -d ${D}${libdir}/perl5/${PV}/
140    install -d ${D}${libdir}/perl5/${PV}/ExtUtils/
141
142    # Save native config
143    install config.sh ${D}${libdir}/perl5
144    install lib/Config.pm ${D}${libdir}/perl5/${PV}/
145    install lib/ExtUtils/typemap ${D}${libdir}/perl5/${PV}/ExtUtils/
146
147    # Fix up shared library
148    dir=$(echo ${D}/${libdir}/perl5/${PV}/*/CORE)
149    rm $dir/libperl.so
150    ln -sf ../../../../libperl.so.${PERL_LIB_VER} $dir/libperl.so
151
152    # Try to catch Bug #13946
153    if [ -e ${D}/${libdir}/perl5/${PV}/Storable.pm ]; then
154        bbfatal 'non-arch specific Storable.pm found! See https://bugzilla.yoctoproject.org/show_bug.cgi?id=13946'
155    fi
156}
157
158do_install:append:class-target() {
159    # This is used to substitute target configuration when running native perl via perl-configpm-switch.patch
160    ln -s Config_heavy.pl ${D}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config_heavy-target.pl
161
162    # xconfig.h contains references to build host architecture, and yet is included from various other places.
163    # To make it reproducible let's make it a copy of config.h patch that is specific to the target architecture.
164    # It is believed that the original header is the product of building miniperl (a helper executable built with host compiler).
165    cp ${D}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/config.h ${D}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/xconfig.h
166}
167
168do_install:append:class-nativesdk() {
169    # This is used to substitute target configuration when running native perl via perl-configpm-switch.patch
170    ln -s Config_heavy.pl ${D}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config_heavy-target.pl
171
172    create_wrapper ${D}${bindir}/perl \
173        PERL5LIB='$PERL5LIB:${SDKPATHNATIVE}/${libdir_nativesdk}/perl5/site_perl/${PV}:${SDKPATHNATIVE}/${libdir_nativesdk}/perl5/vendor_perl/${PV}:${SDKPATHNATIVE}/${libdir_nativesdk}/perl5/${PV}'
174}
175
176do_install:append:class-native () {
177    # Those wrappers mean that perl installed from sstate (which may change
178    # path location) works and that in the nativesdk case, the SDK can be
179    # installed to a different location from the one it was built for.
180    create_wrapper ${D}${bindir}/perl-native/perl PERL5LIB='$PERL5LIB:${STAGING_LIBDIR}/perl5/site_perl/${PV}:${STAGING_LIBDIR}/perl5/vendor_perl/${PV}:${STAGING_LIBDIR}/perl5/${PV}'
181
182    # Use /usr/bin/env nativeperl for the perl script.
183    for f in `grep -Il '#! *${bindir}/perl' ${D}/${bindir}/*`; do
184            sed -i -e 's|${bindir}/perl|/usr/bin/env nativeperl|' $f
185    done
186}
187
188PACKAGE_PREPROCESS_FUNCS += "perl_package_preprocess"
189
190perl_package_preprocess () {
191        # Fix up installed configuration
192        sed -i -e "s,${D},,g" \
193               -e "s,${DEBUG_PREFIX_MAP},,g" \
194               -e "s,--sysroot=${STAGING_DIR_HOST},,g" \
195               -e "s,-isystem${STAGING_INCDIR} ,,g" \
196               -e "s,${STAGING_LIBDIR},${libdir},g" \
197               -e "s,${STAGING_BINDIR},${bindir},g" \
198               -e "s,${STAGING_INCDIR},${includedir},g" \
199               -e "s,${STAGING_BINDIR_NATIVE}/perl-native/,${bindir}/,g" \
200               -e "s,${STAGING_BINDIR_NATIVE}/,,g" \
201               -e "s,${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX},${bindir},g" \
202               -e 's:${RECIPE_SYSROOT}::g' \
203            ${PKGD}${bindir}/h2xs.perl \
204            ${PKGD}${bindir}/h2ph.perl \
205            ${PKGD}${bindir}/pod2man.perl \
206            ${PKGD}${bindir}/pod2text.perl \
207            ${PKGD}${bindir}/pod2usage.perl \
208            ${PKGD}${bindir}/podchecker.perl \
209            ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/config.h \
210            ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/xconfig.h \
211            ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/perl.h \
212            ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/pp.h \
213            ${PKGD}${libdir}/perl5/${PV}/Config.pm \
214            ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config.pm \
215            ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config.pod \
216            ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config_git.pl \
217            ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config_heavy.pl \
218            ${PKGD}${libdir}/perl5/${PV}/ExtUtils/Liblist/Kid.pm \
219            ${PKGD}${libdir}/perl5/${PV}/FileCache.pm \
220            ${PKGD}${libdir}/perl5/${PV}/pod/*.pod \
221            ${PKGD}${libdir}/perl5/config.sh
222}
223
224inherit update-alternatives
225
226ALTERNATIVE_PRIORITY = "100"
227
228ALTERNATIVE:${PN}-misc = "corelist cpan enc2xs encguess h2ph h2xs instmodsh json_pp libnetcfg \
229                     piconv pl2pm pod2html pod2man pod2text pod2usage podchecker \
230                     prove ptar ptardiff ptargrep shasum splain streamzip xsubpp zipdetails"
231ALTERNATIVE_LINK_NAME[corelist] = "${bindir}/corelist"
232ALTERNATIVE_LINK_NAME[cpan] = "${bindir}/cpan"
233ALTERNATIVE_LINK_NAME[enc2xs] = "${bindir}/enc2xs"
234ALTERNATIVE_LINK_NAME[encguess] = "${bindir}/encguess"
235ALTERNATIVE_LINK_NAME[h2ph] = "${bindir}/h2ph"
236ALTERNATIVE_LINK_NAME[h2xs] = "${bindir}/h2xs"
237ALTERNATIVE_LINK_NAME[instmodsh] = "${bindir}/instmodsh"
238ALTERNATIVE_LINK_NAME[json_pp] = "${bindir}/json_pp"
239ALTERNATIVE_LINK_NAME[libnetcfg] = "${bindir}/libnetcfg"
240ALTERNATIVE_LINK_NAME[piconv] = "${bindir}/piconv"
241ALTERNATIVE_LINK_NAME[pl2pm] = "${bindir}/pl2pm"
242ALTERNATIVE_LINK_NAME[pod2html] = "${bindir}/pod2html"
243ALTERNATIVE_LINK_NAME[pod2man] = "${bindir}/pod2man"
244ALTERNATIVE_LINK_NAME[pod2text] = "${bindir}/pod2text"
245ALTERNATIVE_LINK_NAME[pod2usage] = "${bindir}/pod2usage"
246ALTERNATIVE_LINK_NAME[podchecker] = "${bindir}/podchecker"
247ALTERNATIVE_LINK_NAME[prove] = "${bindir}/prove"
248ALTERNATIVE_LINK_NAME[ptar] = "${bindir}/ptar"
249ALTERNATIVE_LINK_NAME[ptardiff] = "${bindir}/ptardiff"
250ALTERNATIVE_LINK_NAME[ptargrep] = "${bindir}/ptargrep"
251ALTERNATIVE_LINK_NAME[shasum] = "${bindir}/shasum"
252ALTERNATIVE_LINK_NAME[splain] = "${bindir}/splain"
253ALTERNATIVE_LINK_NAME[streamzip] = "${bindir}/streamzip"
254ALTERNATIVE_LINK_NAME[xsubpp] = "${bindir}/xsubpp"
255ALTERNATIVE_LINK_NAME[zipdetails] = "${bindir}/zipdetails"
256
257require perl-ptest.inc
258
259FILES:${PN} = "${bindir}/perl ${bindir}/perl.real ${bindir}/perl${PV} ${libdir}/libperl.so* \
260               ${libdir}/perl5/site_perl \
261               ${libdir}/perl5/${PV}/Config.pm \
262               ${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config.pm \
263               ${libdir}/perl5/${PV}/*/Config_git.pl \
264               ${libdir}/perl5/${PV}/*/Config_heavy-target.pl \
265               ${libdir}/perl5/config.sh \
266               ${libdir}/perl5/${PV}/strict.pm \
267               ${libdir}/perl5/${PV}/warnings.pm \
268               ${libdir}/perl5/${PV}/warnings \
269               ${libdir}/perl5/${PV}/vars.pm \
270               ${libdir}/perl5/site_perl \
271               ${libdir}/perl5/${PV}/ExtUtils/MANIFEST.SKIP \
272               ${libdir}/perl5/${PV}/ExtUtils/xsubpp \
273               ${libdir}/perl5/${PV}/ExtUtils/typemap \
274               "
275RPROVIDES:${PN} += "perl-module-strict perl-module-vars perl-module-config perl-module-warnings \
276                    perl-module-warnings-register perl-module-config-git"
277
278FILES:${PN}-staticdev:append = " ${libdir}/perl5/${PV}/*/CORE/libperl.a"
279
280FILES:${PN}-dev:append = " ${libdir}/perl5/${PV}/*/CORE"
281
282FILES:${PN}-doc:append = " ${libdir}/perl5/${PV}/Unicode/Collate/*.txt \
283                           ${libdir}/perl5/${PV}/*/.packlist \
284                           ${libdir}/perl5/${PV}/Encode/encode.h \
285                         "
286PACKAGES += "${PN}-misc"
287
288FILES:${PN}-misc = "${bindir}/*"
289
290PACKAGES += "${PN}-pod"
291
292FILES:${PN}-pod = "${libdir}/perl5/${PV}/pod \
293                   ${libdir}/perl5/${PV}/*.pod \
294                   ${libdir}/perl5/${PV}/*/*.pod \
295                   ${libdir}/perl5/${PV}/*/*/*.pod \
296                   ${libdir}/perl5/${PV}/*/*/*/*.pod \
297                  "
298
299PACKAGES += "${PN}-module-cpan ${PN}-module-unicore"
300
301FILES:${PN}-module-cpan += "${libdir}/perl5/${PV}/CPAN \
302                          "
303FILES:${PN}-module-unicore += "${libdir}/perl5/${PV}/unicore"
304
305ALTERNATIVE_PRIORITY = "40"
306ALTERNATIVE:${PN}-doc = "Thread.3"
307ALTERNATIVE_LINK_NAME[Thread.3] = "${mandir}/man3/Thread.3"
308
309# Create a perl-modules package that represents the collection of all the
310# other perl packages (actually the non modules packages and not created too).
311ALLOW_EMPTY:${PN}-modules = "1"
312PACKAGES += "${PN}-modules "
313
314PACKAGESPLITFUNCS =+ "split_perl_packages"
315
316python split_perl_packages () {
317    libdir = d.expand('${libdir}/perl5/${PV}')
318    do_split_packages(d, libdir, r'.*/auto/([^.]*)/[^/]*\.(so|ld|ix|al)', '${PN}-module-%s', 'perl module %s', recursive=True, match_path=True, prepend=False)
319    do_split_packages(d, libdir, r'.*linux/([^\/]*)\.pm', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
320    do_split_packages(d, libdir, r'Module/([^\/]*)\.pm', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
321    do_split_packages(d, libdir, r'Module/([^\/]*)/.*', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
322    do_split_packages(d, libdir, r'.*linux/([^\/].*)\.(pm|pl|e2x)', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
323    do_split_packages(d, libdir, r'(^(?!(CPAN\/|CPANPLUS\/|Module\/|unicore\/|.*linux\/)[^\/]).*)\.(pm|pl|e2x)', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
324
325    # perl-modules should runtime-depend on every perl module, and only the
326    # modules. Don't attempt to use the result of do_split_packages() as some
327    # modules are manually split (eg. perl-module-unicore). Also, the split
328    # packages should not include packages defined in RPROVIDES:${PN}.
329    perl_sub_pkgs = d.getVar(d.expand("RPROVIDES:${PN}")).split()
330    packages = filter(lambda p: 'perl-module-' in p and p not in perl_sub_pkgs, d.getVar('PACKAGES').split())
331    d.setVar(d.expand("RDEPENDS:${PN}-modules"), ' '.join(packages))
332
333    # Read the pre-generated dependency file, and use it to set module dependecies
334    for line in open(d.getVar("UNPACKDIR") + '/perl-rdepends.txt').readlines():
335        splitline = line.split()
336        # Filter empty lines and comments
337        if len(splitline) == 0 or splitline[0].startswith("#"):
338            continue
339        if bb.data.inherits_class('native', d):
340            module = splitline[0] + '-native'
341            depends = "perl-native"
342        else:
343            module = splitline[0].replace("RDEPENDS:perl", "RDEPENDS:${PN}")
344            depends = splitline[2].strip('"').replace("perl-module", "${PN}-module")
345        d.appendVar(d.expand(module), " " + depends)
346}
347
348python() {
349    if d.getVar('CLASSOVERRIDE') == "class-target":
350        d.setVar("PACKAGES_DYNAMIC", "^${MLPREFIX}perl-module-.*(?<!native)$")
351    elif d.getVar('CLASSOVERRIDE') == "class-native":
352        d.setVar("PACKAGES_DYNAMIC", "^perl-module-.*-native$")
353    elif d.getVar('CLASSOVERRIDE') == "class-nativesdk":
354        d.setVar("PACKAGES_DYNAMIC", "^nativesdk-perl-module-.*")
355}
356
357RDEPENDS:${PN}-misc += "perl"
358RRECOMMENDS:${PN}-misc += "perl-modules"
359RDEPENDS:${PN}-pod += "perl"
360
361BBCLASSEXTEND = "native nativesdk"
362
363SSTATE_SCAN_FILES += "*.pm *.pod *.h *.pl *.sh"
364
365do_create_rdepends_inc() {
366    cd ${WORKDIR}
367    cat <<'EOPREAMBLE' > ${WORKDIR}/perl-rdepends.inc
368
369# Some additional dependencies that the above doesn't manage to figure out
370RDEPENDS:${PN}-module-file-spec += "${PN}-module-file-spec-unix"
371RDEPENDS:${PN}-module-scalar-util += "${PN}-module-list-util"
372RDEPENDS:${PN}-module-file-temp += "${PN}-module-scalar-util"
373RDEPENDS:${PN}-module-file-temp += "${PN}-module-file-spec"
374RDEPENDS:${PN}-module-io-file += "${PN}-module-symbol"
375RDEPENDS:${PN}-module-io-file += "${PN}-module-carp"
376RDEPENDS:${PN}-module-math-bigint += "${PN}-module-math-bigint-calc"
377RDEPENDS:${PN}-module-test-builder += "${PN}-module-list-util"
378RDEPENDS:${PN}-module-test-builder += "${PN}-module-scalar-util"
379RDEPENDS:${PN}-module-test-builder-formatter += "${PN}-module-test2-formatter-tap"
380RDEPENDS:${PN}-module-test2-api += "${PN}-module-test2-event-fail"
381RDEPENDS:${PN}-module-test2-api += "${PN}-module-test2-event-pass"
382RDEPENDS:${PN}-module-test2-api += "${PN}-module-test2-event-v2"
383RDEPENDS:${PN}-module-test2-formatter-tap += "${PN}-module-test2-formatter"
384RDEPENDS:${PN}-module-thread-queue += "${PN}-module-attributes"
385RDEPENDS:${PN}-module-overload += "${PN}-module-overloading"
386
387# Generated depends list beyond this line
388EOPREAMBLE
389    test -e packages-split.new && rm -rf packages-split.new
390    cp -r packages-split packages-split.new && cd packages-split.new
391    find . -name \*.pm | xargs sed -i '/^=head/,/^=cut/d'
392    egrep -r "^\s*(\<use .*|\<require .*);?" perl-module-* --include="*.pm" | \
393    sed "s/\/.*\.pm: */ += /g;s/[\"\']//g;s/;.*/\"/g;s/+= .*\(require\|use\)\> */+= \"perl-module-/g;s/CPANPLUS::.*/cpanplus/g;s/CPAN::.*/cpan/g;s/::/-/g;s/ [^+\"].*//g;s/_/-/g;s/\.pl\"$/\"/;s/\"\?\$/\"/;s/(//;s/)//;" | tr [:upper:] [:lower:] | \
394    awk '{if ($3 != "\x22"$1"\x22"){ print $0}}'| \
395    grep -v -e "\-vms\-" -e module-5 -e "^$" -e "\\$" -e your -e tk -e autoperl -e html -e http -e parse-cpan -e perl-ostype -e ndbm-file -e module-mac -e fcgi -e lwp -e dbd -e dbix | \
396    sort -u | \
397    sed 's/^/RDEPENDS:/;s/perl-module-/${PN}-module-/g;s/module-\(module-\)/\1/g;s/\(module-load\)-conditional/\1/g;s/encode-configlocal/&-pm/;' | \
398    egrep -wv '=>|module-a|module-apache.?|module-apr|module-authen-sasl|module-b-asmdata|module-convert-ebcdic|module-devel-size|module-digest-perl-md5|module-dumpvalue|module-extutils-constant-aaargh56hash|module-extutils-xssymset|module-file-bsdglob|module-for|module-it|module-io-socket-inet6|module-io-socket-ssl|module-io-string|module-ipc-system-simple|module-lexical|module-local-lib|metadata|module-modperl-util|module-pluggable-object|module-test-builder-io-scalar|module-text-unidecode|module-unicore|module-win32|objects\sload|syscall.ph|systeminfo.ph|%s' | \
399    egrep -wv '=>|module-algorithm-diff|module-carp|module-c<extutils-mm-unix>|module-l<extutils-mm-unix>|module-encode-hanextra|module-extutils-makemaker-version-regex|module-file-spec|module-io-compress-lzma|module-io-uncompress-unxz|module-locale-maketext-lexicon|module-log-agent|module-meta-notation|module-net-localcfg|module-net-ping-external|module-b-deparse|module-scalar-util|module-some-module|module-symbol|module-uri|module-win32api-file' > ${WORKDIR}/perl-rdepends.generated
400    cat ${WORKDIR}/perl-rdepends.inc ${WORKDIR}/perl-rdepends.generated > ${THISDIR}/files/perl-rdepends.txt
401}
402
403# bitbake perl -c create_rdepends_inc
404addtask do_create_rdepends_inc
405
406SYSROOT_PREPROCESS_FUNCS += "perl_sysroot_create_wrapper"
407
408perl_sysroot_create_wrapper () {
409       mkdir -p ${SYSROOT_DESTDIR}${bindir}
410       # Create a wrapper that /usr/bin/env perl will use to get perl-native.
411       # This MUST live in the normal bindir.
412       cat > ${SYSROOT_DESTDIR}${bindir}/nativeperl << EOF
413#!/bin/sh
414realpath=\`readlink -fn \$0\`
415exec \`dirname \$realpath\`/perl-native/perl "\$@"
416EOF
417       chmod 0755 ${SYSROOT_DESTDIR}${bindir}/nativeperl
418       cat ${SYSROOT_DESTDIR}${bindir}/nativeperl
419}
420
421SSTATE_HASHEQUIV_FILEMAP = " \
422    populate_sysroot:*/lib*/perl5/*/*/Config_heavy.pl:${TMPDIR} \
423    populate_sysroot:*/lib*/perl5/*/*/Config_heavy.pl:${COREBASE} \
424    populate_sysroot:*/lib*/perl5/config.sh:${TMPDIR} \
425    populate_sysroot:*/lib*/perl5/config.sh:${COREBASE} \
426    "
427