summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/perl-sanity/perl-ptest.inc
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2018-12-02 12:43:30 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-01-11 10:29:37 +0000
commit52f2828314f851263ca3a6beb41ec936fab4d3ab (patch)
tree69c6c3e1f5b69af6e59fc53f0f4cf9ee78dd0f0a /meta/recipes-devtools/perl-sanity/perl-ptest.inc
parenta921a96e84f4d0b3f3d29a571981de08eb148e15 (diff)
downloadopenembedded-core-contrib-52f2828314f851263ca3a6beb41ec936fab4d3ab.tar.gz
perl: add a version that builds the recipe using perl-cross, and update to 5.28.1
perl-cross is a build system overlay from buildroot project that aims to bring a bit of sanity to cross-building perl. The advantage of using that is that we can drop a lot of custom patches (that no one really understands), and simplify the perl recipe as well. Also the build time goes down from several minutes to about 30 seconds. The whole thing becomes maintainable again, in my opinion. When rewriting the recipe I had two goals in mind: 1. Stay with upstream defaults as much as possible 2. Add custom patches only when their necessity was proven through testing. http://arsv.github.io/perl-cross/ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Diffstat (limited to 'meta/recipes-devtools/perl-sanity/perl-ptest.inc')
-rw-r--r--meta/recipes-devtools/perl-sanity/perl-ptest.inc57
1 files changed, 57 insertions, 0 deletions
diff --git a/meta/recipes-devtools/perl-sanity/perl-ptest.inc b/meta/recipes-devtools/perl-sanity/perl-ptest.inc
new file mode 100644
index 0000000000..597e5d841e
--- /dev/null
+++ b/meta/recipes-devtools/perl-sanity/perl-ptest.inc
@@ -0,0 +1,57 @@
+inherit ptest
+
+SRC_URI += "file://run-ptest \
+ "
+do_install_ptest () {
+ mkdir -p ${D}${PTEST_PATH}
+ sed -e "s:\/usr\/local:${bindir}:g" -i cpan/version/t/*
+ sed -e "s:\/opt:\/usr:" -i Porting/add-package.pl
+ sed -e "s:\/local\/gnu\/:\/:" -i hints/cxux.sh
+ tar -c --exclude=try --exclude=a.out --exclude='*.o' --exclude=libperl.so* --exclude=Makefile --exclude=makefile --exclude=hostperl \
+ --exclude=cygwin --exclude=os2 --exclude=djgpp --exclude=qnx --exclude=symbian --exclude=haiku \
+ --exclude=vms --exclude=vos --exclude=NetWare --exclude=amigaos4 --exclude=buildcustomize.pl \
+ --exclude='win32/config.*' --exclude=plan9 --exclude=README.plan9 --exclude=perlplan9.pod --exclude=Configure \
+ --exclude=veryclean.sh --exclude=realclean.sh --exclude=getioctlsizes \
+ --exclude=dl_aix.xs --exclude=sdbm.3 --exclude='cflags.SH' --exclude=makefile.old \
+ --exclude=miniperl --exclude=generate_uudmap --exclude=patches * | ( cd ${D}${PTEST_PATH} && tar -x )
+
+ ln -sf ${bindir}/perl ${D}${PTEST_PATH}/t/perl
+
+ # Remove build host references from various scattered files...
+ find "${D}${PTEST_PATH}" \
+ \( -name '*.PL' -o -name 'myconfig' -o -name 'cflags' -o -name '*.pl' -o -name '*.sh' -o -name '*.pm' \
+ -o -name 'h2xs' -o -name 'h2ph' \
+ -o -name '*.h' -o -name 'config.sh-*' -o -name 'pod2man' -o -name 'pod2text' \) \
+ -type f -exec sed -i \
+ -e "s,${D},,g" \
+ -e "s,--sysroot=${STAGING_DIR_HOST},,g" \
+ -e "s,-isystem${STAGING_INCDIR} ,,g" \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ -e "s,${STAGING_BINDIR_NATIVE}/perl-native/,${bindir}/,g" \
+ -e "s,${STAGING_LIBDIR},${libdir},g" \
+ -e "s,${STAGING_BINDIR},${bindir},g" \
+ -e "s,${STAGING_INCDIR},${includedir},g" \
+ -e "s,${STAGING_BINDIR_NATIVE}/,,g" \
+ -e "s,${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX},${bindir},g" \
+ -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
+ -e 's:${RECIPE_SYSROOT}::g' \
+ {} +
+
+ # Remove a useless timestamp...
+ sed -i -e '/Autogenerated starting on/d' ${D}${PTEST_PATH}/lib/unicore/mktables.lst
+}
+
+python populate_packages_prepend() {
+ # Put all *.t files from the lib dir in the ptest package
+ # do_split_packages requires a pair of () in the regex, but we have nothing
+ # to match, so use an empty pair.
+ if bb.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d):
+ do_split_packages(d, d.expand('${libdir}/perl/${PV}'), '.*\.t()',
+ '${PN}-ptest%s', '%s', recursive=True, match_path=True)
+}
+
+RDEPENDS_${PN}-ptest += "${PN}-modules ${PN}-doc sed"
+
+# The perl-ptest package contains Perl internal modules and generating file
+# dependencies for it causes problems.
+SKIP_FILEDEPS_${PN}-ptest = '1'