blob: 7935a5872362b500cfb1c8846cc33fda9ce752d7 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "Perl scripting language"
2HOMEPAGE = "http://www.perl.org/"
Andrew Geissler90fd73c2021-03-05 15:25:55 -06003DESCRIPTION = "Perl is a highly capable, feature-rich programming language"
Andrew Geissler82c905d2020-04-13 13:39:40 -05004SECTION = "devel"
5LICENSE = "Artistic-1.0 | GPL-1.0+"
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 \
Andrew Geissler82c905d2020-04-13 13:39:40 -050012 file://perl-rdepends.txt \
Andrew Geissler82c905d2020-04-13 13:39:40 -050013 file://0001-ExtUtils-MakeMaker-add-LDFLAGS-when-linking-binary-m.patch \
14 file://0001-Somehow-this-module-breaks-through-the-perl-wrapper-.patch \
15 file://errno_ver.diff \
16 file://native-perlinc.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050017 file://perl-dynloader.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050018 file://0002-Constant-Fix-up-shebang.patch \
Andrew Geissler09036742021-06-25 14:25:14 -050019 file://determinism.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050020 "
21SRC_URI_append_class-native = " \
22 file://perl-configpm-switch.patch \
23"
24SRC_URI_append_class-target = " \
25 file://encodefix.patch \
26"
27
Andrew Geissler09036742021-06-25 14:25:14 -050028SRC_URI[perl.sha256sum] = "551efc818b968b05216024fb0b727ef2ad4c100f8cb6b43fab615fa78ae5be9a"
Andrew Geissler82c905d2020-04-13 13:39:40 -050029
30S = "${WORKDIR}/perl-${PV}"
31
32inherit upstream-version-is-even update-alternatives
33
Andrew Geissler09036742021-06-25 14:25:14 -050034DEPENDS += "perlcross-native zlib virtual/crypt"
Andrew Geissler82c905d2020-04-13 13:39:40 -050035
36PERL_LIB_VER = "${@'.'.join(d.getVar('PV').split('.')[0:2])}.0"
37
38PACKAGECONFIG ??= "bdb 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
Andrew Geissler09036742021-06-25 14:25:14 -050045do_configure_prepend() {
46 cp -rfp ${STAGING_DATADIR_NATIVE}/perl-cross/* ${S}
Andrew Geissler82c905d2020-04-13 13:39:40 -050047}
48
49do_configure_class-target() {
50 ./configure --prefix=${prefix} --libdir=${libdir} \
51 --target=${TARGET_SYS} \
52 -Duseshrplib \
53 -Dsoname=libperl.so.5 \
54 -Dvendorprefix=${prefix} \
55 -Darchlibexp=${STAGING_LIBDIR}/perl5/${PV}/${TARGET_ARCH}-linux \
56 ${PACKAGECONFIG_CONFARGS}
57
58 #perl.c uses an ARCHLIB_EXP define to generate compile-time code that
59 #adds the archlibexp path to @INC during run-time initialization of a
60 #new perl interpreter.
61
62 #Because we've changed this value in a temporary way to make it
63 #possible to use ExtUtils::Embed in the target build (the temporary
64 #value in config.sh gets re-stripped out during packaging), the
65 #ARCHLIB_EXP value that gets generated still uses the temporary version
66 #instead of the original expected version (i.e. becauses it's in the
67 #generated config.h, it doesn't get stripped out during packaging like
68 #the others in config.sh).
69
70 sed -i -e "s,${STAGING_LIBDIR},${libdir},g" config.h
71}
72
73do_configure_class-nativesdk() {
74 ./configure --prefix=${prefix} \
75 --target=${TARGET_SYS} \
76 -Duseshrplib \
77 -Dsoname=libperl.so.5 \
78 -Dvendorprefix=${prefix} \
79 -Darchlibexp=${STAGING_LIBDIR}/perl5/${PV}/${TARGET_ARCH}-linux \
80 ${PACKAGECONFIG_CONFARGS}
81
82 # See the comment above
83 sed -i -e "s,${STAGING_LIBDIR},${libdir},g" config.h
84}
85
86do_configure_class-native() {
87 ./configure --prefix=${prefix} \
88 -Dbin=${bindir}/perl-native \
89 -Duseshrplib \
90 -Dsoname=libperl.so.5 \
91 -Dvendorprefix=${prefix} \
92 -Ui_xlocale \
93 ${PACKAGECONFIG_CONFARGS}
94}
95
96do_configure_append() {
97 if [ -n "$SOURCE_DATE_EPOCH" ]; then
98 PERL_BUILD_DATE="$(${PYTHON} -c "\
99from datetime import datetime, timezone; \
100print(datetime.fromtimestamp($SOURCE_DATE_EPOCH, timezone.utc).strftime('%a %b %d %H:%M:%S %Y')) \
101 ")"
102 echo "#define PERL_BUILD_DATE \"$PERL_BUILD_DATE\"" >> config.h
103 fi
104}
105
106do_compile() {
107 oe_runmake
108 # This isn't generated reliably so delete and re-generate.
109 # https://github.com/arsv/perl-cross/issues/86
110
111 if [ -e pod/perltoc.pod ]; then
112 bbnote Rebuilding perltoc.pod
113 rm -f pod/perltoc.pod
114 oe_runmake pod/perltoc.pod
115 fi
116}
117
118do_install() {
119 oe_runmake 'DESTDIR=${D}' install
120
121 install -d ${D}${libdir}/perl5
122 install -d ${D}${libdir}/perl5/${PV}/
123 install -d ${D}${libdir}/perl5/${PV}/ExtUtils/
124
125 # Save native config
126 install config.sh ${D}${libdir}/perl5
127 install lib/Config.pm ${D}${libdir}/perl5/${PV}/
128 install lib/ExtUtils/typemap ${D}${libdir}/perl5/${PV}/ExtUtils/
129
130 # Fix up shared library
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600131 dir=$(echo ${D}/${libdir}/perl5/${PV}/*/CORE)
132 rm $dir/libperl.so
133 ln -sf ../../../../libperl.so.${PERL_LIB_VER} $dir/libperl.so
Andrew Geissler635e0e42020-08-21 15:58:33 -0500134
135 # Try to catch Bug #13946
136 if [ -e ${D}/${libdir}/perl5/${PV}/Storable.pm ]; then
137 bbfatal 'non-arch specific Storable.pm found! See https://bugzilla.yoctoproject.org/show_bug.cgi?id=13946'
138 fi
Andrew Geissler82c905d2020-04-13 13:39:40 -0500139}
140
141do_install_append_class-target() {
142 # This is used to substitute target configuration when running native perl via perl-configpm-switch.patch
143 ln -s Config_heavy.pl ${D}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config_heavy-target.pl
144
145 # This contains host-specific information used for building miniperl (a helper executable built with host compiler)
146 # and therefore isn't reproducible. I believe the file isn't actually needed on target.
147 rm ${D}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/xconfig.h
148}
149
150do_install_append_class-nativesdk() {
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 create_wrapper ${D}${bindir}/perl \
Andrew Geisslerd25ed322020-06-27 00:28:28 -0500155 PERL5LIB='$PERL5LIB:${SDKPATHNATIVE}/${libdir_nativesdk}/perl5/site_perl/${PV}:${SDKPATHNATIVE}/${libdir_nativesdk}/perl5/vendor_perl/${PV}:${SDKPATHNATIVE}/${libdir_nativesdk}/perl5/${PV}'
Andrew Geissler82c905d2020-04-13 13:39:40 -0500156}
157
158do_install_append_class-native () {
159 # Those wrappers mean that perl installed from sstate (which may change
160 # path location) works and that in the nativesdk case, the SDK can be
161 # installed to a different location from the one it was built for.
162 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}'
163
164 # Use /usr/bin/env nativeperl for the perl script.
165 for f in `grep -Il '#! *${bindir}/perl' ${D}/${bindir}/*`; do
166 sed -i -e 's|${bindir}/perl|/usr/bin/env nativeperl|' $f
167 done
168}
169
170PACKAGE_PREPROCESS_FUNCS += "perl_package_preprocess"
171
172perl_package_preprocess () {
173 # Fix up installed configuration
174 sed -i -e "s,${D},,g" \
175 -e "s,${DEBUG_PREFIX_MAP},,g" \
176 -e "s,--sysroot=${STAGING_DIR_HOST},,g" \
177 -e "s,-isystem${STAGING_INCDIR} ,,g" \
178 -e "s,${STAGING_LIBDIR},${libdir},g" \
179 -e "s,${STAGING_BINDIR},${bindir},g" \
180 -e "s,${STAGING_INCDIR},${includedir},g" \
181 -e "s,${STAGING_BINDIR_NATIVE}/perl-native/,${bindir}/,g" \
182 -e "s,${STAGING_BINDIR_NATIVE}/,,g" \
183 -e "s,${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX},${bindir},g" \
184 -e 's:${RECIPE_SYSROOT}::g' \
185 ${PKGD}${bindir}/h2xs.perl \
186 ${PKGD}${bindir}/h2ph.perl \
187 ${PKGD}${bindir}/pod2man.perl \
188 ${PKGD}${bindir}/pod2text.perl \
189 ${PKGD}${bindir}/pod2usage.perl \
190 ${PKGD}${bindir}/podchecker.perl \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500191 ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/config.h \
192 ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/perl.h \
193 ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/pp.h \
194 ${PKGD}${libdir}/perl5/${PV}/Config.pm \
195 ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config.pm \
196 ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config.pod \
197 ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config_git.pl \
198 ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config_heavy.pl \
199 ${PKGD}${libdir}/perl5/${PV}/ExtUtils/Liblist/Kid.pm \
200 ${PKGD}${libdir}/perl5/${PV}/FileCache.pm \
201 ${PKGD}${libdir}/perl5/${PV}/pod/*.pod \
202 ${PKGD}${libdir}/perl5/config.sh
203}
204
205inherit update-alternatives
206
207ALTERNATIVE_PRIORITY = "100"
208
209ALTERNATIVE_${PN}-misc = "corelist cpan enc2xs encguess h2ph h2xs instmodsh json_pp libnetcfg \
Andrew Geissler475cb722020-07-10 16:00:51 -0500210 piconv pl2pm pod2html pod2man pod2text pod2usage podchecker \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500211 prove ptar ptardiff ptargrep shasum splain xsubpp zipdetails"
212ALTERNATIVE_LINK_NAME[corelist] = "${bindir}/corelist"
213ALTERNATIVE_LINK_NAME[cpan] = "${bindir}/cpan"
214ALTERNATIVE_LINK_NAME[enc2xs] = "${bindir}/enc2xs"
215ALTERNATIVE_LINK_NAME[encguess] = "${bindir}/encguess"
216ALTERNATIVE_LINK_NAME[h2ph] = "${bindir}/h2ph"
217ALTERNATIVE_LINK_NAME[h2xs] = "${bindir}/h2xs"
218ALTERNATIVE_LINK_NAME[instmodsh] = "${bindir}/instmodsh"
219ALTERNATIVE_LINK_NAME[json_pp] = "${bindir}/json_pp"
220ALTERNATIVE_LINK_NAME[libnetcfg] = "${bindir}/libnetcfg"
221ALTERNATIVE_LINK_NAME[piconv] = "${bindir}/piconv"
222ALTERNATIVE_LINK_NAME[pl2pm] = "${bindir}/pl2pm"
223ALTERNATIVE_LINK_NAME[pod2html] = "${bindir}/pod2html"
224ALTERNATIVE_LINK_NAME[pod2man] = "${bindir}/pod2man"
225ALTERNATIVE_LINK_NAME[pod2text] = "${bindir}/pod2text"
226ALTERNATIVE_LINK_NAME[pod2usage] = "${bindir}/pod2usage"
227ALTERNATIVE_LINK_NAME[podchecker] = "${bindir}/podchecker"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500228ALTERNATIVE_LINK_NAME[prove] = "${bindir}/prove"
229ALTERNATIVE_LINK_NAME[ptar] = "${bindir}/ptar"
230ALTERNATIVE_LINK_NAME[ptardiff] = "${bindir}/ptardiff"
231ALTERNATIVE_LINK_NAME[ptargrep] = "${bindir}/ptargrep"
232ALTERNATIVE_LINK_NAME[shasum] = "${bindir}/shasum"
233ALTERNATIVE_LINK_NAME[splain] = "${bindir}/splain"
234ALTERNATIVE_LINK_NAME[xsubpp] = "${bindir}/xsubpp"
235ALTERNATIVE_LINK_NAME[zipdetails] = "${bindir}/zipdetails"
236
237require perl-ptest.inc
238
239FILES_${PN} = "${bindir}/perl ${bindir}/perl.real ${bindir}/perl${PV} ${libdir}/libperl.so* \
240 ${libdir}/perl5/site_perl \
241 ${libdir}/perl5/${PV}/Config.pm \
242 ${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config.pm \
243 ${libdir}/perl5/${PV}/*/Config_git.pl \
244 ${libdir}/perl5/${PV}/*/Config_heavy-target.pl \
245 ${libdir}/perl5/config.sh \
246 ${libdir}/perl5/${PV}/strict.pm \
247 ${libdir}/perl5/${PV}/warnings.pm \
248 ${libdir}/perl5/${PV}/warnings \
249 ${libdir}/perl5/${PV}/vars.pm \
250 ${libdir}/perl5/site_perl \
251 ${libdir}/perl5/${PV}/ExtUtils/MANIFEST.SKIP \
252 ${libdir}/perl5/${PV}/ExtUtils/xsubpp \
253 ${libdir}/perl5/${PV}/ExtUtils/typemap \
254 "
255RPROVIDES_${PN} += "perl-module-strict perl-module-vars perl-module-config perl-module-warnings \
256 perl-module-warnings-register"
257
258FILES_${PN}-staticdev_append = " ${libdir}/perl5/${PV}/*/CORE/libperl.a"
259
260FILES_${PN}-dev_append = " ${libdir}/perl5/${PV}/*/CORE"
261
262FILES_${PN}-doc_append = " ${libdir}/perl5/${PV}/Unicode/Collate/*.txt \
263 ${libdir}/perl5/${PV}/*/.packlist \
264 ${libdir}/perl5/${PV}/Encode/encode.h \
265 "
266PACKAGES += "${PN}-misc"
267
268FILES_${PN}-misc = "${bindir}/*"
269
270PACKAGES += "${PN}-pod"
271
272FILES_${PN}-pod = "${libdir}/perl5/${PV}/pod \
273 ${libdir}/perl5/${PV}/*.pod \
274 ${libdir}/perl5/${PV}/*/*.pod \
275 ${libdir}/perl5/${PV}/*/*/*.pod \
276 ${libdir}/perl5/${PV}/*/*/*/*.pod \
277 "
278
279PACKAGES += "${PN}-module-cpan ${PN}-module-unicore"
280
281FILES_${PN}-module-cpan += "${libdir}/perl5/${PV}/CPAN \
282 "
283FILES_${PN}-module-unicore += "${libdir}/perl5/${PV}/unicore"
284
285ALTERNATIVE_PRIORITY = "40"
286ALTERNATIVE_${PN}-doc = "Thread.3"
287ALTERNATIVE_LINK_NAME[Thread.3] = "${mandir}/man3/Thread.3"
288
289# Create a perl-modules package recommending all the other perl
290# packages (actually the non modules packages and not created too)
291ALLOW_EMPTY_${PN}-modules = "1"
292PACKAGES += "${PN}-modules "
293
294PACKAGESPLITFUNCS_prepend = "split_perl_packages "
295
296python split_perl_packages () {
297 libdir = d.expand('${libdir}/perl5/${PV}')
298 do_split_packages(d, libdir, r'.*/auto/([^.]*)/[^/]*\.(so|ld|ix|al)', '${PN}-module-%s', 'perl module %s', recursive=True, match_path=True, prepend=False)
299 do_split_packages(d, libdir, r'.*linux/([^\/]*)\.pm', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
300 do_split_packages(d, libdir, r'Module/([^\/]*)\.pm', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
301 do_split_packages(d, libdir, r'Module/([^\/]*)/.*', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
302 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)
Andrew Geisslerd25ed322020-06-27 00:28:28 -0500303 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)
Andrew Geissler82c905d2020-04-13 13:39:40 -0500304
305 # perl-modules should recommend every perl module, and only the
306 # modules. Don't attempt to use the result of do_split_packages() as some
307 # modules are manually split (eg. perl-module-unicore).
308 packages = filter(lambda p: 'perl-module-' in p, d.getVar('PACKAGES').split())
309 d.setVar(d.expand("RRECOMMENDS_${PN}-modules"), ' '.join(packages))
310
311 # Read the pre-generated dependency file, and use it to set module dependecies
312 for line in open(d.expand("${WORKDIR}") + '/perl-rdepends.txt').readlines():
313 splitline = line.split()
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500314 # Filter empty lines and comments
315 if len(splitline) == 0 or splitline[0].startswith("#"):
316 continue
Andrew Geissler82c905d2020-04-13 13:39:40 -0500317 if bb.data.inherits_class('native', d):
318 module = splitline[0] + '-native'
319 depends = "perl-native"
320 else:
321 module = splitline[0].replace("RDEPENDS_perl", "RDEPENDS_${PN}")
322 depends = splitline[2].strip('"').replace("perl-module", "${PN}-module")
323 d.appendVar(d.expand(module), " " + depends)
324}
325
326python() {
327 if d.getVar('CLASSOVERRIDE') == "class-target":
Andrew Geissler1e34c2d2020-05-29 16:02:59 -0500328 d.setVar("PACKAGES_DYNAMIC", "^${MLPREFIX}perl-module-.*(?<!native)$")
Andrew Geissler82c905d2020-04-13 13:39:40 -0500329 elif d.getVar('CLASSOVERRIDE') == "class-native":
330 d.setVar("PACKAGES_DYNAMIC", "^perl-module-.*-native$")
331 elif d.getVar('CLASSOVERRIDE') == "class-nativesdk":
332 d.setVar("PACKAGES_DYNAMIC", "^nativesdk-perl-module-.*")
333}
334
335RDEPENDS_${PN}-misc += "perl perl-modules"
336RDEPENDS_${PN}-pod += "perl"
337
338BBCLASSEXTEND = "native nativesdk"
339
340SSTATE_SCAN_FILES += "*.pm *.pod *.h *.pl *.sh"
341
342do_create_rdepends_inc() {
343 cd ${WORKDIR}
344 cat <<'EOPREAMBLE' > ${WORKDIR}/perl-rdepends.inc
345
346# Some additional dependencies that the above doesn't manage to figure out
347RDEPENDS_${PN}-module-file-spec += "${PN}-module-file-spec-unix"
348RDEPENDS_${PN}-module-math-bigint += "${PN}-module-math-bigint-calc"
349RDEPENDS_${PN}-module-thread-queue += "${PN}-module-attributes"
350RDEPENDS_${PN}-module-overload += "${PN}-module-overloading"
351
352# Generated depends list beyond this line
353EOPREAMBLE
354 test -e packages-split.new && rm -rf packages-split.new
355 cp -r packages-split packages-split.new && cd packages-split.new
356 find . -name \*.pm | xargs sed -i '/^=head/,/^=cut/d'
357 egrep -r "^\s*(\<use .*|\<require .*);?" perl-module-* --include="*.pm" | \
358 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/(//;" | tr [:upper:] [:lower:] | \
359 awk '{if ($3 != "\x22"$1"\x22"){ print $0}}'| \
360 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 | \
361 sort -u | \
362 sed 's/^/RDEPENDS_/;s/perl-module-/${PN}-module-/g;s/module-\(module-\)/\1/g;s/\(module-load\)-conditional/\1/g;s/encode-configlocal/&-pm/;' | \
363 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-test2|module-text-unidecode|module-unicore|module-win32|objects\sload|syscall.ph|systeminfo.ph|%s' | \
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500364 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
365 cat ${WORKDIR}/perl-rdepends.inc ${WORKDIR}/perl-rdepends.generated > ${THISDIR}/files/perl-rdepends.txt
Andrew Geissler82c905d2020-04-13 13:39:40 -0500366}
367
368# bitbake perl -c create_rdepends_inc
369addtask do_create_rdepends_inc
370
371SYSROOT_PREPROCESS_FUNCS += "perl_sysroot_create_wrapper"
372
373perl_sysroot_create_wrapper () {
374 mkdir -p ${SYSROOT_DESTDIR}${bindir}
375 # Create a wrapper that /usr/bin/env perl will use to get perl-native.
376 # This MUST live in the normal bindir.
377 cat > ${SYSROOT_DESTDIR}${bindir}/nativeperl << EOF
378#!/bin/sh
379realpath=\`readlink -fn \$0\`
380exec \`dirname \$realpath\`/perl-native/perl "\$@"
381EOF
382 chmod 0755 ${SYSROOT_DESTDIR}${bindir}/nativeperl
383 cat ${SYSROOT_DESTDIR}${bindir}/nativeperl
384}