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