summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/perl/perl_5.22.1.bb
diff options
context:
space:
mode:
authorAlejandro Hernandez <alejandro.hernandez@linux.intel.com>2016-01-20 15:56:57 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-24 09:40:20 +0000
commit55a8df2056024acf714f47c85267c1eba8b7b6be (patch)
treecfe6f9df7b309d7a296eabaf3dc30e2fab768793 /meta/recipes-devtools/perl/perl_5.22.1.bb
parenta84058826d913c093f088e929cb1f34ff413fa0c (diff)
downloadpoky-55a8df2056024acf714f47c85267c1eba8b7b6be.tar.gz
perl: Upgrade to 5.22.1
Rebased: - Makefile.SH.patch (From OE-Core rev: f4c9908eae1ae3dcc38877abe2d5fbeb46851dd4) Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/perl/perl_5.22.1.bb')
-rw-r--r--meta/recipes-devtools/perl/perl_5.22.1.bb365
1 files changed, 365 insertions, 0 deletions
diff --git a/meta/recipes-devtools/perl/perl_5.22.1.bb b/meta/recipes-devtools/perl/perl_5.22.1.bb
new file mode 100644
index 0000000000..705852c01c
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl_5.22.1.bb
@@ -0,0 +1,365 @@
1require perl.inc
2
3# We need gnugrep (for -I)
4DEPENDS = "virtual/db grep-native"
5DEPENDS += "gdbm zlib"
6
7# Pick up patches from debian
8# http://ftp.de.debian.org/debian/pool/main/p/perl/perl_5.22.0-1.debian.tar.xz
9SRC_URI += " \
10 file://debian/cpan_definstalldirs.diff \
11 file://debian/db_file_ver.diff \
12 file://debian/doc_info.diff \
13 file://debian/enc2xs_inc.diff \
14 file://debian/errno_ver.diff \
15 file://debian/libperl_embed_doc.diff \
16 file://debian/fixes/respect_umask.diff \
17 file://debian/writable_site_dirs.diff \
18 file://debian/extutils_set_libperl_path.diff \
19 file://debian/no_packlist_perllocal.diff \
20 file://debian/prefix_changes.diff \
21 file://debian/instmodsh_doc.diff \
22 file://debian/ld_run_path.diff \
23 file://debian/libnet_config_path.diff \
24 file://debian/mod_paths.diff \
25 file://debian/prune_libs.diff \
26 file://debian/fixes/net_smtp_docs.diff \
27 file://debian/perlivp.diff \
28 file://debian/squelch-locale-warnings.diff \
29 file://debian/skip-upstream-git-tests.diff \
30 file://debian/skip-kfreebsd-crash.diff \
31 file://debian/fixes/document_makemaker_ccflags.diff \
32 file://debian/find_html2text.diff \
33 file://debian/perl5db-x-terminal-emulator.patch \
34 file://debian/cpan-missing-site-dirs.diff \
35 file://debian/fixes/memoize_storable_nstore.diff \
36 file://debian/regen-skip.diff \
37"
38
39SRC_URI += " \
40 file://Makefile.patch \
41 file://Makefile.SH.patch \
42 file://installperl.patch \
43 file://perl-dynloader.patch \
44 file://perl-moreconfig.patch \
45 file://letgcc-find-errno.patch \
46 file://generate-sh.patch \
47 file://native-perlinc.patch \
48 file://perl-enable-gdbm.patch \
49 file://cross-generate_uudmap.patch \
50 file://fix_bad_rpath.patch \
51 file://perl-archlib-exp.patch \
52 file://dynaloaderhack.patch \
53 file://config.sh \
54 file://config.sh-32 \
55 file://config.sh-32-le \
56 file://config.sh-32-be \
57 file://config.sh-64 \
58 file://config.sh-64-le \
59 file://config.sh-64-be \
60 file://make_ext.pl-fix-regenerate-makefile-failed-while-cc-.patch \
61 file://t-run-switches.t-perl5-perl.patch \
62 file://ext-ODBM_File-hints-linux.pl-link-libgdbm_compat.patch \
63 file://ext-ODBM_File-t-odbm.t-fix-the-path-of-dbmt_common.p.patch \
64 file://perl-PathTools-don-t-filter-out-blib-from-INC.patch \
65 file://perl-errno-generation-gcc5.patch \
66"
67
68# Fix test case issues
69SRC_URI_append_class-target = " \
70 file://test/dist-threads-t-join.t-adjust-ps-option.patch \
71 file://test/ext-DynaLoader-t-DynaLoader.t-fix-calling-dl_findfil.patch \
72 "
73
74SRC_URI[md5sum] = "6671e4829cbaf9cecafa9a84f141b0a3"
75SRC_URI[sha256sum] = "9e87317d693ce828095204be0d09af8d60b8785533fadea1a82b6f0e071e5c79"
76
77inherit perlnative siteinfo
78
79# Where to find the native perl
80HOSTPERL = "${STAGING_BINDIR_NATIVE}/perl-native/perl${PV}"
81
82# Where to find .so files - use the -native versions not those from the target build
83export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${PV}/"
84
85# Where to find perl @INC/#include files
86# - use the -native versions not those from the target build
87export PERL_LIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${PV}/"
88export PERL_ARCHLIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${PV}/"
89
90# LDFLAGS for shared libraries
91export LDDLFLAGS = "${LDFLAGS} -shared"
92
93LDFLAGS_append = " -fstack-protector"
94
95# We're almost Debian, aren't we?
96CFLAGS += "-DDEBIAN"
97
98do_nolargefile() {
99 sed -i -e "s,\(uselargefiles=\)'define',\1'undef',g" \
100 -e "s,\(d_readdir64_r=\)'define',\1'undef',g" \
101 -e "s,\(readdir64_r_proto=\)'\w+',\1'0',g" \
102 -e "/ccflags_uselargefiles/d" \
103 -e "s/-Duselargefiles//" \
104 -e "s/-D_FILE_OFFSET_BITS=64//" \
105 -e "s/-D_LARGEFILE_SOURCE//" \
106 ${S}/Cross/config.sh-${TARGET_ARCH}-${TARGET_OS}
107}
108
109do_configure() {
110 # Make hostperl in build directory be the native perl
111 ln -sf ${HOSTPERL} hostperl
112
113 if [ -n "${CONFIGURESTAMPFILE}" -a -e "${CONFIGURESTAMPFILE}" ]; then
114 if [ "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a -e Makefile ]; then
115 ${MAKE} clean
116 fi
117 find ${S} -name *.so -delete
118 fi
119 if [ -n "${CONFIGURESTAMPFILE}" ]; then
120 echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE}
121 fi
122
123 # Do our work in the cross subdir
124 cd Cross
125
126 # Generate configuration
127 rm -f config.sh-${TARGET_ARCH}-${TARGET_OS}
128 for i in ${WORKDIR}/config.sh \
129 ${WORKDIR}/config.sh-${SITEINFO_BITS} \
130 ${WORKDIR}/config.sh-${SITEINFO_BITS}-${SITEINFO_ENDIANNESS}; do
131 cat $i >> config.sh-${TARGET_ARCH}-${TARGET_OS}
132 done
133
134 # Fixups for uclibc
135 if [ "${TARGET_OS}" = "linux-uclibc" -o "${TARGET_OS}" = "linux-uclibceabi" ]; then
136 sed -i -e "s,\(d_crypt_r=\)'define',\1'undef',g" \
137 -e "s,\(d_futimes=\)'define',\1'undef',g" \
138 -e "s,\(d_finitel=\)'define',\1'undef',g" \
139 -e "s,\(crypt_r_proto=\)'\w+',\1'0',g" \
140 -e "s,\(d_getnetbyname_r=\)'define',\1'undef',g" \
141 -e "s,\(getnetbyname_r_proto=\)'\w+',\1'0',g" \
142 -e "s,\(d_getnetbyaddr_r=\)'define',\1'undef',g" \
143 -e "s,\(getnetbyaddr_r_proto=\)'\w+',\1'0',g" \
144 -e "s,\(d_getnetent_r=\)'define',\1'undef',g" \
145 -e "s,\(getnetent_r_proto=\)'\w+',\1'0',g" \
146 -e "s,\(d_sockatmark=\)'define',\1'undef',g" \
147 -e "s,\(d_sockatmarkproto=\)'\w+',\1'0',g" \
148 -e "s,\(d_eaccess=\)'define',\1'undef',g" \
149 -e "s,\(d_stdio_ptr_lval=\)'define',\1'undef',g" \
150 -e "s,\(d_stdio_ptr_lval_sets_cnt=\)'define',\1'undef',g" \
151 -e "s,\(d_stdiobase=\)'define',\1'undef',g" \
152 -e "s,\(d_stdstdio=\)'define',\1'undef',g" \
153 -e "s,-fstack-protector,-fno-stack-protector,g" \
154 config.sh-${TARGET_ARCH}-${TARGET_OS}
155 fi
156 # Fixups for musl
157 if [ "${TARGET_OS}" = "linux-musl" -o "${TARGET_OS}" = "linux-musleabi" ]; then
158 sed -i -e "s,\(d_libm_lib_version=\)'define',\1'undef',g" \
159 -e "s,\(d_stdio_ptr_lval=\)'define',\1'undef',g" \
160 -e "s,\(d_stdio_ptr_lval_sets_cnt=\)'define',\1'undef',g" \
161 -e "s,\(d_stdiobase=\)'define',\1'undef',g" \
162 -e "s,\(d_stdstdio=\)'define',\1'undef',g" \
163 -e "s,\(d_getnetbyname_r=\)'define',\1'undef',g" \
164 -e "s,\(d_finitel=\)'define',\1'undef',g" \
165 -e "s,\(getprotobyname_r=\)'define',\1'undef',g" \
166 -e "s,\(getpwent_r=\)'define',\1'undef',g" \
167 -e "s,\(getservent_r=\)'define',\1'undef',g" \
168 -e "s,\(gethostent_r=\)'define',\1'undef',g" \
169 -e "s,\(getnetent_r=\)'define',\1'undef',g" \
170 -e "s,\(getnetbyaddr_r=\)'define',\1'undef',g" \
171 -e "s,\(getprotoent_r=\)'define',\1'undef',g" \
172 -e "s,\(getprotobynumber_r=\)'define',\1'undef',g" \
173 -e "s,\(getgrent_r=\)'define',\1'undef',g" \
174 -e "s,\(i_fcntl=\)'undef',\1'define',g" \
175 -e "s,\(h_fcntl=\)'false',\1'true',g" \
176 -e "s,-fstack-protector,-fno-stack-protector,g" \
177 -e "s,-lnsl,,g" \
178 config.sh-${TARGET_ARCH}-${TARGET_OS}
179 fi
180
181 ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '', 'do_nolargefile', d)}
182
183 # Update some paths in the configuration
184 sed -i -e 's,@ARCH@-thread-multi,,g' \
185 -e 's,@ARCH@,${TARGET_ARCH}-${TARGET_OS},g' \
186 -e 's,@STAGINGDIR@,${STAGING_DIR_HOST},g' \
187 -e "s,@INCLUDEDIR@,${STAGING_INCDIR},g" \
188 -e "s,@LIBDIR@,${libdir},g" \
189 -e "s,@BASELIBDIR@,${base_libdir},g" \
190 -e "s,@EXECPREFIX@,${exec_prefix},g" \
191 -e 's,@USRBIN@,${bindir},g' \
192 config.sh-${TARGET_ARCH}-${TARGET_OS}
193
194 case "${TARGET_ARCH}" in
195 x86_64 | powerpc | s390)
196 sed -i -e "s,\(need_va_copy=\)'undef',\1'define',g" \
197 config.sh-${TARGET_ARCH}-${TARGET_OS}
198 ;;
199 arm)
200 sed -i -e "s,\(d_u32align=\)'undef',\1'define',g" \
201 config.sh-${TARGET_ARCH}-${TARGET_OS}
202 ;;
203 esac
204 # These are strewn all over the source tree
205 for foo in `grep -I --exclude="*.patch" --exclude="*.diff" --exclude="*.pod" --exclude="README*" -m1 "/usr/include/.*\.h" ${S}/* -r -l` ${S}/utils/h2xs.PL ; do
206 echo Fixing: $foo
207 sed -e 's|\([ "^'\''I]\+\)/usr/include/|\1${STAGING_INCDIR}/|g' -i $foo
208 done
209
210 rm -f config
211 echo "ARCH = ${TARGET_ARCH}" > config
212 echo "OS = ${TARGET_OS}" >> config
213}
214
215do_compile() {
216 # Fix to avoid recursive substitution of path
217 sed -i -e 's|(@libpath, ".*"|(@libpath, "${STAGING_LIBDIR}"|g' cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
218
219 cd Cross
220 oe_runmake perl LD="${CCLD}"
221}
222
223do_install() {
224 #export hostperl="${STAGING_BINDIR_NATIVE}/perl-native/perl${PV}"
225 oe_runmake install DESTDIR=${D}
226 # Add perl pointing at current version
227 ln -sf perl${PV} ${D}${bindir}/perl
228
229 ln -sf perl ${D}/${libdir}/perl5
230
231 # Remove unwanted file and empty directories
232 rm -f ${D}/${libdir}/perl/${PV}/.packlist
233 rmdir ${D}/${libdir}/perl/site_perl/${PV}
234 rmdir ${D}/${libdir}/perl/site_perl
235
236 # Fix up shared library
237 mv ${D}/${libdir}/perl/${PV}/CORE/libperl.so ${D}/${libdir}/libperl.so.${PV}
238 ln -sf libperl.so.${PV} ${D}/${libdir}/libperl.so.5
239 ln -sf ../../../libperl.so.${PV} ${D}/${libdir}/perl/${PV}/CORE/libperl.so
240
241 # target config, used by cpan.bbclass to extract version information
242 install config.sh ${D}${libdir}/perl
243
244 ln -s Config_heavy.pl ${D}${libdir}/perl/${PV}/Config_heavy-target.pl
245}
246
247do_install_append_class-nativesdk () {
248 create_wrapper ${D}${bindir}/perl \
249 PERL5LIB='$PERL5LIB:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl/site_perl/${PV}:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl/vendor_perl/${PV}:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl/${PV}'
250}
251
252PACKAGE_PREPROCESS_FUNCS += "perl_package_preprocess"
253
254perl_package_preprocess () {
255 # Fix up installed configuration
256 sed -i -e "s,${D},,g" \
257 -e "s,--sysroot=${STAGING_DIR_HOST},,g" \
258 -e "s,-isystem${STAGING_INCDIR} ,,g" \
259 -e "s,${STAGING_LIBDIR},${libdir},g" \
260 -e "s,${STAGING_BINDIR},${bindir},g" \
261 -e "s,${STAGING_INCDIR},${includedir},g" \
262 -e "s,${STAGING_BINDIR_NATIVE}/perl-native/,${bindir}/,g" \
263 -e "s,${STAGING_BINDIR_NATIVE}/,,g" \
264 -e "s,${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX},${bindir},g" \
265 ${PKGD}${bindir}/h2xs \
266 ${PKGD}${bindir}/h2ph \
267 ${PKGD}${bindir}/pod2man \
268 ${PKGD}${bindir}/pod2text \
269 ${PKGD}${bindir}/pod2usage \
270 ${PKGD}${bindir}/podchecker \
271 ${PKGD}${bindir}/podselect \
272 ${PKGD}${libdir}/perl/${PV}/CORE/config.h \
273 ${PKGD}${libdir}/perl/${PV}/CORE/perl.h \
274 ${PKGD}${libdir}/perl/${PV}/CORE/pp.h \
275 ${PKGD}${libdir}/perl/${PV}/Config.pm \
276 ${PKGD}${libdir}/perl/${PV}/Config.pod \
277 ${PKGD}${libdir}/perl/${PV}/Config_heavy.pl \
278 ${PKGD}${libdir}/perl/${PV}/ExtUtils/Liblist/Kid.pm \
279 ${PKGD}${libdir}/perl/${PV}/FileCache.pm \
280 ${PKGD}${libdir}/perl/${PV}/pod/*.pod \
281 ${PKGD}${libdir}/perl/config.sh
282}
283
284PACKAGES = "perl-dbg perl perl-misc perl-dev perl-pod perl-doc perl-lib \
285 perl-module-cpan perl-module-cpanplus perl-module-unicore"
286FILES_${PN} = "${bindir}/perl ${bindir}/perl${PV} \
287 ${libdir}/perl/${PV}/Config.pm \
288 ${libdir}/perl/${PV}/strict.pm \
289 ${libdir}/perl/${PV}/warnings.pm \
290 ${libdir}/perl/${PV}/warnings \
291 ${libdir}/perl/${PV}/vars.pm \
292 "
293FILES_${PN}_append_class-nativesdk = " ${bindir}/perl.real"
294RPROVIDES_${PN} += "perl-module-strict perl-module-vars perl-module-config perl-module-warnings \
295 perl-module-warnings-register"
296FILES_${PN}-dev = "${libdir}/perl/${PV}/CORE"
297FILES_${PN}-lib = "${libdir}/libperl.so* \
298 ${libdir}/perl5 \
299 ${libdir}/perl/config.sh \
300 ${libdir}/perl/${PV}/Config_heavy.pl \
301 ${libdir}/perl/${PV}/Config_heavy-target.pl"
302FILES_${PN}-pod = "${libdir}/perl/${PV}/pod \
303 ${libdir}/perl/${PV}/*.pod \
304 ${libdir}/perl/${PV}/*/*.pod \
305 ${libdir}/perl/${PV}/*/*/*.pod "
306FILES_perl-misc = "${bindir}/*"
307FILES_${PN}-doc = "${libdir}/perl/${PV}/*/*.txt \
308 ${libdir}/perl/${PV}/*/*/*.txt \
309 ${libdir}/perl/${PV}/auto/XS/Typemap \
310 ${libdir}/perl/${PV}/B/assemble \
311 ${libdir}/perl/${PV}/B/cc_harness \
312 ${libdir}/perl/${PV}/B/disassemble \
313 ${libdir}/perl/${PV}/B/makeliblinks \
314 ${libdir}/perl/${PV}/CGI/eg \
315 ${libdir}/perl/${PV}/CPAN/PAUSE2003.pub \
316 ${libdir}/perl/${PV}/CPAN/SIGNATURE \
317 ${libdir}/perl/${PV}/CPANPLUS/Shell/Default/Plugins/HOWTO.pod \
318 ${libdir}/perl/${PV}/Encode/encode.h \
319 ${libdir}/perl/${PV}/ExtUtils/MANIFEST.SKIP \
320 ${libdir}/perl/${PV}/ExtUtils/NOTES \
321 ${libdir}/perl/${PV}/ExtUtils/PATCHING \
322 ${libdir}/perl/${PV}/ExtUtils/typemap \
323 ${libdir}/perl/${PV}/ExtUtils/xsubpp \
324 ${libdir}/perl/${PV}/ExtUtils/Changes_EU-Install \
325 ${libdir}/perl/${PV}/Net/*.eg \
326 ${libdir}/perl/${PV}/unicore/mktables \
327 ${libdir}/perl/${PV}/unicore/mktables.lst \
328 ${libdir}/perl/${PV}/unicore/version "
329
330FILES_perl-module-cpan += "${libdir}/perl/${PV}/CPAN \
331 ${libdir}/perl/${PV}/CPAN.pm"
332FILES_perl-module-cpanplus += "${libdir}/perl/${PV}/CPANPLUS \
333 ${libdir}/perl/${PV}/CPANPLUS.pm"
334FILES_perl-module-unicore += "${libdir}/perl/${PV}/unicore"
335
336# Create a perl-modules package recommending all the other perl
337# packages (actually the non modules packages and not created too)
338ALLOW_EMPTY_perl-modules = "1"
339PACKAGES_append = " perl-modules "
340
341python populate_packages_prepend () {
342 libdir = d.expand('${libdir}/perl/${PV}')
343 do_split_packages(d, libdir, 'auto/([^.]*)/[^/]*\.(so|ld|ix|al)', 'perl-module-%s', 'perl module %s', recursive=True, match_path=True, prepend=False)
344 do_split_packages(d, libdir, 'Module/([^\/]*)\.pm', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
345 do_split_packages(d, libdir, 'Module/([^\/]*)/.*', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
346 do_split_packages(d, libdir, '(^(?!(CPAN\/|CPANPLUS\/|Module\/|unicore\/|auto\/)[^\/]).*)\.(pm|pl|e2x)', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
347
348 # perl-modules should recommend every perl module, and only the
349 # modules. Don't attempt to use the result of do_split_packages() as some
350 # modules are manually split (eg. perl-module-unicore).
351 packages = filter(lambda p: 'perl-module-' in p, d.getVar('PACKAGES', True).split())
352 d.setVar("RRECOMMENDS_${PN}-modules", ' '.join(packages))
353}
354
355PACKAGES_DYNAMIC += "^perl-module-.*"
356PACKAGES_DYNAMIC_class-nativesdk += "^nativesdk-perl-module-.*"
357
358RPROVIDES_perl-lib = "perl-lib"
359
360require perl-rdepends_${PV}.inc
361require perl-ptest.inc
362
363SSTATE_SCAN_FILES += "*.pm *.pod *.h *.pl *.sh"
364
365BBCLASSEXTEND = "nativesdk"