From: Andreas Sturmlechner <asturm@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: [gentoo-dev] [PATCH] toolchain.eclass: Drop eutils in >=EAPI-8, add some missing || die
Date: Wed, 07 Apr 2021 00:16:46 +0200 [thread overview]
Message-ID: <3261942.LZWGnKmheA@tuxbrain> (raw)
[-- Attachment #1: Type: text/plain, Size: 3507 bytes --]
Just some cheap fixes while flag-o-matic.eclass causes cache-regen anyway.
See also: https://github.com/gentoo/gentoo/pull/20207
- Add inherit guard.
- Fix eclassdoc a bit.
---
eclass/toolchain.eclass | 51 +++++++++++++++++++++++++++--------------
1 file changed, 34 insertions(+), 17 deletions(-)
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index f41ce22c591..e7fae3aad5a 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1,14 +1,37 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-# Maintainer: Toolchain Ninjas <toolchain@gentoo.org>
+# @ECLASS: toolchain.eclass
+# @MAINTAINER:
+# Toolchain Ninjas <toolchain@gentoo.org>
# @SUPPORTED_EAPIS: 5 6 7
+# @BLURB: Functions to build sys-devel/gcc
+# @DESCRIPTION:
+# Comprehensive helper and phase functions to build sys-devel/gcc and
+# adjacent packages, support for release and live ebuilds.
+#
+# This eclass unconditionally inherits toolchain-funcs.eclass and all its public
+# variables and helper functions may be considered as part of this eclass's API.
+#
+# This eclass's phase functions are not intended to be mixed and matched, so if
+# any phase functions are overridden, the toolchain.eclass version should also
+# be called.
+
+case ${EAPI:-0} in
+ 0|1|2|3|4*) die "Need to upgrade to at least EAPI=5" ;;
+ 5*|6) inherit eapi7-ver eutils ;;
+ 7) inherit eutils ;;
+ *) die "I don't speak EAPI ${EAPI}." ;;
+esac
+
+if [[ -z ${_TOOLCHAIN_ECLASS} ]]; then
+_TOOLCHAIN_ECLASS=1
+
+inherit flag-o-matic gnuconfig libtool multilib pax-utils toolchain-funcs prefix
DESCRIPTION="The GNU Compiler Collection"
HOMEPAGE="https://gcc.gnu.org/"
-inherit eutils flag-o-matic gnuconfig libtool multilib pax-utils toolchain-funcs prefix
-
tc_is_live() {
[[ ${PV} == *9999* ]]
}
@@ -27,13 +50,6 @@ fi
FEATURES=${FEATURES/multilib-strict/}
-case ${EAPI:-0} in
- 0|1|2|3|4*) die "Need to upgrade to at least EAPI=5" ;;
- 5*|6) inherit eapi7-ver ;;
- 7) ;;
- *) die "I don't speak EAPI ${EAPI}." ;;
-esac
-
EXPORT_FUNCTIONS pkg_pretend pkg_setup src_unpack src_prepare src_configure \
src_compile src_test src_install pkg_postinst pkg_postrm
@@ -525,7 +541,7 @@ toolchain_src_prepare() {
|| eerror "Please file a bug about this"
eend $?
done
- sed -i 's|A-Za-z0-9|[:alnum:]|g' "${S}"/gcc/*.awk #215828
+ sed -i 's|A-Za-z0-9|[:alnum:]|g' "${S}"/gcc/*.awk || die #215828
# Prevent new texinfo from breaking old versions (see #198182, #464008)
if tc_version_is_at_least 4.1; then
@@ -639,17 +655,16 @@ make_gcc_hard() {
# than ALL_CFLAGS...
sed -e '/^ALL_CFLAGS/iHARD_CFLAGS = ' \
-e 's|^ALL_CFLAGS = |ALL_CFLAGS = $(HARD_CFLAGS) |' \
- -i "${S}"/gcc/Makefile.in
+ -i "${S}"/gcc/Makefile.in || die
# Need to add HARD_CFLAGS to ALL_CXXFLAGS on >= 4.7
if tc_version_is_at_least 4.7 ; then
sed -e '/^ALL_CXXFLAGS/iHARD_CFLAGS = ' \
-e 's|^ALL_CXXFLAGS = |ALL_CXXFLAGS = $(HARD_CFLAGS) |' \
- -i "${S}"/gcc/Makefile.in
+ -i "${S}"/gcc/Makefile.in || die
fi
- sed -i \
- -e "/^HARD_CFLAGS = /s|=|= ${gcc_hard_flags} |" \
- "${S}"/gcc/Makefile.in || die
+ sed -e "/^HARD_CFLAGS = /s|=|= ${gcc_hard_flags} |" \
+ -i "${S}"/gcc/Makefile.in || die
}
@@ -2434,3 +2449,5 @@ toolchain_death_notice() {
# Thus safer way to enable/disable the feature is to rely on implicit
# enabled-by-default state:
# econf $(usex foo '' --disable-foo)
+
+fi
--
2.31.1
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 618 bytes --]
next reply other threads:[~2021-04-06 22:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-06 22:16 Andreas Sturmlechner [this message]
2021-04-07 6:55 ` [gentoo-dev] [PATCH] toolchain.eclass: Drop eutils in >=EAPI-8, add some missing || die Sergei Trofimovich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3261942.LZWGnKmheA@tuxbrain \
--to=asturm@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox