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