blob: 0e9d0c032ebb9f623ef865cbd3181f896297c98f [file] [log] [blame]
Andrew Geissler9aee5002022-03-30 16:27:02 +00001SUMMARY = "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 "
21SRC_URI:append:class-native = " \
22 file://perl-configpm-switch.patch \
23"
24SRC_URI:append:class-target = " \
25 file://encodefix.patch \
26"
27
28SRC_URI[perl.sha256sum] = "357951a491b0ba1ce3611263922feec78ccd581dddc24a446b033e25acf242a1"
29
30S = "${WORKDIR}/perl-${PV}"
31
32inherit upstream-version-is-even update-alternatives
33
34DEPENDS += "perlcross-native zlib virtual/crypt"
35
36PERL_LIB_VER = "${@'.'.join(d.getVar('PV').split('.')[0:2])}.0"
37
38PACKAGECONFIG ??= "gdbm"
39PACKAGECONFIG[bdb] = ",-Ui_db,db"
40PACKAGECONFIG[gdbm] = ",-Ui_gdbm,gdbm"
41
42# Don't generate comments in enc2xs output files. They are not reproducible
43export ENC2XS_NO_COMMENTS = "1"
44
45do_configure:prepend() {
46 cp -rfp ${STAGING_DATADIR_NATIVE}/perl-cross/* ${S}
47}
48
49do_configure:class-target() {
50 ./configure --prefix=${prefix} --libdir=${libdir} \
51 --target=${TARGET_SYS} \
52 -Duseshrplib \
53 -Dusethreads \
54 -Dsoname=libperl.so.5 \
55 -Dvendorprefix=${prefix} \
56 -Dvendorlibdir=${libdir} \
57 -Darchlibexp=${STAGING_LIBDIR}/perl5/${PV}/${TARGET_ARCH}-linux \
58 -Dlibpth='${libdir} ${base_libdir}' \
59 -Dglibpth='${libdir} ${base_libdir}' \
60 -Alddlflags=' ${LDFLAGS}' \
61 ${PACKAGECONFIG_CONFARGS}
62
63 #perl.c uses an ARCHLIB_EXP define to generate compile-time code that
64 #adds the archlibexp path to @INC during run-time initialization of a
65 #new perl interpreter.
66
67 #Because we've changed this value in a temporary way to make it
68 #possible to use ExtUtils::Embed in the target build (the temporary
69 #value in config.sh gets re-stripped out during packaging), the
70 #ARCHLIB_EXP value that gets generated still uses the temporary version
71 #instead of the original expected version (i.e. becauses it's in the
72 #generated config.h, it doesn't get stripped out during packaging like
73 #the others in config.sh).
74
75 sed -i -e "s,${STAGING_LIBDIR},${libdir},g" config.h
76}
77
78do_configure:class-nativesdk() {
79 ./configure --prefix=${prefix} \
80 --target=${TARGET_SYS} \
81 -Duseshrplib \
82 -Dusethreads \
83 -Dsoname=libperl.so.5 \
84 -Dvendorprefix=${prefix} \
85 -Darchlibexp=${STAGING_LIBDIR}/perl5/${PV}/${TARGET_ARCH}-linux \
86 -Alddlflags=' ${LDFLAGS}' \
87 ${PACKAGECONFIG_CONFARGS}
88
89 # See the comment above
90 sed -i -e "s,${STAGING_LIBDIR},${libdir},g" config.h
91}
92
93do_configure:class-native() {
94 ./configure --prefix=${prefix} \
95 -Dbin=${bindir}/perl-native \
96 -Duseshrplib \
97 -Dusethreads \
98 -Dsoname=libperl.so.5 \
99 -Dvendorprefix=${prefix} \
100 -Ui_xlocale \
101 -Alddlflags=' ${LDFLAGS}' \
102 ${PACKAGECONFIG_CONFARGS}
103}
104
105do_configure:append() {
106 if [ -n "$SOURCE_DATE_EPOCH" ]; then
107 PERL_BUILD_DATE="$(${PYTHON} -c "\
108from datetime import datetime, timezone; \
109print(datetime.fromtimestamp($SOURCE_DATE_EPOCH, timezone.utc).strftime('%a %b %d %H:%M:%S %Y')) \
110 ")"
111 echo "#define PERL_BUILD_DATE \"$PERL_BUILD_DATE\"" >> config.h
112 fi
113}
114
115do_compile() {
116 oe_runmake
117 # This isn't generated reliably so delete and re-generate.
118 # https://github.com/arsv/perl-cross/issues/86
119
120 if [ -e pod/perltoc.pod ]; then
121 bbnote Rebuilding perltoc.pod
122 rm -f pod/perltoc.pod
123 oe_runmake pod/perltoc.pod
124 fi
125}
126
127do_install() {
128 oe_runmake 'DESTDIR=${D}' install
129
130 install -d ${D}${libdir}/perl5
131 install -d ${D}${libdir}/perl5/${PV}/
132 install -d ${D}${libdir}/perl5/${PV}/ExtUtils/
133
134 # Save native config
135 install config.sh ${D}${libdir}/perl5
136 install lib/Config.pm ${D}${libdir}/perl5/${PV}/
137 install lib/ExtUtils/typemap ${D}${libdir}/perl5/${PV}/ExtUtils/
138
139 # Fix up shared library
140 dir=$(echo ${D}/${libdir}/perl5/${PV}/*/CORE)
141 rm $dir/libperl.so
142 ln -sf ../../../../libperl.so.${PERL_LIB_VER} $dir/libperl.so
143
144 # Try to catch Bug #13946
145 if [ -e ${D}/${libdir}/perl5/${PV}/Storable.pm ]; then
146 bbfatal 'non-arch specific Storable.pm found! See https://bugzilla.yoctoproject.org/show_bug.cgi?id=13946'
147 fi
148}
149
150do_install:append:class-target() {
151 # This is used to substitute target configuration when running native perl via perl-configpm-switch.patch
152 ln -s Config_heavy.pl ${D}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config_heavy-target.pl
153
154 # This contains host-specific information used for building miniperl (a helper executable built with host compiler)
155 # and therefore isn't reproducible. I believe the file isn't actually needed on target.
156 rm ${D}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/xconfig.h
157}
158
159do_install:append:class-nativesdk() {
160 # This is used to substitute target configuration when running native perl via perl-configpm-switch.patch
161 ln -s Config_heavy.pl ${D}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config_heavy-target.pl
162
163 create_wrapper ${D}${bindir}/perl \
164 PERL5LIB='$PERL5LIB:${SDKPATHNATIVE}/${libdir_nativesdk}/perl5/site_perl/${PV}:${SDKPATHNATIVE}/${libdir_nativesdk}/perl5/vendor_perl/${PV}:${SDKPATHNATIVE}/${libdir_nativesdk}/perl5/${PV}'
165}
166
167do_install:append:class-native () {
168 # Those wrappers mean that perl installed from sstate (which may change
169 # path location) works and that in the nativesdk case, the SDK can be
170 # installed to a different location from the one it was built for.
171 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}'
172
173 # Use /usr/bin/env nativeperl for the perl script.
174 for f in `grep -Il '#! *${bindir}/perl' ${D}/${bindir}/*`; do
175 sed -i -e 's|${bindir}/perl|/usr/bin/env nativeperl|' $f
176 done
177}
178
179PACKAGE_PREPROCESS_FUNCS += "perl_package_preprocess"
180
181perl_package_preprocess () {
182 # Fix up installed configuration
183 sed -i -e "s,${D},,g" \
184 -e "s,${DEBUG_PREFIX_MAP},,g" \
185 -e "s,--sysroot=${STAGING_DIR_HOST},,g" \
186 -e "s,-isystem${STAGING_INCDIR} ,,g" \
187 -e "s,${STAGING_LIBDIR},${libdir},g" \
188 -e "s,${STAGING_BINDIR},${bindir},g" \
189 -e "s,${STAGING_INCDIR},${includedir},g" \
190 -e "s,${STAGING_BINDIR_NATIVE}/perl-native/,${bindir}/,g" \
191 -e "s,${STAGING_BINDIR_NATIVE}/,,g" \
192 -e "s,${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX},${bindir},g" \
193 -e 's:${RECIPE_SYSROOT}::g' \
194 ${PKGD}${bindir}/h2xs.perl \
195 ${PKGD}${bindir}/h2ph.perl \
196 ${PKGD}${bindir}/pod2man.perl \
197 ${PKGD}${bindir}/pod2text.perl \
198 ${PKGD}${bindir}/pod2usage.perl \
199 ${PKGD}${bindir}/podchecker.perl \
200 ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/config.h \
201 ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/perl.h \
202 ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/pp.h \
203 ${PKGD}${libdir}/perl5/${PV}/Config.pm \
204 ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config.pm \
205 ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config.pod \
206 ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config_git.pl \
207 ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config_heavy.pl \
208 ${PKGD}${libdir}/perl5/${PV}/ExtUtils/Liblist/Kid.pm \
209 ${PKGD}${libdir}/perl5/${PV}/FileCache.pm \
210 ${PKGD}${libdir}/perl5/${PV}/pod/*.pod \
211 ${PKGD}${libdir}/perl5/config.sh
212}
213
214inherit update-alternatives
215
216ALTERNATIVE_PRIORITY = "100"
217
218ALTERNATIVE:${PN}-misc = "corelist cpan enc2xs encguess h2ph h2xs instmodsh json_pp libnetcfg \
219 piconv pl2pm pod2html pod2man pod2text pod2usage podchecker \
220 prove ptar ptardiff ptargrep shasum splain streamzip xsubpp zipdetails"
221ALTERNATIVE_LINK_NAME[corelist] = "${bindir}/corelist"
222ALTERNATIVE_LINK_NAME[cpan] = "${bindir}/cpan"
223ALTERNATIVE_LINK_NAME[enc2xs] = "${bindir}/enc2xs"
224ALTERNATIVE_LINK_NAME[encguess] = "${bindir}/encguess"
225ALTERNATIVE_LINK_NAME[h2ph] = "${bindir}/h2ph"
226ALTERNATIVE_LINK_NAME[h2xs] = "${bindir}/h2xs"
227ALTERNATIVE_LINK_NAME[instmodsh] = "${bindir}/instmodsh"
228ALTERNATIVE_LINK_NAME[json_pp] = "${bindir}/json_pp"
229ALTERNATIVE_LINK_NAME[libnetcfg] = "${bindir}/libnetcfg"
230ALTERNATIVE_LINK_NAME[piconv] = "${bindir}/piconv"
231ALTERNATIVE_LINK_NAME[pl2pm] = "${bindir}/pl2pm"
232ALTERNATIVE_LINK_NAME[pod2html] = "${bindir}/pod2html"
233ALTERNATIVE_LINK_NAME[pod2man] = "${bindir}/pod2man"
234ALTERNATIVE_LINK_NAME[pod2text] = "${bindir}/pod2text"
235ALTERNATIVE_LINK_NAME[pod2usage] = "${bindir}/pod2usage"
236ALTERNATIVE_LINK_NAME[podchecker] = "${bindir}/podchecker"
237ALTERNATIVE_LINK_NAME[prove] = "${bindir}/prove"
238ALTERNATIVE_LINK_NAME[ptar] = "${bindir}/ptar"
239ALTERNATIVE_LINK_NAME[ptardiff] = "${bindir}/ptardiff"
240ALTERNATIVE_LINK_NAME[ptargrep] = "${bindir}/ptargrep"
241ALTERNATIVE_LINK_NAME[shasum] = "${bindir}/shasum"
242ALTERNATIVE_LINK_NAME[splain] = "${bindir}/splain"
243ALTERNATIVE_LINK_NAME[streamzip] = "${bindir}/streamzip"
244ALTERNATIVE_LINK_NAME[xsubpp] = "${bindir}/xsubpp"
245ALTERNATIVE_LINK_NAME[zipdetails] = "${bindir}/zipdetails"
246
247require perl-ptest.inc
248
249FILES:${PN} = "${bindir}/perl ${bindir}/perl.real ${bindir}/perl${PV} ${libdir}/libperl.so* \
250 ${libdir}/perl5/site_perl \
251 ${libdir}/perl5/${PV}/Config.pm \
252 ${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config.pm \
253 ${libdir}/perl5/${PV}/*/Config_git.pl \
254 ${libdir}/perl5/${PV}/*/Config_heavy-target.pl \
255 ${libdir}/perl5/config.sh \
256 ${libdir}/perl5/${PV}/strict.pm \
257 ${libdir}/perl5/${PV}/warnings.pm \
258 ${libdir}/perl5/${PV}/warnings \
259 ${libdir}/perl5/${PV}/vars.pm \
260 ${libdir}/perl5/site_perl \
261 ${libdir}/perl5/${PV}/ExtUtils/MANIFEST.SKIP \
262 ${libdir}/perl5/${PV}/ExtUtils/xsubpp \
263 ${libdir}/perl5/${PV}/ExtUtils/typemap \
264 "
265RPROVIDES:${PN} += "perl-module-strict perl-module-vars perl-module-config perl-module-warnings \
266 perl-module-warnings-register"
267
268FILES:${PN}-staticdev:append = " ${libdir}/perl5/${PV}/*/CORE/libperl.a"
269
270FILES:${PN}-dev:append = " ${libdir}/perl5/${PV}/*/CORE"
271
272FILES:${PN}-doc:append = " ${libdir}/perl5/${PV}/Unicode/Collate/*.txt \
273 ${libdir}/perl5/${PV}/*/.packlist \
274 ${libdir}/perl5/${PV}/Encode/encode.h \
275 "
276PACKAGES += "${PN}-misc"
277
278FILES:${PN}-misc = "${bindir}/*"
279
280PACKAGES += "${PN}-pod"
281
282FILES:${PN}-pod = "${libdir}/perl5/${PV}/pod \
283 ${libdir}/perl5/${PV}/*.pod \
284 ${libdir}/perl5/${PV}/*/*.pod \
285 ${libdir}/perl5/${PV}/*/*/*.pod \
286 ${libdir}/perl5/${PV}/*/*/*/*.pod \
287 "
288
289PACKAGES += "${PN}-module-cpan ${PN}-module-unicore"
290
291FILES:${PN}-module-cpan += "${libdir}/perl5/${PV}/CPAN \
292 "
293FILES:${PN}-module-unicore += "${libdir}/perl5/${PV}/unicore"
294
295ALTERNATIVE_PRIORITY = "40"
296ALTERNATIVE:${PN}-doc = "Thread.3"
297ALTERNATIVE_LINK_NAME[Thread.3] = "${mandir}/man3/Thread.3"
298
299# Create a perl-modules package recommending all the other perl
300# packages (actually the non modules packages and not created too)
301ALLOW_EMPTY:${PN}-modules = "1"
302PACKAGES += "${PN}-modules "
303
304PACKAGESPLITFUNCS:prepend = "split_perl_packages "
305
306python split_perl_packages () {
307 libdir = d.expand('${libdir}/perl5/${PV}')
308 do_split_packages(d, libdir, r'.*/auto/([^.]*)/[^/]*\.(so|ld|ix|al)', '${PN}-module-%s', 'perl module %s', recursive=True, match_path=True, prepend=False)
309 do_split_packages(d, libdir, r'.*linux/([^\/]*)\.pm', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
310 do_split_packages(d, libdir, r'Module/([^\/]*)\.pm', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
311 do_split_packages(d, libdir, r'Module/([^\/]*)/.*', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
312 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)
313 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)
314
315 # perl-modules should recommend every perl module, and only the
316 # modules. Don't attempt to use the result of do_split_packages() as some
317 # modules are manually split (eg. perl-module-unicore).
318 packages = filter(lambda p: 'perl-module-' in p, d.getVar('PACKAGES').split())
319 d.setVar(d.expand("RRECOMMENDS:${PN}-modules"), ' '.join(packages))
320
321 # Read the pre-generated dependency file, and use it to set module dependecies
322 for line in open(d.expand("${WORKDIR}") + '/perl-rdepends.txt').readlines():
323 splitline = line.split()
324 # Filter empty lines and comments
325 if len(splitline) == 0 or splitline[0].startswith("#"):
326 continue
327 if bb.data.inherits_class('native', d):
328 module = splitline[0] + '-native'
329 depends = "perl-native"
330 else:
331 module = splitline[0].replace("RDEPENDS:perl", "RDEPENDS:${PN}")
332 depends = splitline[2].strip('"').replace("perl-module", "${PN}-module")
333 d.appendVar(d.expand(module), " " + depends)
334}
335
336python() {
337 if d.getVar('CLASSOVERRIDE') == "class-target":
338 d.setVar("PACKAGES_DYNAMIC", "^${MLPREFIX}perl-module-.*(?<!native)$")
339 elif d.getVar('CLASSOVERRIDE') == "class-native":
340 d.setVar("PACKAGES_DYNAMIC", "^perl-module-.*-native$")
341 elif d.getVar('CLASSOVERRIDE') == "class-nativesdk":
342 d.setVar("PACKAGES_DYNAMIC", "^nativesdk-perl-module-.*")
343}
344
345RDEPENDS:${PN}-misc += "perl perl-modules"
346RDEPENDS:${PN}-pod += "perl"
347
348BBCLASSEXTEND = "native nativesdk"
349
350SSTATE_SCAN_FILES += "*.pm *.pod *.h *.pl *.sh"
351
352do_create_rdepends_inc() {
353 cd ${WORKDIR}
354 cat <<'EOPREAMBLE' > ${WORKDIR}/perl-rdepends.inc
355
356# Some additional dependencies that the above doesn't manage to figure out
357RDEPENDS:${PN}-module-file-spec += "${PN}-module-file-spec-unix"
358RDEPENDS:${PN}-module-scalar-util += "${PN}-module-list-util"
359RDEPENDS:${PN}-module-file-temp += "${PN}-module-scalar-util"
360RDEPENDS:${PN}-module-file-temp += "${PN}-module-file-spec"
361RDEPENDS:${PN}-module-io-file += "${PN}-module-symbol"
362RDEPENDS:${PN}-module-io-file += "${PN}-module-carp"
363RDEPENDS:${PN}-module-math-bigint += "${PN}-module-math-bigint-calc"
364RDEPENDS:${PN}-module-test-builder += "${PN}-module-list-util"
365RDEPENDS:${PN}-module-test-builder += "${PN}-module-scalar-util"
366RDEPENDS:${PN}-module-test-builder-formatter += "${PN}-module-test2-formatter-tap"
367RDEPENDS:${PN}-module-test2-api += "${PN}-module-test2-event-fail"
368RDEPENDS:${PN}-module-test2-api += "${PN}-module-test2-event-pass"
369RDEPENDS:${PN}-module-test2-api += "${PN}-module-test2-event-v2"
370RDEPENDS:${PN}-module-test2-formatter-tap += "${PN}-module-test2-formatter"
371RDEPENDS:${PN}-module-thread-queue += "${PN}-module-attributes"
372RDEPENDS:${PN}-module-overload += "${PN}-module-overloading"
373
374# Generated depends list beyond this line
375EOPREAMBLE
376 test -e packages-split.new && rm -rf packages-split.new
377 cp -r packages-split packages-split.new && cd packages-split.new
378 find . -name \*.pm | xargs sed -i '/^=head/,/^=cut/d'
379 egrep -r "^\s*(\<use .*|\<require .*);?" perl-module-* --include="*.pm" | \
380 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:] | \
381 awk '{if ($3 != "\x22"$1"\x22"){ print $0}}'| \
382 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 | \
383 sort -u | \
384 sed 's/^/RDEPENDS:/;s/perl-module-/${PN}-module-/g;s/module-\(module-\)/\1/g;s/\(module-load\)-conditional/\1/g;s/encode-configlocal/&-pm/;' | \
385 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' | \
386 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
387 cat ${WORKDIR}/perl-rdepends.inc ${WORKDIR}/perl-rdepends.generated > ${THISDIR}/files/perl-rdepends.txt
388}
389
390# bitbake perl -c create_rdepends_inc
391addtask do_create_rdepends_inc
392
393SYSROOT_PREPROCESS_FUNCS += "perl_sysroot_create_wrapper"
394
395perl_sysroot_create_wrapper () {
396 mkdir -p ${SYSROOT_DESTDIR}${bindir}
397 # Create a wrapper that /usr/bin/env perl will use to get perl-native.
398 # This MUST live in the normal bindir.
399 cat > ${SYSROOT_DESTDIR}${bindir}/nativeperl << EOF
400#!/bin/sh
401realpath=\`readlink -fn \$0\`
402exec \`dirname \$realpath\`/perl-native/perl "\$@"
403EOF
404 chmod 0755 ${SYSROOT_DESTDIR}${bindir}/nativeperl
405 cat ${SYSROOT_DESTDIR}${bindir}/nativeperl
406}
407
408SSTATE_HASHEQUIV_FILEMAP = " \
409 populate_sysroot:*/lib*/perl5/*/*/Config_heavy.pl:${TMPDIR} \
410 populate_sysroot:*/lib*/perl5/*/*/Config_heavy.pl:${COREBASE} \
411 populate_sysroot:*/lib*/perl5/config.sh:${TMPDIR} \
412 populate_sysroot:*/lib*/perl5/config.sh:${COREBASE} \
413 "