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