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