sys-devel/gcc-config: bump up to 2.3, bug #724454
[gentoo.git] / sys-devel / gcc-config / gcc-config-2.3.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit toolchain-funcs
7
8 if [[ ${PV} == 9999 ]]; then
9         EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/gcc-config.git"
10         inherit git-r3
11 else
12         SRC_URI="https://dev.gentoo.org/~slyfox/distfiles/${P}.tar.xz"
13         KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
14 fi
15
16 DESCRIPTION="Utility to manage compilers"
17 HOMEPAGE="https://gitweb.gentoo.org/proj/gcc-config.git/"
18 LICENSE="GPL-2"
19 SLOT="0"
20 IUSE="+native-symlinks"
21
22 RDEPEND=">=sys-apps/gentoo-functions-0.10"
23
24 src_compile() {
25         emake CC="$(tc-getCC)" \
26                 PV="${PV}" \
27                 SUBLIBDIR="$(get_libdir)" \
28                 USE_NATIVE_LINKS="$(usex native-symlinks)"
29 }
30
31 src_install() {
32         emake \
33                 DESTDIR="${D}" \
34                 PV="${PV}" \
35                 SUBLIBDIR="$(get_libdir)" \
36                 install
37 }
38
39 pkg_postinst() {
40         # Scrub eselect-compiler remains.
41         # To be removed in 2021.
42         rm -f "${ROOT}"/etc/env.d/05compiler
43
44         # We not longer use the /usr/include/g++-v3 hacks, as
45         # it is not needed ...
46         # To be removed in 2021.
47         rm -f "${ROOT}"/usr/include/g++{,-v3}
48
49         # Do we have a valid multi ver setup ?
50         local x
51         for x in $(gcc-config -C -l 2>/dev/null | awk '$NF == "*" { print $2 }') ; do
52                 gcc-config ${x}
53         done
54
55         # USE flag change can add or delete files in /usr/bin worth recaching
56         if [[ ! ${ROOT%/} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
57                 eselect compiler-shadow update all
58         fi
59 }