diff options
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/autotools.eclass | 14 | ||||
-rw-r--r-- | eclass/epatch.eclass | 88 | ||||
-rw-r--r-- | eclass/eutils.eclass | 152 | ||||
-rw-r--r-- | eclass/flag-o-matic.eclass | 17 | ||||
-rw-r--r-- | eclass/multilib.eclass | 33 | ||||
-rw-r--r-- | eclass/toolchain-funcs.eclass | 7 |
6 files changed, 36 insertions, 275 deletions
diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass index 025a93d207a4..ab9040d99c73 100644 --- a/eclass/autotools.eclass +++ b/eclass/autotools.eclass @@ -4,7 +4,7 @@ # @ECLASS: autotools.eclass # @MAINTAINER: # base-system@gentoo.org -# @SUPPORTED_EAPIS: 5 6 7 8 +# @SUPPORTED_EAPIS: 6 7 8 # @BLURB: Regenerates auto* build scripts # @DESCRIPTION: # This eclass is for safely handling autotooled software packages that need to @@ -27,7 +27,7 @@ if [[ -z ${_AUTOTOOLS_ECLASS} ]] ; then _AUTOTOOLS_ECLASS=1 case ${EAPI} in - 5|6) + 6) # Needed for eqawarn inherit eutils ;; @@ -130,7 +130,7 @@ RDEPEND="" : ${AUTOTOOLS_AUTO_DEPEND:=yes} if [[ ${AUTOTOOLS_AUTO_DEPEND} != "no" ]] ; then case ${EAPI} in - 5|6) DEPEND=${AUTOTOOLS_DEPEND} ;; + 6) DEPEND=${AUTOTOOLS_DEPEND} ;; *) BDEPEND=${AUTOTOOLS_DEPEND} ;; esac fi @@ -336,7 +336,7 @@ eaclocal() { # - ${BROOT}/usr/share/aclocal # - ${ESYSROOT}/usr/share/aclocal # See bug #677002 - if [[ ${EAPI} != [56] ]] ; then + if [[ ${EAPI} != 6 ]] ; then if [[ ! -f "${T}"/aclocal/dirlist ]] ; then mkdir "${T}"/aclocal || die cat <<- EOF > "${T}"/aclocal/dirlist || die @@ -394,7 +394,7 @@ eautoconf() { if [[ ${WANT_AUTOCONF} != "2.1" && -e configure.in ]] ; then case ${EAPI} in - 5|6|7) + 6|7) eqawarn "This package has a configure.in file which has long been deprecated. Please" eqawarn "update it to use configure.ac instead as newer versions of autotools will die" eqawarn "when it finds this file. See https://bugs.gentoo.org/426262 for details." @@ -485,7 +485,7 @@ config_rpath_update() { local dst src case ${EAPI} in - 5|6) + 6) src="${EPREFIX}/usr/share/gettext/config.rpath" ;; *) @@ -516,7 +516,7 @@ autotools_env_setup() { # Break on first hit to respect _LATEST_AUTOMAKE order. local hv_args="" case ${EAPI} in - 5|6) + 6) hv_args="--host-root" ;; *) diff --git a/eclass/epatch.eclass b/eclass/epatch.eclass index 181cd8963e4f..07f802583fc7 100644 --- a/eclass/epatch.eclass +++ b/eclass/epatch.eclass @@ -4,7 +4,7 @@ # @ECLASS: epatch.eclass # @MAINTAINER: # base-system@gentoo.org -# @SUPPORTED_EAPIS: 5 6 +# @SUPPORTED_EAPIS: 6 # @BLURB: easy patch application functions # @DEPRECATED: eapply from EAPI 7 # @DESCRIPTION: @@ -14,10 +14,8 @@ if [[ -z ${_EPATCH_ECLASS} ]]; then case ${EAPI} in - 5|6) - ;; - *) - die "${ECLASS}: EAPI ${EAPI:-0} not supported";; + 6) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac inherit estack @@ -378,85 +376,5 @@ epatch() { : # everything worked } -case ${EAPI:-0} in -0|1|2|3|4|5) - -# @ECLASS_VARIABLE: EPATCH_USER_SOURCE -# @USER_VARIABLE -# @DESCRIPTION: -# Location for user patches, see the epatch_user function. -# Should be set by the user. Don't set this in ebuilds. -: ${EPATCH_USER_SOURCE:=${PORTAGE_CONFIGROOT%/}/etc/portage/patches} - -# @FUNCTION: epatch_user -# @USAGE: -# @DESCRIPTION: -# Applies user-provided patches to the source tree. The patches are -# taken from /etc/portage/patches/<CATEGORY>/<P-PR|P|PN>[:SLOT]/, where the first -# of these three directories to exist will be the one to use, ignoring -# any more general directories which might exist as well. They must end -# in ".patch" to be applied. -# -# User patches are intended for quick testing of patches without ebuild -# modifications, as well as for permanent customizations a user might -# desire. Obviously, there can be no official support for arbitrarily -# patched ebuilds. So whenever a build log in a bug report mentions that -# user patches were applied, the user should be asked to reproduce the -# problem without these. -# -# Not all ebuilds do call this function, so placing patches in the -# stated directory might or might not work, depending on the package and -# the eclasses it inherits and uses. It is safe to call the function -# repeatedly, so it is always possible to add a call at the ebuild -# level. The first call is the time when the patches will be -# applied. -# -# Ideally, this function should be called after gentoo-specific patches -# have been applied, so that their code can be modified as well, but -# before calls to e.g. eautoreconf, as the user patches might affect -# autotool input files as well. -epatch_user() { - [[ $# -ne 0 ]] && die "epatch_user takes no options" - - # Allow multiple calls to this function; ignore all but the first - local applied="${T}/epatch_user.log" - [[ -e ${applied} ]] && return 2 - - # don't clobber any EPATCH vars that the parent might want - local EPATCH_SOURCE check - for check in ${CATEGORY}/{${P}-${PR},${P},${PN}}{,:${SLOT%/*}}; do - EPATCH_SOURCE=${EPATCH_USER_SOURCE}/${CTARGET}/${check} - [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${EPATCH_USER_SOURCE}/${CHOST}/${check} - [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${EPATCH_USER_SOURCE}/${check} - if [[ -d ${EPATCH_SOURCE} ]] ; then - local old_n_applied_patches=${EPATCH_N_APPLIED_PATCHES:-0} - EPATCH_SOURCE=${EPATCH_SOURCE} \ - EPATCH_SUFFIX="patch" \ - EPATCH_FORCE="yes" \ - EPATCH_MULTI_MSG="Applying user patches from ${EPATCH_SOURCE} ..." \ - epatch - echo "${EPATCH_SOURCE}" > "${applied}" - if [[ ${old_n_applied_patches} -lt ${EPATCH_N_APPLIED_PATCHES} ]]; then - has epatch_user_death_notice ${EBUILD_DEATH_HOOKS} || \ - EBUILD_DEATH_HOOKS+=" epatch_user_death_notice" - fi - return 0 - fi - done - echo "none" > "${applied}" - return 1 -} - -# @FUNCTION: epatch_user_death_notice -# @INTERNAL -# @DESCRIPTION: -# Include an explicit notice in the die message itself that user patches were -# applied to this build. -epatch_user_death_notice() { - ewarn "!!! User patches were applied to this build!" -} - -esac - _EPATCH_ECLASS=1 fi #_EPATCH_ECLASS diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 207d05e7f975..e7fae2c656c6 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1,10 +1,10 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: eutils.eclass # @MAINTAINER: # base-system@gentoo.org -# @SUPPORTED_EAPIS: 5 6 7 +# @SUPPORTED_EAPIS: 6 7 # @BLURB: many extra (but common) functions that are used in ebuilds # @DESCRIPTION: # The eutils eclass contains a suite of functions that complement @@ -24,49 +24,16 @@ _EUTILS_ECLASS=1 # implicitly inherited (now split) eclasses case ${EAPI} in - 5|6) - inherit desktop edos2unix epatch estack ltprune multilib \ - preserve-libs strip-linguas toolchain-funcs vcs-clean wrapper - ;; + 6) inherit desktop edos2unix epatch estack ltprune multilib \ + preserve-libs strip-linguas toolchain-funcs vcs-clean wrapper ;; 7) inherit edos2unix strip-linguas wrapper ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac -# @FUNCTION: emktemp -# @USAGE: [temp dir] -# @DESCRIPTION: -# Cheap replacement for when coreutils (and thus mktemp) does not exist -# on the user's system. emktemp() { - eqawarn "emktemp is deprecated. Create a temporary file in \${T} instead." - - local exe="touch" - [[ $1 == -d ]] && exe="mkdir" && shift - local topdir=$1 - - if [[ -z ${topdir} ]] ; then - [[ -z ${T} ]] \ - && topdir="/tmp" \ - || topdir=${T} - fi - - if ! type -P mktemp > /dev/null ; then - # system lacks `mktemp` so we have to fake it - local tmp=/ - while [[ -e ${tmp} ]] ; do - tmp=${topdir}/tmp.${RANDOM}.${RANDOM}.${RANDOM} - done - ${exe} "${tmp}" || ${exe} -p "${tmp}" - echo "${tmp}" - else - # the args here will give slightly wierd names on BSD, - # but should produce a usable file on all userlands - if [[ ${exe} == "touch" ]] ; then - TMPDIR="${topdir}" mktemp -t tmp.XXXXXXXXXX - else - TMPDIR="${topdir}" mktemp -dt tmp.XXXXXXXXXX - fi - fi + eerror "emktemp has been removed." + eerror "Create a temporary file in \${T} instead." + die "emktemp is banned" } path_exists() { @@ -76,119 +43,24 @@ path_exists() { die "path_exists is banned" } -# @FUNCTION: use_if_iuse -# @USAGE: <flag> -# @DESCRIPTION: -# Return true if the given flag is in USE and IUSE. -# -# Note that this function should not be used in the global scope. use_if_iuse() { - eqawarn "use_if_iuse is deprecated." - eqawarn "Define it as a local function, or inline it:" - eqawarn " in_iuse foo && use foo" - in_iuse $1 || return 1 - use $1 -} - -if [[ ${EAPI} == 5 ]] ; then - -# @FUNCTION: einstalldocs -# @DESCRIPTION: -# Install documentation using DOCS and HTML_DOCS, in EAPIs that do not -# provide this function. When available (i.e., in EAPI 6 or later), -# the package manager implementation should be used instead. -# -# If DOCS is declared and non-empty, all files listed in it are -# installed. The files must exist, otherwise the function will fail. -# In EAPI 4 and 5, DOCS may specify directories as well; in earlier -# EAPIs using directories is unsupported. -# -# If DOCS is not declared, the files matching patterns given -# in the default EAPI implementation of src_install will be installed. -# If this is undesired, DOCS can be set to empty value to prevent any -# documentation from being installed. -# -# If HTML_DOCS is declared and non-empty, all files and/or directories -# listed in it are installed as HTML docs (using dohtml). -# -# Both DOCS and HTML_DOCS can either be an array or a whitespace- -# separated list. Whenever directories are allowed, '<directory>/.' may -# be specified in order to install all files within the directory -# without creating a sub-directory in docdir. -# -# Passing additional options to dodoc and dohtml is not supported. -# If you needed such a thing, you need to call those helpers explicitly. -einstalldocs() { - debug-print-function ${FUNCNAME} "${@}" - - local dodoc_opts=-r - - if ! declare -p DOCS &>/dev/null ; then - local d - for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \ - THANKS BUGS FAQ CREDITS CHANGELOG ; do - if [[ -s ${d} ]] ; then - dodoc "${d}" || die - fi - done - elif [[ $(declare -p DOCS) == "declare -a"* ]] ; then - if [[ ${DOCS[@]} ]] ; then - dodoc ${dodoc_opts} "${DOCS[@]}" || die - fi - else - if [[ ${DOCS} ]] ; then - dodoc ${dodoc_opts} ${DOCS} || die - fi - fi - - if [[ $(declare -p HTML_DOCS 2>/dev/null) == "declare -a"* ]] ; then - if [[ ${HTML_DOCS[@]} ]] ; then - dohtml -r "${HTML_DOCS[@]}" || die - fi - else - if [[ ${HTML_DOCS} ]] ; then - dohtml -r ${HTML_DOCS} || die - fi - fi - - return 0 -} - -# @FUNCTION: in_iuse -# @USAGE: <flag> -# @DESCRIPTION: -# Determines whether the given flag is in IUSE. Strips IUSE default -# prefixes as necessary. In EAPIs where it is available (i.e., EAPI 6 -# or later), the package manager implementation should be used instead. -# -# Note that this function must not be used in the global scope. -in_iuse() { - debug-print-function ${FUNCNAME} "${@}" - [[ ${#} -eq 1 ]] || die "Invalid args to ${FUNCNAME}()" - - local flag=${1} - local liuse=( ${IUSE} ) - - has "${flag}" "${liuse[@]#[+-]}" + eerror "use_if_iuse has been removed." + eerror "Define it as a local function, or inline it:" + eerror " in_iuse foo && use foo" + die "use_if_iuse is banned" } -fi # EAPI 5 - -if [[ ${EAPI} == [56] ]] ; then - # @FUNCTION: eqawarn # @USAGE: [message] # @DESCRIPTION: # Proxy to ewarn for package managers that don't provide eqawarn and use the PM # implementation if available. Reuses PORTAGE_ELOG_CLASSES as set by the dev # profile. -if ! declare -F eqawarn >/dev/null ; then +if [[ ${EAPI} == 6 ]] && ! declare -F eqawarn >/dev/null ; then eqawarn() { has qa ${PORTAGE_ELOG_CLASSES} && ewarn "$@" : } fi -fi # EAPI [56] - fi diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass index 0e15d7423547..0dd2c1191273 100644 --- a/eclass/flag-o-matic.eclass +++ b/eclass/flag-o-matic.eclass @@ -4,16 +4,15 @@ # @ECLASS: flag-o-matic.eclass # @MAINTAINER: # toolchain@gentoo.org -# @SUPPORTED_EAPIS: 5 6 7 8 +# @SUPPORTED_EAPIS: 6 7 8 # @BLURB: common functions to manipulate and query toolchain flags # @DESCRIPTION: # This eclass contains a suite of functions to help developers sanely # and safely manage toolchain flags in their builds. -case ${EAPI:-0} in - 0|1|2|3|4) die "flag-o-matic.eclass: EAPI ${EAPI} is too old." ;; - 5|6|7|8) ;; - *) die "EAPI ${EAPI} is not supported by flag-o-matic.eclass." ;; +case ${EAPI} in + 6|7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac if [[ -z ${_FLAG_O_MATIC_ECLASS} ]]; then @@ -21,7 +20,7 @@ _FLAG_O_MATIC_ECLASS=1 inherit toolchain-funcs -[[ ${EAPI} == [567] ]] && inherit eutils +[[ ${EAPI} == [67] ]] && inherit eutils # @FUNCTION: all-flag-vars # @DESCRIPTION: @@ -36,7 +35,7 @@ all-flag-vars() { # {C,CPP,CXX,CCAS,F,FC,LD}FLAGS that we allow in strip-flags # Note: shell globs and character lists are allowed setup-allowed-flags() { - [[ ${EAPI} == [567] ]] || + [[ ${EAPI} == [67] ]] || die "Internal function ${FUNCNAME} is not available in EAPI ${EAPI}." _setup-allowed-flags "$@" } @@ -512,7 +511,7 @@ strip-flags() { # Returns shell true if <flag> is supported by given <compiler>, # else returns shell false. test-flag-PROG() { - [[ ${EAPI} == [567] ]] || + [[ ${EAPI} == [67] ]] || die "Internal function ${FUNCNAME} is not available in EAPI ${EAPI}." _test-flag-PROG "$@" } @@ -651,7 +650,7 @@ test-flag-CCLD() { _test-flag-PROG CC c+ld "$@"; } # Returns shell true if <flags> are supported by given <compiler>, # else returns shell false. test-flags-PROG() { - [[ ${EAPI} == [567] ]] || + [[ ${EAPI} == [67] ]] || die "Internal function ${FUNCNAME} is not available in EAPI ${EAPI}." _test-flags-PROG "$@" } diff --git a/eclass/multilib.eclass b/eclass/multilib.eclass index 8590bbdfbff0..e3c0d78a6e43 100644 --- a/eclass/multilib.eclass +++ b/eclass/multilib.eclass @@ -4,14 +4,13 @@ # @ECLASS: multilib.eclass # @MAINTAINER: # toolchain@gentoo.org -# @SUPPORTED_EAPIS: 5 6 7 8 +# @SUPPORTED_EAPIS: 6 7 8 # @BLURB: This eclass is for all functions pertaining to handling multilib configurations. # @DESCRIPTION: # This eclass is for all functions pertaining to handling multilib configurations. -case ${EAPI:-0} in - # EAPI=0 is still used by crossdev, bug #797367 - 0|5|6|7|8) ;; +case ${EAPI} in + 6|7|8) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac @@ -40,32 +39,6 @@ has_multilib_profile() { [ -n "${MULTILIB_ABIS}" -a "${MULTILIB_ABIS}" != "${MULTILIB_ABIS/ /}" ] } -# @FUNCTION: get_libdir -# @RETURN: the libdir for the selected ABI -# @DESCRIPTION: -# This function simply returns the desired lib directory. With portage -# 2.0.51, we now have support for installing libraries to lib32/lib64 -# to accomidate the needs of multilib systems. It's no longer a good idea -# to assume all libraries will end up in lib. Replace any (sane) instances -# where lib is named directly with $(get_libdir) if possible. -# -# Jeremy Huddleston <eradicator@gentoo.org> (23 Dec 2004): -# Added support for ${ABI} and ${DEFAULT_ABI}. If they're both not set, -# fall back on old behavior. Any profile that has these set should also -# depend on a newer version of portage (not yet released) which uses these -# over CONF_LIBDIR in econf, dolib, etc... -if [[ ${EAPI} == [05] ]] ; then - get_libdir() { - local CONF_LIBDIR - if [ -n "${CONF_LIBDIR_OVERRIDE}" ] ; then - # if there is an override, we want to use that... always. - echo ${CONF_LIBDIR_OVERRIDE} - else - get_abi_LIBDIR - fi - } -fi - # @FUNCTION: get_abi_var # @USAGE: <VAR> [ABI] # @RETURN: returns the value of ${<VAR>_<ABI>} which should be set in make.defaults diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index d725f2f47e59..48bf11606c4a 100644 --- a/eclass/toolchain-funcs.eclass +++ b/eclass/toolchain-funcs.eclass @@ -4,7 +4,7 @@ # @ECLASS: toolchain-funcs.eclass # @MAINTAINER: # Toolchain Ninjas <toolchain@gentoo.org> -# @SUPPORTED_EAPIS: 5 6 7 8 +# @SUPPORTED_EAPIS: 6 7 8 # @BLURB: functions to query common info about the toolchain # @DESCRIPTION: # The toolchain-funcs aims to provide a complete suite of functions @@ -13,9 +13,8 @@ # in such a way that you can rely on the function always returning # something sane. -case ${EAPI:-0} in - # EAPI=0 is still used by crossdev, bug #797367 - 0|5|6|7|8) ;; +case ${EAPI} in + 6|7|8) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac |