summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/gawk
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/gawk')
-rw-r--r--meta/recipes-extended/gawk/gawk/0001-Use-cross-AR-during-compile.patch35
-rw-r--r--meta/recipes-extended/gawk/gawk/0001-m4-readline-add-missing-includes.patch38
-rw-r--r--meta/recipes-extended/gawk/gawk/run-ptest7
-rw-r--r--meta/recipes-extended/gawk/gawk_5.1.0.bb60
-rw-r--r--meta/recipes-extended/gawk/gawk_5.3.0.bb88
5 files changed, 132 insertions, 96 deletions
diff --git a/meta/recipes-extended/gawk/gawk/0001-Use-cross-AR-during-compile.patch b/meta/recipes-extended/gawk/gawk/0001-Use-cross-AR-during-compile.patch
deleted file mode 100644
index ca0d668ce9..0000000000
--- a/meta/recipes-extended/gawk/gawk/0001-Use-cross-AR-during-compile.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1From 207b94e37c84007b294e57878c913271aad544ef Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 11 Nov 2020 23:13:23 -0800
4Subject: [PATCH] Use cross AR during compile
5
6If AR is specifcied then it should be used instead of defaulting to 'ar'
7from host
8
9Upstream-Status: Pending
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 configure.ac | 7 +++++++
13 1 file changed, 7 insertions(+)
14
15diff --git a/configure.ac b/configure.ac
16index 31364ab..4804f7b 100644
17--- a/configure.ac
18+++ b/configure.ac
19@@ -92,6 +92,13 @@ GAWK_CANONICAL_HOST
20 AC_USE_SYSTEM_EXTENSIONS
21
22 dnl checks for programs
23+m4_ifndef([AC_PROG_AR],[dnl
24+ AN_MAKEVAR([AR], [AC_PROG_AR])
25+ AN_PROGRAM([ar], [AC_PROG_AR])
26+ AC_DEFUN([AC_PROG_AR],
27+ [AC_CHECK_TOOL(AR, ar, :)])
28+])
29+AC_PROG_AR
30 AC_PROG_EGREP
31 AC_PROG_YACC
32 AC_PROG_LN_S
33--
342.29.2
35
diff --git a/meta/recipes-extended/gawk/gawk/0001-m4-readline-add-missing-includes.patch b/meta/recipes-extended/gawk/gawk/0001-m4-readline-add-missing-includes.patch
new file mode 100644
index 0000000000..5be2fd97ee
--- /dev/null
+++ b/meta/recipes-extended/gawk/gawk/0001-m4-readline-add-missing-includes.patch
@@ -0,0 +1,38 @@
1From 4f4e84f139e2a8682f1374a592f2636c43ad857b Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@arm.com>
3Date: Tue, 21 May 2024 15:10:11 +0000
4Subject: [PATCH] m4/readline: add missing includes
5
6The cross-specific code fragment only includes stdio.h, where the native
7fragment also includes fcntl.h and unistd.h. This is important because
8GCC 14.1 has made the implicit definitions an error:
9
10conftest.c: In function 'main':
11conftest.c:144:9: error: implicit declaration of function 'close'; did you mean 'pclose'? [-Wimplicit-function-declaration]
12conftest.c:146:14: error: implicit declaration of function 'open'; did you mean 'popen'? [-Wimplicit-function-declaration]
13
14Add the missing includes so that the check doesn't always fail due to
15these errors.
16
17Upstream-Status: Submitted [https://lists.gnu.org/archive/html/bug-gawk/2024-05/msg00000.html]
18Signed-off-by: Ross Burton <ross.burton@arm.com>
19---
20 m4/readline.m4 | 2 ++
21 1 file changed, 2 insertions(+)
22
23diff --git a/m4/readline.m4 b/m4/readline.m4
24index 38f96326..efd52d4e 100644
25--- a/m4/readline.m4
26+++ b/m4/readline.m4
27@@ -66,6 +66,8 @@ dnl action if false:
28 dnl action if cross compiling:
29 [AC_LINK_IFELSE(
30 [AC_LANG_PROGRAM([[#include <stdio.h>
31+#include <fcntl.h>
32+#include <unistd.h>
33 #include <readline/readline.h>
34 #include <readline/history.h>]], dnl includes
35 dnl function body
36--
372.34.1
38
diff --git a/meta/recipes-extended/gawk/gawk/run-ptest b/meta/recipes-extended/gawk/gawk/run-ptest
index f67a95874f..f4ef3e7bd4 100644
--- a/meta/recipes-extended/gawk/gawk/run-ptest
+++ b/meta/recipes-extended/gawk/gawk/run-ptest
@@ -2,7 +2,12 @@
2 2
3cd test 3cd test
4for i in `grep -E "^[a-z0-9_-]*:$" Maketests |awk -F: '{print $1}'`; do 4for i in `grep -E "^[a-z0-9_-]*:$" Maketests |awk -F: '{print $1}'`; do
5 #LC_ALL=${GAWKLOCALE:-C} LANG=${GAWKLOCALE:-C} 5 unset LANG
6 grep -q "^$i$" skipped.txt
7 if [ $? -eq 0 ]; then
8 echo "SKIP: $i"
9 continue
10 fi
6 srcdir=`pwd` AWKPROG=gawk AWK=gawk CMP=cmp make -f Maketests $i >$i.tmp 2>&1 11 srcdir=`pwd` AWKPROG=gawk AWK=gawk CMP=cmp make -f Maketests $i >$i.tmp 2>&1
7 if [ -e _$i ]; then 12 if [ -e _$i ]; then
8 cat _$i 13 cat _$i
diff --git a/meta/recipes-extended/gawk/gawk_5.1.0.bb b/meta/recipes-extended/gawk/gawk_5.1.0.bb
deleted file mode 100644
index ae897be62e..0000000000
--- a/meta/recipes-extended/gawk/gawk_5.1.0.bb
+++ /dev/null
@@ -1,60 +0,0 @@
1SUMMARY = "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: GPLv2
10# gawk >= 3.1.6: GPLv3
11LICENSE = "GPLv3"
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://run-ptest \
20 file://0001-Use-cross-AR-during-compile.patch \
21"
22
23SRC_URI[md5sum] = "f719bc9966df28e67fc6ebc405e7ea03"
24SRC_URI[sha256sum] = "03a0360edcd84bec156fe211bbc4fc8c78790973ce4e8b990a11d778d40b1a26"
25
26inherit autotools gettext texinfo update-alternatives
27
28FILES_${PN} += "${datadir}/awk"
29FILES_${PN}-dev += "${libdir}/${BPN}/*.la"
30
31ALTERNATIVE_${PN} = "awk"
32ALTERNATIVE_TARGET[awk] = "${bindir}/gawk"
33ALTERNATIVE_PRIORITY = "100"
34
35do_install_append() {
36 # remove the link since we don't package it
37 rm ${D}${bindir}/awk
38}
39
40inherit ptest
41
42do_install_ptest() {
43 mkdir ${D}${PTEST_PATH}/test
44 ln -s ${bindir}/gawk ${D}${PTEST_PATH}/gawk
45 for i in `grep -vE "@|^$|#|Gt-dummy" ${S}/test/Maketests |awk -F: '{print $1}'` Maketests inclib.awk; \
46 do cp ${S}/test/$i* ${D}${PTEST_PATH}/test; \
47 done
48 sed -i -e 's|/usr/local/bin|${bindir}|g' \
49 -e 's|#!${base_bindir}/awk|#!${bindir}/awk|g' ${D}${PTEST_PATH}/test/*.awk
50
51 sed -i -e "s|GAWKLOCALE|LANG|g" ${D}${PTEST_PATH}/test/Maketests
52}
53
54RDEPENDS_${PN}-ptest += "make"
55
56RDEPENDS_${PN}-ptest_append_libc-glibc = "\
57 locale-base-en-us.iso-8859-1 \
58"
59
60BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-extended/gawk/gawk_5.3.0.bb b/meta/recipes-extended/gawk/gawk_5.3.0.bb
new file mode 100644
index 0000000000..e94cf19db4
--- /dev/null
+++ b/meta/recipes-extended/gawk/gawk_5.3.0.bb
@@ -0,0 +1,88 @@
1SUMMARY = "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://0001-m4-readline-add-missing-includes.patch \
20 file://run-ptest \
21 "
22
23SRC_URI[sha256sum] = "378f8864ec21cfceaa048f7e1869ac9b4597b449087caf1eb55e440d30273336"
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 for t in time timeout; do
64 echo $t >> ${D}${PTEST_PATH}/test/skipped.txt
65 done
66}
67
68do_install_ptest:append:libc-musl() {
69 # Reported https://lists.gnu.org/archive/html/bug-gawk/2021-02/msg00005.html
70 rm -f ${D}${PTEST_PATH}/test/clos1way6.*
71 # Needs en_US.UTF-8 but then does not work with musl
72 rm -f ${D}${PTEST_PATH}/test/backsmalls1.*
73 # Needs en_US.UTF-8 but then does not work with musl
74 rm -f ${D}${PTEST_PATH}/test/commas.*
75 # The below two need LANG=C inside the make rule for musl
76 rm -f ${D}${PTEST_PATH}/test/rebt8b1.*
77 rm -f ${D}${PTEST_PATH}/test/regx8bit.*
78 for t in clos1way6 backsmalls1 commas rebt8b1 regx8bit; do
79 echo $t >> ${D}${PTEST_PATH}/test/skipped.txt
80 done
81}
82
83RDEPENDS:${PN}-ptest += "make locale-base-en-us coreutils"
84
85RDEPENDS:${PN}-ptest:append:libc-glibc = " locale-base-en-us.iso-8859-1"
86RDEPENDS:${PN}-ptest:append:libc-musl = " musl-locales"
87
88BBCLASSEXTEND = "native nativesdk"