blob: e381bad14892dd7286542374f8588c17d26cc1f2 [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 \
19 file://remove-sensitive-tests.patch \
20 file://run-ptest \
21 "
22
23SRC_URI[sha256sum] = "529e7c8c6acf21ff3a6183f4d763c632810908989c24675c77995d51ac37b79c"
24
25inherit autotools gettext texinfo update-alternatives
26
27FILES:${PN} += "${datadir}/awk"
28FILES:${PN}-dev += "${libdir}/${BPN}/*.la"
29
30PACKAGES =+ "${PN}-gawkbug"
31FILES:${PN}-gawkbug += "${bindir}/gawkbug"
32
33ALTERNATIVE:${PN} = "awk"
34ALTERNATIVE_TARGET[awk] = "${bindir}/gawk"
35ALTERNATIVE_PRIORITY = "100"
36
37do_install:append() {
38 # remove the link since we don't package it
39 rm ${D}${bindir}/awk
40 # Strip non-reproducible build flags (containing build paths)
41 sed -i -e 's|^CC.*|CC=""|g' -e 's|^CFLAGS.*|CFLAGS=""|g' ${D}${bindir}/gawkbug
42}
43
44inherit ptest
45
46do_install_ptest() {
47 mkdir ${D}${PTEST_PATH}/test
48 ln -s ${bindir}/gawk ${D}${PTEST_PATH}/gawk
49 # The list of tests is all targets in Maketests, apart from the dummy Gt-dummy
50 TESTS=$(awk -F: '$1 == "Gt-dummy" { next } /[[:alnum:]]+:$/ { print $1 }' ${S}/test/Maketests)
51 for i in $TESTS Maketests inclib.awk; do
52 cp ${S}/test/$i* ${D}${PTEST_PATH}/test
53 done
54 sed -i \
55 -e 's|#!${base_bindir}/awk|#!${bindir}/awk|g' ${D}${PTEST_PATH}/test/*.awk
56
57 sed -i -e "s|GAWKLOCALE|LANG|g" ${D}${PTEST_PATH}/test/Maketests
58
59 # These tests require an unloaded host as otherwise timing sensitive tests can fail
60 # https://bugzilla.yoctoproject.org/show_bug.cgi?id=14371
61 rm -f ${D}${PTEST_PATH}/test/time.*
62 rm -f ${D}${PTEST_PATH}/test/timeout.*
63}
64
65RDEPENDS:${PN}-ptest += "make"
66
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050067RDEPENDS:${PN}-ptest:append:libc-glibc = " locale-base-en-us locale-base-en-us.iso-8859-1"
Andrew Geissler517393d2023-01-13 08:55:19 -060068
69BBCLASSEXTEND = "native nativesdk"