summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/perl/perl_5.30.1.bb
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2019-12-05 16:43:44 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-07 10:56:45 +0000
commitdb2edbf58ca679dcd1ddd121eadcd525bc67481a (patch)
treee93043072753a756a26e78ce1666b789644027aa /meta/recipes-devtools/perl/perl_5.30.1.bb
parent60ec9f2634d88bf8aa0ec6e5991c6d3292f901f6 (diff)
downloadpoky-db2edbf58ca679dcd1ddd121eadcd525bc67481a.tar.gz
perl: update to 5.30.1
Drop fix-setgroup.patch as the upstream has fixed the issue. (From OE-Core rev: df86f5d32dc18f25c5c4788b65cceae8905a6ef3) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 45edc6d23e20f7634c50db71e419c7e3bb7f393e) [Bug fix only update] Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/perl/perl_5.30.1.bb')
-rw-r--r--meta/recipes-devtools/perl/perl_5.30.1.bb339
1 files changed, 339 insertions, 0 deletions
diff --git a/meta/recipes-devtools/perl/perl_5.30.1.bb b/meta/recipes-devtools/perl/perl_5.30.1.bb
new file mode 100644
index 0000000000..996f631f40
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl_5.30.1.bb
@@ -0,0 +1,339 @@
1SUMMARY = "Perl scripting language"
2HOMEPAGE = "http://www.perl.org/"
3SECTION = "devel"
4LICENSE = "Artistic-1.0 | GPL-1.0+"
5LIC_FILES_CHKSUM = "file://Copying;md5=5b122a36d0f6dc55279a0ebc69f3c60b \
6 file://Artistic;md5=71a4d5d9acc18c0952a6df2218bb68da \
7 "
8
9
10SRC_URI = "https://www.cpan.org/src/5.0/perl-${PV}.tar.gz;name=perl \
11 https://github.com/arsv/perl-cross/releases/download/1.3.1/perl-cross-1.3.1.tar.gz;name=perl-cross \
12 file://perl-rdepends.txt \
13 file://0001-configure_tool.sh-do-not-quote-the-argument-to-comma.patch \
14 file://0001-ExtUtils-MakeMaker-add-LDFLAGS-when-linking-binary-m.patch \
15 file://0001-Somehow-this-module-breaks-through-the-perl-wrapper-.patch \
16 file://errno_ver.diff \
17 file://native-perlinc.patch \
18 file://0001-perl-cross-add-LDFLAGS-when-linking-libperl.patch \
19 file://perl-dynloader.patch \
20 file://0001-configure_path.sh-do-not-hardcode-prefix-lib-as-libr.patch \
21 file://0001-enc2xs-Add-environment-variable-to-suppress-comments.patch \
22 file://0002-Constant-Fix-up-shebang.patch \
23 file://determinism.patch \
24 "
25SRC_URI_append_class-native = " \
26 file://perl-configpm-switch.patch \
27"
28
29SRC_URI[perl.md5sum] = "6438eb7b8db9bbde28e01086de376a46"
30SRC_URI[perl.sha256sum] = "bf3d25571ff1ee94186177c2cdef87867fd6a14aa5a84f0b1fb7bf798f42f964"
31SRC_URI[perl-cross.md5sum] = "1e463b105cfa56d251a86979af23e3a7"
32SRC_URI[perl-cross.sha256sum] = "edce0b0c2f725e2db3f203d6d8e9f3f7161256f5d1590551e40694f21200141d"
33
34S = "${WORKDIR}/perl-${PV}"
35
36inherit upstream-version-is-even
37
38DEPENDS += "gdbm zlib virtual/crypt"
39
40PERL_LIB_VER = "${@'.'.join(d.getVar('PV').split('.')[0:2])}.0"
41
42PACKAGECONFIG ??= "bdb"
43PACKAGECONFIG[bdb] = ",-Ui_db,db"
44
45# Don't generate comments in enc2xs output files. They are not reproducible
46export ENC2XS_NO_COMMENTS = "1"
47
48do_unpack_append() {
49 bb.build.exec_func('do_copy_perlcross', d)
50}
51
52do_copy_perlcross() {
53 cp -rfp ${WORKDIR}/perl-cross*/* ${S}
54}
55
56do_configure_class-target() {
57 ./configure --prefix=${prefix} --libdir=${libdir} \
58 --target=${TARGET_SYS} \
59 -Duseshrplib \
60 -Dsoname=libperl.so.5 \
61 -Dvendorprefix=${prefix} \
62 -Darchlibexp=${STAGING_LIBDIR}/perl5/${PV}/${TARGET_ARCH}-linux \
63 ${PACKAGECONFIG_CONFARGS}
64
65 #perl.c uses an ARCHLIB_EXP define to generate compile-time code that
66 #adds the archlibexp path to @INC during run-time initialization of a
67 #new perl interpreter.
68
69 #Because we've changed this value in a temporary way to make it
70 #possible to use ExtUtils::Embed in the target build (the temporary
71 #value in config.sh gets re-stripped out during packaging), the
72 #ARCHLIB_EXP value that gets generated still uses the temporary version
73 #instead of the original expected version (i.e. becauses it's in the
74 #generated config.h, it doesn't get stripped out during packaging like
75 #the others in config.sh).
76
77 sed -i -e "s,${STAGING_LIBDIR},${libdir},g" config.h
78}
79
80do_configure_class-nativesdk() {
81 ./configure --prefix=${prefix} \
82 --target=${TARGET_SYS} \
83 -Duseshrplib \
84 -Dsoname=libperl.so.5 \
85 -Dvendorprefix=${prefix} \
86 -Darchlibexp=${STAGING_LIBDIR}/perl5/${PV}/${TARGET_ARCH}-linux \
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 -Dsoname=libperl.so.5 \
98 -Dvendorprefix=${prefix} \
99 -Ui_xlocale \
100 ${PACKAGECONFIG_CONFARGS}
101}
102
103do_configure_append() {
104 if [ -n "$SOURCE_DATE_EPOCH" ]; then
105 PERL_BUILD_DATE="$(${PYTHON} -c "\
106from datetime import datetime, timezone; \
107print(datetime.fromtimestamp($SOURCE_DATE_EPOCH, timezone.utc).strftime('%a %b %d %H:%M:%S %Y')) \
108 ")"
109 echo "#define PERL_BUILD_DATE \"$PERL_BUILD_DATE\"" >> config.h
110 fi
111}
112
113do_compile() {
114 oe_runmake
115}
116
117do_install() {
118 oe_runmake 'DESTDIR=${D}' install
119
120 install -d ${D}${libdir}/perl5
121 install -d ${D}${libdir}/perl5/${PV}/
122 install -d ${D}${libdir}/perl5/${PV}/ExtUtils/
123
124 # Save native config
125 install config.sh ${D}${libdir}/perl5
126 install lib/Config.pm ${D}${libdir}/perl5/${PV}/
127 install lib/ExtUtils/typemap ${D}${libdir}/perl5/${PV}/ExtUtils/
128
129 # Fix up shared library
130 rm ${D}/${libdir}/perl5/${PV}/*/CORE/libperl.so
131 ln -sf ../../../../libperl.so.${PERL_LIB_VER} $(echo ${D}/${libdir}/perl5/${PV}/*/CORE)/libperl.so
132}
133
134do_install_append_class-target() {
135 # This is used to substitute target configuration when running native perl via perl-configpm-switch.patch
136 ln -s Config_heavy.pl ${D}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config_heavy-target.pl
137
138 # This contains host-specific information used for building miniperl (a helper executable built with host compiler)
139 # and therefore isn't reproducible. I believe the file isn't actually needed on target.
140 rm ${D}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/xconfig.h
141}
142
143do_install_append_class-nativesdk() {
144 # This is used to substitute target configuration when running native perl via perl-configpm-switch.patch
145 ln -s Config_heavy.pl ${D}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config_heavy-target.pl
146
147 create_wrapper ${D}${bindir}/perl \
148 PERL5LIB='$PERL5LIB:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl5/site_perl/${PV}:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl5/vendor_perl/${PV}:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl5/${PV}'
149}
150
151do_install_append_class-native () {
152 # Those wrappers mean that perl installed from sstate (which may change
153 # path location) works and that in the nativesdk case, the SDK can be
154 # installed to a different location from the one it was built for.
155 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}'
156
157 # Use /usr/bin/env nativeperl for the perl script.
158 for f in `grep -Il '#! *${bindir}/perl' ${D}/${bindir}/*`; do
159 sed -i -e 's|${bindir}/perl|/usr/bin/env nativeperl|' $f
160 done
161}
162
163PACKAGE_PREPROCESS_FUNCS += "perl_package_preprocess"
164
165perl_package_preprocess () {
166 # Fix up installed configuration
167 sed -i -e "s,${D},,g" \
168 -e "s,${DEBUG_PREFIX_MAP},,g" \
169 -e "s,--sysroot=${STAGING_DIR_HOST},,g" \
170 -e "s,-isystem${STAGING_INCDIR} ,,g" \
171 -e "s,${STAGING_LIBDIR},${libdir},g" \
172 -e "s,${STAGING_BINDIR},${bindir},g" \
173 -e "s,${STAGING_INCDIR},${includedir},g" \
174 -e "s,${STAGING_BINDIR_NATIVE}/perl-native/,${bindir}/,g" \
175 -e "s,${STAGING_BINDIR_NATIVE}/,,g" \
176 -e "s,${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX},${bindir},g" \
177 -e 's:${RECIPE_SYSROOT}::g' \
178 ${PKGD}${bindir}/h2xs \
179 ${PKGD}${bindir}/h2ph \
180 ${PKGD}${bindir}/pod2man \
181 ${PKGD}${bindir}/pod2text \
182 ${PKGD}${bindir}/pod2usage \
183 ${PKGD}${bindir}/podchecker \
184 ${PKGD}${bindir}/podselect \
185 ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/config.h \
186 ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/perl.h \
187 ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/pp.h \
188 ${PKGD}${libdir}/perl5/${PV}/Config.pm \
189 ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config.pm \
190 ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config.pod \
191 ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config_git.pl \
192 ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config_heavy.pl \
193 ${PKGD}${libdir}/perl5/${PV}/ExtUtils/Liblist/Kid.pm \
194 ${PKGD}${libdir}/perl5/${PV}/FileCache.pm \
195 ${PKGD}${libdir}/perl5/${PV}/pod/*.pod \
196 ${PKGD}${libdir}/perl5/config.sh
197}
198
199require perl-ptest.inc
200
201FILES_${PN} = "${bindir}/perl ${bindir}/perl.real ${bindir}/perl${PV} ${libdir}/libperl.so* \
202 ${libdir}/perl5/site_perl \
203 ${libdir}/perl5/${PV}/Config.pm \
204 ${libdir}/perl5/${PV}/*/Config_git.pl \
205 ${libdir}/perl5/${PV}/*/Config_heavy-target.pl \
206 ${libdir}/perl5/config.sh \
207 ${libdir}/perl5/${PV}/strict.pm \
208 ${libdir}/perl5/${PV}/warnings.pm \
209 ${libdir}/perl5/${PV}/warnings \
210 ${libdir}/perl5/${PV}/vars.pm \
211 ${libdir}/perl5/site_perl \
212 "
213RPROVIDES_${PN} += "perl-module-strict perl-module-vars perl-module-config perl-module-warnings \
214 perl-module-warnings-register"
215
216FILES_${PN}-staticdev_append = " ${libdir}/perl5/${PV}/*/CORE/libperl.a"
217
218FILES_${PN}-dev_append = " ${libdir}/perl5/${PV}/*/CORE"
219
220FILES_${PN}-doc_append = " ${libdir}/perl5/${PV}/Unicode/Collate/*.txt \
221 ${libdir}/perl5/${PV}/*/.packlist \
222 ${libdir}/perl5/${PV}/ExtUtils/MANIFEST.SKIP \
223 ${libdir}/perl5/${PV}/ExtUtils/xsubpp \
224 ${libdir}/perl5/${PV}/ExtUtils/typemap \
225 ${libdir}/perl5/${PV}/Encode/encode.h \
226 "
227PACKAGES += "${PN}-misc"
228
229FILES_${PN}-misc = "${bindir}/*"
230
231PACKAGES += "${PN}-pod"
232
233FILES_${PN}-pod = "${libdir}/perl5/${PV}/pod \
234 ${libdir}/perl5/${PV}/*.pod \
235 ${libdir}/perl5/${PV}/*/*.pod \
236 ${libdir}/perl5/${PV}/*/*/*.pod \
237 ${libdir}/perl5/${PV}/*/*/*/*.pod \
238 "
239
240PACKAGES += "${PN}-module-cpan ${PN}-module-unicore"
241
242FILES_${PN}-module-cpan += "${libdir}/perl5/${PV}/CPAN \
243 "
244FILES_${PN}-module-unicore += "${libdir}/perl5/${PV}/unicore"
245
246# Create a perl-modules package recommending all the other perl
247# packages (actually the non modules packages and not created too)
248ALLOW_EMPTY_${PN}-modules = "1"
249PACKAGES += "${PN}-modules "
250
251PACKAGESPLITFUNCS_prepend = "split_perl_packages "
252
253python split_perl_packages () {
254 libdir = d.expand('${libdir}/perl5/${PV}')
255 do_split_packages(d, libdir, r'.*/auto/([^.]*)/[^/]*\.(so|ld|ix|al)', '${PN}-module-%s', 'perl module %s', recursive=True, match_path=True, prepend=False)
256 do_split_packages(d, libdir, r'.*linux/([^\/]*)\.pm', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
257 do_split_packages(d, libdir, r'Module/([^\/]*)\.pm', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
258 do_split_packages(d, libdir, r'Module/([^\/]*)/.*', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
259 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)
260 do_split_packages(d, libdir, r'(^(?!(CPAN\/|CPANPLUS\/|Module\/|unicore\/)[^\/]).*)\.(pm|pl|e2x)', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
261
262 # perl-modules should recommend every perl module, and only the
263 # modules. Don't attempt to use the result of do_split_packages() as some
264 # modules are manually split (eg. perl-module-unicore).
265 packages = filter(lambda p: 'perl-module-' in p, d.getVar('PACKAGES').split())
266 d.setVar(d.expand("RRECOMMENDS_${PN}-modules"), ' '.join(packages))
267
268 # Read the pre-generated dependency file, and use it to set module dependecies
269 for line in open(d.expand("${WORKDIR}") + '/perl-rdepends.txt').readlines():
270 splitline = line.split()
271 if bb.data.inherits_class('native', d):
272 module = splitline[0] + '-native'
273 depends = "perl-native"
274 else:
275 module = splitline[0].replace("RDEPENDS_perl", "RDEPENDS_${PN}")
276 depends = splitline[2].strip('"').replace("perl-module", "${PN}-module")
277 d.appendVar(d.expand(module), " " + depends)
278}
279
280python() {
281 if d.getVar('CLASSOVERRIDE') == "class-target":
282 d.setVar("PACKAGES_DYNAMIC", "^perl-module-.*(?<!native)$")
283 elif d.getVar('CLASSOVERRIDE') == "class-native":
284 d.setVar("PACKAGES_DYNAMIC", "^perl-module-.*-native$")
285 elif d.getVar('CLASSOVERRIDE') == "class-nativesdk":
286 d.setVar("PACKAGES_DYNAMIC", "^nativesdk-perl-module-.*")
287}
288
289RDEPENDS_${PN}-misc += "perl perl-modules"
290RDEPENDS_${PN}-pod += "perl"
291
292BBCLASSEXTEND = "native nativesdk"
293
294SSTATE_SCAN_FILES += "*.pm *.pod *.h *.pl *.sh"
295
296do_create_rdepends_inc() {
297 cd ${WORKDIR}
298 cat <<'EOPREAMBLE' > ${WORKDIR}/perl-rdepends.inc
299
300# Some additional dependencies that the above doesn't manage to figure out
301RDEPENDS_${PN}-module-file-spec += "${PN}-module-file-spec-unix"
302RDEPENDS_${PN}-module-math-bigint += "${PN}-module-math-bigint-calc"
303RDEPENDS_${PN}-module-thread-queue += "${PN}-module-attributes"
304RDEPENDS_${PN}-module-overload += "${PN}-module-overloading"
305
306# Generated depends list beyond this line
307EOPREAMBLE
308 test -e packages-split.new && rm -rf packages-split.new
309 cp -r packages-split packages-split.new && cd packages-split.new
310 find . -name \*.pm | xargs sed -i '/^=head/,/^=cut/d'
311 egrep -r "^\s*(\<use .*|\<require .*);?" perl-module-* --include="*.pm" | \
312 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:] | \
313 awk '{if ($3 != "\x22"$1"\x22"){ print $0}}'| \
314 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 | \
315 sort -u | \
316 sed 's/^/RDEPENDS_/;s/perl-module-/${PN}-module-/g;s/module-\(module-\)/\1/g;s/\(module-load\)-conditional/\1/g;s/encode-configlocal/&-pm/;' | \
317 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' | \
318 egrep -wv '=>|module-algorithm-diff|module-carp|module-c<extutils-mm-unix>|module-encode-hanextra|module-extutils-makemaker-version-regex|module-file-spec|module-io-compress-lzma|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
319 cp ${WORKDIR}/perl-rdepends.generated ${THISDIR}/files/perl-rdepends.txt
320}
321
322# bitbake perl -c create_rdepends_inc
323addtask do_create_rdepends_inc
324
325SYSROOT_PREPROCESS_FUNCS += "perl_sysroot_create_wrapper"
326
327perl_sysroot_create_wrapper () {
328 mkdir -p ${SYSROOT_DESTDIR}${bindir}
329 # Create a wrapper that /usr/bin/env perl will use to get perl-native.
330 # This MUST live in the normal bindir.
331 cat > ${SYSROOT_DESTDIR}${bindir}/nativeperl << EOF
332#!/bin/sh
333realpath=\`readlink -fn \$0\`
334exec \`dirname \$realpath\`/perl-native/perl "\$@"
335EOF
336 chmod 0755 ${SYSROOT_DESTDIR}${bindir}/nativeperl
337 cat ${SYSROOT_DESTDIR}${bindir}/nativeperl
338}
339