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