Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | inherit ptest |
| 2 | |
| 3 | SRC_URI += "file://run-ptest \ |
| 4 | " |
Brad Bishop | c8f4712 | 2019-06-24 09:36:18 -0400 | [diff] [blame] | 5 | |
| 6 | DEBUG_PREFIX_MAP_REGEX = "${@'\\|'.join(d.getVar('DEBUG_PREFIX_MAP').split())}" |
| 7 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 8 | do_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 Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 13 | tar -c --exclude=try --exclude=a.out --exclude='*.o' --exclude=libperl.so* --exclude=[Mm]akefile --exclude=hostperl \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 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 \ |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 18 | --exclude=dl_aix.xs --exclude=sdbm.3 --exclude='cflags.SH' --exclude=[Mm]akefile.old \ |
Brad Bishop | c8f4712 | 2019-06-24 09:36:18 -0400 | [diff] [blame] | 19 | --exclude=miniperl --exclude=generate_uudmap --exclude=patches --exclude='config.log' * | ( cd ${D}${PTEST_PATH} && tar -x ) |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 20 | |
| 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 Bishop | c8f4712 | 2019-06-24 09:36:18 -0400 | [diff] [blame] | 27 | -o -name '*.h' -o -name 'config.sh-*' -o -name 'pod2man' -o -name 'pod2text' -o -name 'Makefile.config' \) \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 28 | -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 Bishop | c8f4712 | 2019-06-24 09:36:18 -0400 | [diff] [blame] | 32 | -e 's^${DEBUG_PREFIX_MAP_REGEX}^^g' \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 33 | -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 Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 45 | |
| 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 Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 48 | } |
| 49 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 50 | python populate_packages:prepend() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 51 | # 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 Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 59 | RDEPENDS:${PN}-ptest += "${PN}-modules ${PN}-doc sed" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 60 | |
| 61 | # The perl-ptest package contains Perl internal modules and generating file |
| 62 | # dependencies for it causes problems. |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 63 | SKIP_FILEDEPS:${PN}-ptest = '1' |