perl-ptest.inc 3.0 KB

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