gawk_5.3.2.bb 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. SUMMARY = "GNU awk text processing utility"
  2. DESCRIPTION = "The GNU version of awk, a text processing utility. \
  3. Awk interprets a special-purpose programming language to do \
  4. quick and easy text pattern matching and reformatting jobs."
  5. HOMEPAGE = "https://www.gnu.org/software/gawk/"
  6. BUGTRACKER = "bug-gawk@gnu.org"
  7. SECTION = "console/utils"
  8. # gawk <= 3.1.5: GPL-2.0-only
  9. # gawk >= 3.1.6: GPL-3.0-only
  10. LICENSE = "GPL-3.0-only"
  11. LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
  12. PACKAGECONFIG ??= "readline mpfr"
  13. PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
  14. PACKAGECONFIG[mpfr] = "--with-mpfr,--without-mpfr, mpfr"
  15. SRC_URI = "${GNU_MIRROR}/gawk/gawk-${PV}.tar.gz \
  16. file://run-ptest \
  17. file://0001-configure.ac-re-enable-disabled-printf-features.patch \
  18. "
  19. SRC_URI[sha256sum] = "8639a1a88fb411a1be02663739d03e902a6d313b5c6fe024d0bfeb3341a19a11"
  20. inherit autotools gettext texinfo update-alternatives
  21. FILES:${PN} += "${datadir}/awk"
  22. FILES:${PN}-dev += "${libdir}/${BPN}/*.la"
  23. PACKAGES =+ "${PN}-gawkbug"
  24. FILES:${PN}-gawkbug += "${bindir}/gawkbug"
  25. ALTERNATIVE:${PN} = "awk"
  26. ALTERNATIVE_TARGET[awk] = "${bindir}/gawk"
  27. ALTERNATIVE_PRIORITY = "100"
  28. do_install:append() {
  29. # remove the link since we don't package it
  30. rm ${D}${bindir}/awk
  31. # Strip non-reproducible build flags (containing build paths)
  32. sed -i -e 's|^CC.*|CC=""|g' -e 's|^CFLAGS.*|CFLAGS=""|g' ${D}${bindir}/gawkbug
  33. }
  34. inherit ptest
  35. do_install_ptest() {
  36. mkdir ${D}${PTEST_PATH}/test
  37. ln -s ${bindir}/gawk ${D}${PTEST_PATH}/gawk
  38. # The list of tests is all targets in Maketests, apart from the dummy Gt-dummy
  39. TESTS=$(awk -F: '$1 == "Gt-dummy" { next } /[[:alnum:]]+:$/ { print $1 }' ${S}/test/Maketests)
  40. for i in $TESTS Maketests inclib.awk; do
  41. cp ${S}/test/$i* ${D}${PTEST_PATH}/test
  42. done
  43. sed -i \
  44. -e 's|#! /bin/gawk|#! ${bindir}/gawk|g' \
  45. -e 's|#! /usr/local/bin/gawk|#! ${bindir}/gawk|g' \
  46. -e 's|#!${base_bindir}/awk|#!${bindir}/awk|g' ${D}${PTEST_PATH}/test/*.awk
  47. sed -i -e "s|GAWKLOCALE|LANG|g" ${D}${PTEST_PATH}/test/Maketests
  48. # These tests require an unloaded host as otherwise timing sensitive tests can fail
  49. # https://bugzilla.yoctoproject.org/show_bug.cgi?id=14371
  50. rm -f ${D}${PTEST_PATH}/test/time.*
  51. rm -f ${D}${PTEST_PATH}/test/timeout.*
  52. for t in time timeout; do
  53. echo $t >> ${D}${PTEST_PATH}/test/skipped.txt
  54. done
  55. }
  56. do_install_ptest:append:libc-musl() {
  57. # Reported https://lists.gnu.org/archive/html/bug-gawk/2021-02/msg00005.html
  58. rm -f ${D}${PTEST_PATH}/test/clos1way6.*
  59. # Needs en_US.UTF-8 but then does not work with musl
  60. rm -f ${D}${PTEST_PATH}/test/backsmalls1.*
  61. # Needs en_US.UTF-8 but then does not work with musl
  62. rm -f ${D}${PTEST_PATH}/test/commas.*
  63. # The below two need LANG=C inside the make rule for musl
  64. rm -f ${D}${PTEST_PATH}/test/rebt8b1.*
  65. rm -f ${D}${PTEST_PATH}/test/regx8bit.*
  66. for t in clos1way6 backsmalls1 commas rebt8b1 regx8bit; do
  67. echo $t >> ${D}${PTEST_PATH}/test/skipped.txt
  68. done
  69. }
  70. RDEPENDS:${PN}-ptest += "make locale-base-en-us coreutils"
  71. RDEPENDS:${PN}-ptest:append:libc-glibc = " locale-base-en-us.iso-8859-1"
  72. RDEPENDS:${PN}-ptest:append:libc-musl = " musl-locales"
  73. BBCLASSEXTEND = "native nativesdk"