blob: c233fab54532428bf949075611f12197f1065315 [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
Andrew Geissler615f2f12022-07-15 14:00:58 -050013 tar -c --exclude=try --exclude=a.out --exclude='*.o' --exclude=libperl.so* --exclude=[Mm]akefile --exclude=hostperl \
Brad Bishop19323692019-04-05 15:28:33 -040014 --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 \
Andrew Geissler615f2f12022-07-15 14:00:58 -050018 --exclude=dl_aix.xs --exclude=sdbm.3 --exclude='cflags.SH' --exclude=[Mm]akefile.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
Andrew Geissler82c905d2020-04-13 13:39:40 -050045
46 # Remove files with host-specific configuration for building native binaries
47 rm ${D}${PTEST_PATH}/Makefile.config ${D}${PTEST_PATH}/xconfig.h ${D}${PTEST_PATH}/xconfig.sh
Brad Bishop19323692019-04-05 15:28:33 -040048}
49
Patrick Williams213cb262021-08-07 19:21:33 -050050python populate_packages:prepend() {
Brad Bishop19323692019-04-05 15:28:33 -040051 # Put all *.t files from the lib dir in the ptest package
52 # do_split_packages requires a pair of () in the regex, but we have nothing
53 # to match, so use an empty pair.
54 if bb.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d):
55 do_split_packages(d, d.expand('${libdir}/perl/${PV}'), r'.*\.t()',
56 '${PN}-ptest%s', '%s', recursive=True, match_path=True)
57}
58
Patrick Williams213cb262021-08-07 19:21:33 -050059RDEPENDS:${PN}-ptest += "${PN}-modules ${PN}-doc sed"
Brad Bishop19323692019-04-05 15:28:33 -040060
61# The perl-ptest package contains Perl internal modules and generating file
62# dependencies for it causes problems.
Patrick Williams213cb262021-08-07 19:21:33 -050063SKIP_FILEDEPS:${PN}-ptest = '1'