blob: fe339805d03bf8a156eafc6f41961c499d8e546b [file] [log] [blame]
Andrew Geissler595f6302022-01-24 19:11:47 +00001SUMMARY = "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
Andrew Geissler9aee5002022-03-30 16:27:02 +00009# gawk <= 3.1.5: GPL-2.0-only
10# gawk >= 3.1.6: GPL-3.0-only
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000011LICENSE = "GPL-3.0-only"
Andrew Geissler595f6302022-01-24 19:11:47 +000012LIC_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 \
19 file://remove-sensitive-tests.patch \
20 file://run-ptest \
21 "
22
23SRC_URI[sha256sum] = "6168d8d1dc8f74bd17d9dc22fa9634c49070f232343b744901da15fb4f06bffd"
24
25inherit autotools gettext texinfo update-alternatives
26
27FILES:${PN} += "${datadir}/awk"
28FILES:${PN}-dev += "${libdir}/${BPN}/*.la"
29
30ALTERNATIVE:${PN} = "awk"
31ALTERNATIVE_TARGET[awk] = "${bindir}/gawk"
32ALTERNATIVE_PRIORITY = "100"
33
34do_install:append() {
35 # remove the link since we don't package it
36 rm ${D}${bindir}/awk
37}
38
39inherit ptest
40
41do_install_ptest() {
42 mkdir ${D}${PTEST_PATH}/test
43 ln -s ${bindir}/gawk ${D}${PTEST_PATH}/gawk
44 # The list of tests is all targets in Maketests, apart from the dummy Gt-dummy
45 TESTS=$(awk -F: '$1 == "Gt-dummy" { next } /[[:alnum:]]+:$/ { print $1 }' ${S}/test/Maketests)
46 for i in $TESTS Maketests inclib.awk; do
47 cp ${S}/test/$i* ${D}${PTEST_PATH}/test
48 done
49 sed -i -e 's|/usr/local/bin|${bindir}|g' \
50 -e 's|#!${base_bindir}/awk|#!${bindir}/awk|g' ${D}${PTEST_PATH}/test/*.awk
51
52 sed -i -e "s|GAWKLOCALE|LANG|g" ${D}${PTEST_PATH}/test/Maketests
53
54 # These tests require an unloaded host as otherwise timing sensitive tests can fail
55 # https://bugzilla.yoctoproject.org/show_bug.cgi?id=14371
56 rm -f ${D}${PTEST_PATH}/test/time.*
57 rm -f ${D}${PTEST_PATH}/test/timeout.*
58}
59
60RDEPENDS:${PN}-ptest += "make"
61
62RDEPENDS:${PN}-ptest:append:libc-glibc = " locale-base-en-us.iso-8859-1"
63
64BBCLASSEXTEND = "native nativesdk"