| 1 |
1 |
# Copyright 1999-2025 Gentoo Authors
|
| 2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
3 |
|
| 4 |
|
EAPI=8
|
|
4 |
EAPI="8"
|
| 5 |
5 |
|
| 6 |
6 |
# Maintenance notes and explanations of GCC handling are on the wiki:
|
| 7 |
7 |
# https://wiki.gentoo.org/wiki/Project:Toolchain/sys-devel/gcc
|
| 8 |
8 |
|
|
9 |
TOOLCHAIN_PATCH_SUFFIX="xz"
|
| 9 |
10 |
TOOLCHAIN_PATCH_DEV="sam"
|
| 10 |
11 |
TOOLCHAIN_HAS_TESTS=1
|
| 11 |
|
PATCH_GCC_VER="9.5.0"
|
| 12 |
|
PATCH_VER="2"
|
|
12 |
PATCH_VER="4"
|
| 13 |
13 |
PYTHON_COMPAT=( python3_{11..14} )
|
| 14 |
14 |
|
| 15 |
|
if [[ ${PV} == *.9999 ]] ; then
|
| 16 |
|
MY_PV_2=$(ver_cut 2)
|
| 17 |
|
MY_PV_3=1
|
| 18 |
|
if [[ ${MY_PV_2} == 0 ]] ; then
|
| 19 |
|
MY_PV_2=0
|
| 20 |
|
MY_PV_3=0
|
| 21 |
|
else
|
| 22 |
|
MY_PV_2=$((${MY_PV_2} - 1))
|
| 23 |
|
fi
|
| 24 |
|
|
| 25 |
|
# e.g. 12.2.9999 -> 12.1.1
|
| 26 |
|
TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
|
| 27 |
|
elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
|
| 28 |
|
# Cheesy hack for RCs
|
| 29 |
|
MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
|
| 30 |
|
MY_P=${PN}-${MY_PV}
|
| 31 |
|
GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
|
| 32 |
|
TOOLCHAIN_SET_S=no
|
| 33 |
|
S="${WORKDIR}"/${MY_P}
|
| 34 |
|
fi
|
| 35 |
|
|
| 36 |
15 |
inherit toolchain
|
| 37 |
16 |
|
| 38 |
|
if tc_is_live ; then
|
| 39 |
|
# Needs to be after inherit (for now?), bug #830908
|
| 40 |
|
EGIT_BRANCH=releases/gcc-$(ver_cut 1)
|
| 41 |
|
elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
|
| 42 |
|
KEYWORDS="~alpha amd64 arm arm64 hppa ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
|
| 43 |
|
fi
|
|
17 |
KEYWORDS="~alpha amd64 arm arm64 hppa ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
|
| 44 |
18 |
|
| 45 |
19 |
RDEPEND=""
|
| 46 |
|
BDEPEND="${CATEGORY}/binutils"
|
|
20 |
DEPEND="${RDEPEND}
|
|
21 |
elibc_glibc? ( >=sys-libs/glibc-2.13 )
|
|
22 |
>=${CATEGORY}/binutils-2.20"
|
| 47 |
23 |
|
| 48 |
|
src_prepare() {
|
| 49 |
|
local p upstreamed_patches=(
|
| 50 |
|
# add them here
|
| 51 |
|
)
|
| 52 |
|
for p in "${upstreamed_patches[@]}"; do
|
| 53 |
|
rm -v "${WORKDIR}/patch/${p}" || die
|
| 54 |
|
done
|
| 55 |
|
|
| 56 |
|
toolchain_src_prepare
|
| 57 |
|
}
|
|
24 |
if [[ ${CATEGORY} != cross-* ]] ; then
|
|
25 |
PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.13 )"
|
|
26 |
fi
|