gcc-config: upgraded package to upstream

Upgraded sys-devel/gcc-config to version 2.3 on amd64

BUG=chromium:991812
TEST=CQ, SDK tryjob

Cq-Depend: chromium:2224035
Change-Id: I0f71c0ba90d547f9ba69080c300fc67cd4b064d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/portage-stable/+/2214498
Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/metadata/md5-cache/sys-devel/gcc-config-1.7.3 b/metadata/md5-cache/sys-devel/gcc-config-1.7.3
deleted file mode 100644
index ed9af92..0000000
--- a/metadata/md5-cache/sys-devel/gcc-config-1.7.3
+++ /dev/null
@@ -1,10 +0,0 @@
-DEFINED_PHASES=compile install postinst unpack
-DESCRIPTION=utility to manage compilers
-EAPI=0
-HOMEPAGE=http://git.overlays.gentoo.org/gitweb/?p=proj/gcc-config.git
-KEYWORDS=*
-LICENSE=GPL-2
-SLOT=0
-SRC_URI=mirror://gentoo/gcc-config-1.7.3.tar.xz http://dev.gentoo.org/~vapier/dist/gcc-config-1.7.3.tar.xz
-_eclasses_=multilib	b2f01ad412baf81650c23fcf0975fa33	toolchain-funcs	209edad4a5c4812e7b2f8021650974f0	unpacker	04385b0f181c42fa9c18ec0e31729d1f
-_md5_=9458cbccdf122ec4fd78cee9ec8cc6da
diff --git a/metadata/md5-cache/sys-devel/gcc-config-2.3 b/metadata/md5-cache/sys-devel/gcc-config-2.3
new file mode 100644
index 0000000..56ca4f2
--- /dev/null
+++ b/metadata/md5-cache/sys-devel/gcc-config-2.3
@@ -0,0 +1,12 @@
+DEFINED_PHASES=compile install postinst
+DESCRIPTION=Utility to manage compilers
+EAPI=7
+HOMEPAGE=https://gitweb.gentoo.org/proj/gcc-config.git/
+IUSE=+native-symlinks
+KEYWORDS=*
+LICENSE=GPL-2
+RDEPEND=>=sys-apps/gentoo-functions-0.10
+SLOT=0
+SRC_URI=https://dev.gentoo.org/~slyfox/distfiles/gcc-config-2.3.tar.xz
+_eclasses_=multilib	b2f01ad412baf81650c23fcf0975fa33	toolchain-funcs	209edad4a5c4812e7b2f8021650974f0
+_md5_=dc3cd7f9c1c09ea5a5cca2d411650342
diff --git a/sys-devel/gcc-config/Manifest b/sys-devel/gcc-config/Manifest
index 119dfa3..31862ba 100644
--- a/sys-devel/gcc-config/Manifest
+++ b/sys-devel/gcc-config/Manifest
@@ -1 +1 @@
-DIST gcc-config-1.7.3.tar.xz 15088 RMD160 398c3b36813d65580dc05fffb4bbe64746259f7d SHA1 08da2330e165c4fd0be71a6728339c4cff511bdc SHA256 2c6cca69a028f157dc54e19ea10efc240e0d26824cd223b22c294c003ce9325e
+DIST gcc-config-2.3.tar.xz 16736 BLAKE2B e8c22348d73ec756ebe377c3f9b0aca8e22b7ef53507bfa4dc0fbd459bca38ba6bea9dbb290b4d83239c21c913d12f8262a263e1c078a3997558a0b14fdf355d SHA512 4ce1e46bee6b2182c664746d939a7d843d5b4323c860ea3ee24e36aa629e65f3aa99da99905d4a7091ad0a3a37c14a6a56a0f79c76d6bc93fa0dad39552f221d
diff --git a/sys-devel/gcc-config/gcc-config-1.7.3.ebuild b/sys-devel/gcc-config/gcc-config-1.7.3.ebuild
deleted file mode 100644
index 7f8612e..0000000
--- a/sys-devel/gcc-config/gcc-config-1.7.3.ebuild
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/gcc-config-1.7.3.ebuild,v 1.1 2012/06/10 04:03:13 vapier Exp $
-
-inherit unpacker toolchain-funcs multilib
-
-DESCRIPTION="utility to manage compilers"
-HOMEPAGE="http://git.overlays.gentoo.org/gitweb/?p=proj/gcc-config.git"
-SRC_URI="mirror://gentoo/${P}.tar.xz
-	http://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="*"
-IUSE=""
-
-src_compile() {
-	emake CC="$(tc-getCC)" || die
-}
-
-src_install() {
-	emake \
-		DESTDIR="${D}" \
-		PV="${PV}" \
-		SUBLIBDIR="$(get_libdir)" \
-		install || die
-}
-
-pkg_postinst() {
-	# Scrub eselect-compiler remains
-	rm -f "${ROOT}"/etc/env.d/05compiler &
-
-	# Make sure old versions dont exist #79062
-	rm -f "${ROOT}"/usr/sbin/gcc-config &
-
-	# We not longer use the /usr/include/g++-v3 hacks, as
-	# it is not needed ...
-	rm -f "${ROOT}"/usr/include/g++{,-v3} &
-
-	# Do we have a valid multi ver setup ?
-	local x
-	for x in $(gcc-config -C -l 2>/dev/null | awk '$NF == "*" { print $2 }') ; do
-		gcc-config ${x}
-	done
-
-	wait
-}
diff --git a/sys-devel/gcc-config/gcc-config-2.3.ebuild b/sys-devel/gcc-config/gcc-config-2.3.ebuild
new file mode 100644
index 0000000..ae9b2bf
--- /dev/null
+++ b/sys-devel/gcc-config/gcc-config-2.3.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+if [[ ${PV} == 9999 ]]; then
+	EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/gcc-config.git"
+	inherit git-r3
+else
+	SRC_URI="https://dev.gentoo.org/~slyfox/distfiles/${P}.tar.xz"
+	KEYWORDS="*"
+fi
+
+DESCRIPTION="Utility to manage compilers"
+HOMEPAGE="https://gitweb.gentoo.org/proj/gcc-config.git/"
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="+native-symlinks"
+
+RDEPEND=">=sys-apps/gentoo-functions-0.10"
+
+src_compile() {
+	emake CC="$(tc-getCC)" \
+		PV="${PV}" \
+		SUBLIBDIR="$(get_libdir)" \
+		USE_NATIVE_LINKS="$(usex native-symlinks)"
+}
+
+src_install() {
+	emake \
+		DESTDIR="${D}" \
+		PV="${PV}" \
+		SUBLIBDIR="$(get_libdir)" \
+		install
+}
+
+pkg_postinst() {
+	# Scrub eselect-compiler remains.
+	# To be removed in 2021.
+	rm -f "${ROOT}"/etc/env.d/05compiler
+
+	# We not longer use the /usr/include/g++-v3 hacks, as
+	# it is not needed ...
+	# To be removed in 2021.
+	rm -f "${ROOT}"/usr/include/g++{,-v3}
+
+	# Do we have a valid multi ver setup ?
+	local x
+	for x in $(gcc-config -C -l 2>/dev/null | awk '$NF == "*" { print $2 }') ; do
+		gcc-config ${x}
+	done
+
+	# USE flag change can add or delete files in /usr/bin worth recaching
+	if [[ ! ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
+		eselect compiler-shadow update all
+	fi
+}
diff --git a/sys-devel/gcc-config/metadata.xml b/sys-devel/gcc-config/metadata.xml
index fb4199e..33e9604 100644
--- a/sys-devel/gcc-config/metadata.xml
+++ b/sys-devel/gcc-config/metadata.xml
@@ -1,5 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
-<herd>toolchain</herd>
+	<maintainer type="project">
+		<email>toolchain@gentoo.org</email>
+		<name>Gentoo Toolchain Project</name>
+	</maintainer>
+	<use>
+		<flag name="native-symlinks">Install native symlinks like 'gcc' or 'g++' to /usr/bin. Otherwise keep only ${CTARGET}-gcc and friends.</flag>
+	</use>
 </pkgmetadata>