1 |
Just some cheap fixes while flag-o-matic.eclass causes cache-regen anyway. |
2 |
See also: https://github.com/gentoo/gentoo/pull/20207 |
3 |
|
4 |
- Add inherit guard. |
5 |
- Fix eclassdoc a bit. |
6 |
|
7 |
--- |
8 |
eclass/toolchain.eclass | 51 +++++++++++++++++++++++++++-------------- |
9 |
1 file changed, 34 insertions(+), 17 deletions(-) |
10 |
|
11 |
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass |
12 |
index f41ce22c591..e7fae3aad5a 100644 |
13 |
--- a/eclass/toolchain.eclass |
14 |
+++ b/eclass/toolchain.eclass |
15 |
@@ -1,14 +1,37 @@ |
16 |
-# Copyright 1999-2020 Gentoo Authors |
17 |
+# Copyright 1999-2021 Gentoo Authors |
18 |
# Distributed under the terms of the GNU General Public License v2 |
19 |
|
20 |
-# Maintainer: Toolchain Ninjas <toolchain@g.o> |
21 |
+# @ECLASS: toolchain.eclass |
22 |
+# @MAINTAINER: |
23 |
+# Toolchain Ninjas <toolchain@g.o> |
24 |
# @SUPPORTED_EAPIS: 5 6 7 |
25 |
+# @BLURB: Functions to build sys-devel/gcc |
26 |
+# @DESCRIPTION: |
27 |
+# Comprehensive helper and phase functions to build sys-devel/gcc and |
28 |
+# adjacent packages, support for release and live ebuilds. |
29 |
+# |
30 |
+# This eclass unconditionally inherits toolchain-funcs.eclass and all its public |
31 |
+# variables and helper functions may be considered as part of this eclass's API. |
32 |
+# |
33 |
+# This eclass's phase functions are not intended to be mixed and matched, so if |
34 |
+# any phase functions are overridden, the toolchain.eclass version should also |
35 |
+# be called. |
36 |
+ |
37 |
+case ${EAPI:-0} in |
38 |
+ 0|1|2|3|4*) die "Need to upgrade to at least EAPI=5" ;; |
39 |
+ 5*|6) inherit eapi7-ver eutils ;; |
40 |
+ 7) inherit eutils ;; |
41 |
+ *) die "I don't speak EAPI ${EAPI}." ;; |
42 |
+esac |
43 |
+ |
44 |
+if [[ -z ${_TOOLCHAIN_ECLASS} ]]; then |
45 |
+_TOOLCHAIN_ECLASS=1 |
46 |
+ |
47 |
+inherit flag-o-matic gnuconfig libtool multilib pax-utils toolchain-funcs prefix |
48 |
|
49 |
DESCRIPTION="The GNU Compiler Collection" |
50 |
HOMEPAGE="https://gcc.gnu.org/" |
51 |
|
52 |
-inherit eutils flag-o-matic gnuconfig libtool multilib pax-utils toolchain-funcs prefix |
53 |
- |
54 |
tc_is_live() { |
55 |
[[ ${PV} == *9999* ]] |
56 |
} |
57 |
@@ -27,13 +50,6 @@ fi |
58 |
|
59 |
FEATURES=${FEATURES/multilib-strict/} |
60 |
|
61 |
-case ${EAPI:-0} in |
62 |
- 0|1|2|3|4*) die "Need to upgrade to at least EAPI=5" ;; |
63 |
- 5*|6) inherit eapi7-ver ;; |
64 |
- 7) ;; |
65 |
- *) die "I don't speak EAPI ${EAPI}." ;; |
66 |
-esac |
67 |
- |
68 |
EXPORT_FUNCTIONS pkg_pretend pkg_setup src_unpack src_prepare src_configure \ |
69 |
src_compile src_test src_install pkg_postinst pkg_postrm |
70 |
|
71 |
@@ -525,7 +541,7 @@ toolchain_src_prepare() { |
72 |
|| eerror "Please file a bug about this" |
73 |
eend $? |
74 |
done |
75 |
- sed -i 's|A-Za-z0-9|[:alnum:]|g' "${S}"/gcc/*.awk #215828 |
76 |
+ sed -i 's|A-Za-z0-9|[:alnum:]|g' "${S}"/gcc/*.awk || die #215828 |
77 |
|
78 |
# Prevent new texinfo from breaking old versions (see #198182, #464008) |
79 |
if tc_version_is_at_least 4.1; then |
80 |
@@ -639,17 +655,16 @@ make_gcc_hard() { |
81 |
# than ALL_CFLAGS... |
82 |
sed -e '/^ALL_CFLAGS/iHARD_CFLAGS = ' \ |
83 |
-e 's|^ALL_CFLAGS = |ALL_CFLAGS = $(HARD_CFLAGS) |' \ |
84 |
- -i "${S}"/gcc/Makefile.in |
85 |
+ -i "${S}"/gcc/Makefile.in || die |
86 |
# Need to add HARD_CFLAGS to ALL_CXXFLAGS on >= 4.7 |
87 |
if tc_version_is_at_least 4.7 ; then |
88 |
sed -e '/^ALL_CXXFLAGS/iHARD_CFLAGS = ' \ |
89 |
-e 's|^ALL_CXXFLAGS = |ALL_CXXFLAGS = $(HARD_CFLAGS) |' \ |
90 |
- -i "${S}"/gcc/Makefile.in |
91 |
+ -i "${S}"/gcc/Makefile.in || die |
92 |
fi |
93 |
|
94 |
- sed -i \ |
95 |
- -e "/^HARD_CFLAGS = /s|=|= ${gcc_hard_flags} |" \ |
96 |
- "${S}"/gcc/Makefile.in || die |
97 |
+ sed -e "/^HARD_CFLAGS = /s|=|= ${gcc_hard_flags} |" \ |
98 |
+ -i "${S}"/gcc/Makefile.in || die |
99 |
|
100 |
} |
101 |
|
102 |
@@ -2434,3 +2449,5 @@ toolchain_death_notice() { |
103 |
# Thus safer way to enable/disable the feature is to rely on implicit |
104 |
# enabled-by-default state: |
105 |
# econf $(usex foo '' --disable-foo) |
106 |
+ |
107 |
+fi |
108 |
-- |
109 |
2.31.1 |