gawk: upgraded package to upstream

Upgraded sys-apps/gawk to version 5.0.1 on amd64.
This brings in a fix for compiler flag error related to
"-export-dynamic" usage which has been fixed in upstream.

BUG=chromium:1114166
TEST=CQ

Change-Id: I2705a7a776433c10f37fa8f5e233fcfb93667142
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/portage-stable/+/2372697
Reviewed-by: Allen Webb <allenwebb@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
diff --git a/metadata/md5-cache/sys-apps/gawk-4.1.1-r1 b/metadata/md5-cache/sys-apps/gawk-4.1.1-r1
deleted file mode 100644
index 5b57bd3..0000000
--- a/metadata/md5-cache/sys-apps/gawk-4.1.1-r1
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=configure install postinst postrm prepare
-DEPEND=mpfr? ( dev-libs/mpfr ) readline? ( sys-libs/readline ) nls? ( sys-devel/gettext )
-DESCRIPTION=GNU awk pattern-matching language
-EAPI=4
-HOMEPAGE=http://www.gnu.org/software/gawk/gawk.html
-IUSE=mpfr nls readline
-KEYWORDS=*
-LICENSE=GPL-2
-RDEPEND=mpfr? ( dev-libs/mpfr ) readline? ( sys-libs/readline )
-SLOT=0
-SRC_URI=mirror://gnu/gawk/gawk-4.1.1.tar.xz
-_eclasses_=eutils	06133990e861be0fe60c2b428fd025d9	multilib	2477ebe553d3e4d2c606191fe6c33602	toolchain-funcs	605c126bed8d87e4378d5ff1645330cb
-_md5_=e290b67e924e156ec37c5841dd9e481a
diff --git a/metadata/md5-cache/sys-apps/gawk-5.0.1 b/metadata/md5-cache/sys-apps/gawk-5.0.1
new file mode 100644
index 0000000..90c74a7
--- /dev/null
+++ b/metadata/md5-cache/sys-apps/gawk-5.0.1
@@ -0,0 +1,14 @@
+BDEPEND=nls? ( sys-devel/gettext )
+DEFINED_PHASES=configure install postinst postrm prepare
+DEPEND=dev-libs/gmp:0= mpfr? ( dev-libs/mpfr:0= ) readline? ( sys-libs/readline:0= )
+DESCRIPTION=GNU awk pattern-matching language
+EAPI=7
+HOMEPAGE=https://www.gnu.org/software/gawk/gawk.html
+IUSE=mpfr nls readline
+KEYWORDS=*
+LICENSE=GPL-2
+RDEPEND=dev-libs/gmp:0= mpfr? ( dev-libs/mpfr:0= ) readline? ( sys-libs/readline:0= )
+SLOT=0
+SRC_URI=mirror://gnu/gawk/gawk-5.0.1.tar.xz
+_eclasses_=multilib	2477ebe553d3e4d2c606191fe6c33602	toolchain-funcs	605c126bed8d87e4378d5ff1645330cb
+_md5_=a71741ba2b3a0e7a3dc8917237783d7f
diff --git a/sys-apps/gawk/Manifest b/sys-apps/gawk/Manifest
index 5d0f290..0be452a 100644
--- a/sys-apps/gawk/Manifest
+++ b/sys-apps/gawk/Manifest
@@ -1 +1 @@
-DIST gawk-4.1.1.tar.xz 2196904 SHA256 efd4c6aafb1ce996309fc903ceb625e7012221c464eb72483dbb23adef1ee8db SHA512 f11d7ef03e69f554baf80b0e75c2de8916aaefd5481c2ed8b83cde8edf09f765c18a4cef6175934fa29cc1afa30b8f7e54266b28377705eaca154146e03f634b WHIRLPOOL bbc42530767f4b2ad32b9de62bc82712c4d1c44433c6c9ab8ea8cbf271bc5735a258cda0163e9e8fe92cbbd625aca00c3bcf68c406f8ed4777081b553814d149
+DIST gawk-5.0.1.tar.xz 3136004 BLAKE2B 1dd8a9bca2488f2d3c946406b01fcbdce0487922ece49fe2121c39d6d10bcfcb6a056edbbf88ba6c22772ef88a250fc8ffcba33ead399c0d7c8f5d19d0e896d3 SHA512 ff9842a91035f843482d93eac8a35cddf2ce16acaa43a0112c1efff08802aebf705ee70d47eff74a190dca7be330c31f7204ad27cb63bdee65333f9b9c984212
diff --git a/sys-apps/gawk/files/gawk-4.1.1-sandbox_issue.patch b/sys-apps/gawk/files/gawk-4.1.1-sandbox_issue.patch
deleted file mode 100644
index c641035..0000000
--- a/sys-apps/gawk/files/gawk-4.1.1-sandbox_issue.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Fix sandbox issue.
-
-Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
-
---- gawk-4.1.1/extension/Makefile.am	2014-02-20 19:42:25.000000000 +0100
-+++ gawk-4.1.1/extension/Makefile.am	2014-02-20 19:42:25.000000000 +0100
-@@ -100,7 +100,7 @@
- 
- install-data-hook:
- 	for i in $(pkgextension_LTLIBRARIES) ; do \
--		$(RM) $(pkgextensiondir)/$$i ; \
-+		$(RM) $(DESTDIR)$(pkgextensiondir)/$$i ; \
- 	done
- 
- # Keep the uninstall check working:
---- gawk-4.1.1/extension/Makefile.in	2014-04-08 18:13:03.000000000 +0200
-+++ gawk-4.1.1/extension/Makefile.in	2014-04-08 18:13:03.000000000 +0200
-@@ -1231,7 +1231,7 @@
- 
- install-data-hook:
- 	for i in $(pkgextension_LTLIBRARIES) ; do \
--		$(RM) $(pkgextensiondir)/$$i ; \
-+		$(RM) $(DESTDIR)$(pkgextensiondir)/$$i ; \
- 	done
- 
- # Keep the uninstall check working:
diff --git a/sys-apps/gawk/files/gawk-4.1.1-sigpipe.patch b/sys-apps/gawk/files/gawk-4.1.1-sigpipe.patch
deleted file mode 100644
index a64e116..0000000
--- a/sys-apps/gawk/files/gawk-4.1.1-sigpipe.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 19564e696aca506a14ceb4a08aa2b7c7988a2473 Mon Sep 17 00:00:00 2001
-From: Arnold D. Robbins <arnold@skeeve.com>
-Date: Fri, 25 Apr 2014 10:21:43 +0000
-Subject: In forked children, set SIGPIPE to SIG_DFL.
-
----
-* io.c (two_way_open): In forked child, reset SIGPIPE to SIG_DFL.
-Fixes problems with "broken pipe" errors from child processes,
-restoring 4.1.0 and earlier behavior. Thanks to Daryl F
-<wyatt@prairieturtle.ca> for the report.
-(gawk_popen): Ditto.
-
-diff --git a/io.c b/io.c
-index a6e786f..2bb8f28 100644
---- a/io.c
-+++ b/io.c
-@@ -2078,6 +2078,7 @@ use_pipes:
- 		    || close(ctop[0]) == -1 || close(ctop[1]) == -1)
- 			fatal(_("close of pipe failed (%s)"), strerror(errno));
- 		/* stderr does NOT get dup'ed onto child's stdout */
-+		signal(SIGPIPE, SIG_DFL);
- 		execl("/bin/sh", "sh", "-c", str, NULL);
- 		_exit(errno == ENOENT ? 127 : 126);
- 	}
-@@ -2271,6 +2272,7 @@ gawk_popen(const char *cmd, struct redirect *rp)
- 			fatal(_("moving pipe to stdout in child failed (dup: %s)"), strerror(errno));
- 		if (close(p[0]) == -1 || close(p[1]) == -1)
- 			fatal(_("close of pipe failed (%s)"), strerror(errno));
-+		signal(SIGPIPE, SIG_DFL);
- 		execl("/bin/sh", "sh", "-c", cmd, NULL);
- 		_exit(errno == ENOENT ? 127 : 126);
- 	}
---
-cgit v0.9.0.2
diff --git a/sys-apps/gawk/gawk-4.1.1-r1.ebuild b/sys-apps/gawk/gawk-4.1.1-r1.ebuild
deleted file mode 100644
index a5882d7..0000000
--- a/sys-apps/gawk/gawk-4.1.1-r1.ebuild
+++ /dev/null
@@ -1,76 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/gawk/gawk-4.1.1-r1.ebuild,v 1.1 2014/04/25 18:41:07 polynomial-c Exp $
-
-EAPI="4"
-
-inherit eutils toolchain-funcs multilib
-
-DESCRIPTION="GNU awk pattern-matching language"
-HOMEPAGE="http://www.gnu.org/software/gawk/gawk.html"
-SRC_URI="mirror://gnu/gawk/${P}.tar.xz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="*"
-IUSE="mpfr nls readline"
-
-RDEPEND="mpfr? ( dev-libs/mpfr )
-	readline? ( sys-libs/readline )"
-DEPEND="${RDEPEND}
-	nls? ( sys-devel/gettext )"
-
-src_prepare() {
-	EPATCH_OPTS="-Z" \
-	epatch "${FILESDIR}"/${P}-sandbox_issue.patch
-	epatch "${FILESDIR}"/${P}-sigpipe.patch #507340
-
-	# use symlinks rather than hardlinks, and disable version links
-	sed -i \
-		-e '/^LN =/s:=.*:= $(LN_S):' \
-		-e '/install-exec-hook:/s|$|\nfoo:|' \
-		Makefile.in doc/Makefile.in || die
-	sed -i '/^pty1:$/s|$|\n_pty1:|' test/Makefile.in #413327
-	# disable pointless build time hack that breaks cross-compiling #493362
-	sed -i \
-		-e '/check-recursive all-recursive: check-for-shared-lib-support/d' \
-		extension/Makefile.in || die
-}
-
-src_configure() {
-	export ac_cv_libsigsegv=no
-	econf \
-		--libexec='$(libdir)/misc' \
-		$(use_with mpfr) \
-		$(use_enable nls) \
-		$(use_with readline)
-}
-
-src_install() {
-	rm -rf README_d # automatic dodocs barfs
-	default
-
-	# Install headers
-	insinto /usr/include/awk
-	doins *.h || die
-	rm "${ED}"/usr/include/awk/config.h || die
-}
-
-pkg_postinst() {
-	# symlink creation here as the links do not belong to gawk, but to any awk
-	if has_version app-admin/eselect && has_version app-admin/eselect-awk ; then
-		eselect awk update ifunset
-	else
-		local l
-		for l in "${EROOT}"usr/share/man/man1/gawk.1* "${EROOT}"usr/bin/gawk; do
-			[[ -e ${l} && ! -e ${l/gawk/awk} ]] && ln -s "${l##*/}" "${l/gawk/awk}"
-		done
-		[[ ! -e ${EROOT}bin/awk ]] && ln -s "../usr/bin/gawk" "${EROOT}bin/awk"
-	fi
-}
-
-pkg_postrm() {
-	if has_version app-admin/eselect && has_version app-admin/eselect-awk ; then
-		eselect awk update ifunset
-	fi
-}
diff --git a/sys-apps/gawk/gawk-5.0.1.ebuild b/sys-apps/gawk/gawk-5.0.1.ebuild
new file mode 100644
index 0000000..e2e2da4
--- /dev/null
+++ b/sys-apps/gawk/gawk-5.0.1.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs multilib
+
+DESCRIPTION="GNU awk pattern-matching language"
+HOMEPAGE="https://www.gnu.org/software/gawk/gawk.html"
+SRC_URI="mirror://gnu/gawk/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="*"
+IUSE="mpfr nls readline"
+
+RDEPEND="
+	dev-libs/gmp:0=
+	mpfr? ( dev-libs/mpfr:0= )
+	readline? ( sys-libs/readline:0= )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	nls? ( sys-devel/gettext )
+"
+
+src_prepare() {
+	default
+
+	# use symlinks rather than hardlinks, and disable version links
+	sed -i \
+		-e '/^LN =/s:=.*:= $(LN_S):' \
+		-e '/install-exec-hook:/s|$|\nfoo:|' \
+		Makefile.in doc/Makefile.in || die
+	sed -i '/^pty1:$/s|$|\n_pty1:|' test/Makefile.in || die #413327
+	# fix standards conflict on Solaris
+	if [[ ${CHOST} == *-solaris* ]] ; then
+		sed -i \
+			-e '/\<_XOPEN_SOURCE\>/s/1$/600/' \
+			-e '/\<_XOPEN_SOURCE_EXTENDED\>/s/1//' \
+			extension/inplace.c || die
+	fi
+}
+
+src_configure() {
+	export ac_cv_libsigsegv=no
+	local myeconfargs=(
+		--libexec='$(libdir)/misc'
+		$(use_with mpfr)
+		$(use_enable nls)
+		$(use_with readline)
+	)
+	econf "${myeconfargs[@]}"
+}
+
+src_install() {
+	rm -rf README_d # automatic dodocs barfs
+	default
+
+	# Install headers
+	insinto /usr/include/awk
+	doins *.h
+	rm "${ED}"/usr/include/awk/config.h || die
+}
+
+pkg_postinst() {
+	# symlink creation here as the links do not belong to gawk, but to any awk
+	if has_version app-admin/eselect && has_version app-eselect/eselect-awk ; then
+		eselect awk update ifunset
+	else
+		local l
+		for l in "${EROOT}"/usr/share/man/man1/gawk.1* "${EROOT}"/usr/bin/gawk ; do
+			if [[ -e ${l} ]] && ! [[ -e ${l/gawk/awk} ]] ; then
+				ln -s "${l##*/}" "${l/gawk/awk}" || die
+			fi
+		done
+		if ! [[ -e ${EROOT}/bin/awk ]] ; then
+			ln -s "../usr/bin/gawk" "${EROOT}/bin/awk" || die
+		fi
+	fi
+}
+
+pkg_postrm() {
+	if has_version app-admin/eselect && has_version app-eselect/eselect-awk ; then
+		eselect awk update ifunset
+	fi
+}
diff --git a/sys-apps/gawk/metadata.xml b/sys-apps/gawk/metadata.xml
index 22beef6..3fa1f98 100644
--- a/sys-apps/gawk/metadata.xml
+++ b/sys-apps/gawk/metadata.xml
@@ -1,8 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
-<herd>base-system</herd>
+<maintainer type="project">
+	<email>base-system@gentoo.org</email>
+	<name>Gentoo Base System</name>
+</maintainer>
 <use>
- <flag name='mpfr'>use mpfr for high precision arithmetic (-M / --bignum)</flag>
+	<flag name="mpfr">use mpfr for high precision arithmetic (-M / --bignum)</flag>
 </use>
 </pkgmetadata>