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 |
| 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 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 |
| 45 | } |
| 46 | |
| 47 | python 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 | |
| 56 | RDEPENDS_${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. |
| 60 | SKIP_FILEDEPS_${PN}-ptest = '1' |