blob: 7152057762f0a73819fc494f9189365d519cda59 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001inherit ptest
2
3SRC_URI += "file://run-ptest \
4 "
Brad Bishopc8f47122019-06-24 09:36:18 -04005
6DEBUG_PREFIX_MAP_REGEX = "${@'\\|'.join(d.getVar('DEBUG_PREFIX_MAP').split())}"
7
Brad Bishop19323692019-04-05 15:28:33 -04008do_install_ptest () {
9 mkdir -p ${D}${PTEST_PATH}
10 sed -e "s:\/usr\/local:${bindir}:g" -i cpan/version/t/*
11 sed -e "s:\/opt:\/usr:" -i Porting/add-package.pl
12 sed -e "s:\/local\/gnu\/:\/:" -i hints/cxux.sh
13 tar -c --exclude=try --exclude=a.out --exclude='*.o' --exclude=libperl.so* --exclude=Makefile --exclude=makefile --exclude=hostperl \
14 --exclude=cygwin --exclude=os2 --exclude=djgpp --exclude=qnx --exclude=symbian --exclude=haiku \
15 --exclude=vms --exclude=vos --exclude=NetWare --exclude=amigaos4 --exclude=buildcustomize.pl \
16 --exclude='win32/config.*' --exclude=plan9 --exclude=README.plan9 --exclude=perlplan9.pod --exclude=Configure \
17 --exclude=veryclean.sh --exclude=realclean.sh --exclude=getioctlsizes \
18 --exclude=dl_aix.xs --exclude=sdbm.3 --exclude='cflags.SH' --exclude=makefile.old \
Brad Bishopc8f47122019-06-24 09:36:18 -040019 --exclude=miniperl --exclude=generate_uudmap --exclude=patches --exclude='config.log' * | ( cd ${D}${PTEST_PATH} && tar -x )
Brad Bishop19323692019-04-05 15:28:33 -040020
21 ln -sf ${bindir}/perl ${D}${PTEST_PATH}/t/perl
22
23 # Remove build host references from various scattered files...
24 find "${D}${PTEST_PATH}" \
25 \( -name '*.PL' -o -name 'myconfig' -o -name 'cflags' -o -name '*.pl' -o -name '*.sh' -o -name '*.pm' \
26 -o -name 'h2xs' -o -name 'h2ph' \
Brad Bishopc8f47122019-06-24 09:36:18 -040027 -o -name '*.h' -o -name 'config.sh-*' -o -name 'pod2man' -o -name 'pod2text' -o -name 'Makefile.config' \) \
Brad Bishop19323692019-04-05 15:28:33 -040028 -type f -exec sed -i \
29 -e "s,${D},,g" \
30 -e "s,--sysroot=${STAGING_DIR_HOST},,g" \
31 -e "s,-isystem${STAGING_INCDIR} ,,g" \
Brad Bishopc8f47122019-06-24 09:36:18 -040032 -e 's^${DEBUG_PREFIX_MAP_REGEX}^^g' \
Brad Bishop19323692019-04-05 15:28:33 -040033 -e "s,${STAGING_BINDIR_NATIVE}/perl-native/,${bindir}/,g" \
34 -e "s,${STAGING_LIBDIR},${libdir},g" \
35 -e "s,${STAGING_BINDIR},${bindir},g" \
36 -e "s,${STAGING_INCDIR},${includedir},g" \
37 -e "s,${STAGING_BINDIR_NATIVE}/,,g" \
38 -e "s,${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX},${bindir},g" \
39 -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
40 -e 's:${RECIPE_SYSROOT}::g' \
41 {} +
42
43 # Remove a useless timestamp...
44 sed -i -e '/Autogenerated starting on/d' ${D}${PTEST_PATH}/lib/unicore/mktables.lst
45}
46
47python populate_packages_prepend() {
48 # Put all *.t files from the lib dir in the ptest package
49 # do_split_packages requires a pair of () in the regex, but we have nothing
50 # to match, so use an empty pair.
51 if bb.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d):
52 do_split_packages(d, d.expand('${libdir}/perl/${PV}'), r'.*\.t()',
53 '${PN}-ptest%s', '%s', recursive=True, match_path=True)
54}
55
56RDEPENDS_${PN}-ptest += "${PN}-modules ${PN}-doc sed"
57
58# The perl-ptest package contains Perl internal modules and generating file
59# dependencies for it causes problems.
60SKIP_FILEDEPS_${PN}-ptest = '1'