From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BA097139335 for ; Tue, 29 Jun 2021 06:23:04 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C7D66E0895; Tue, 29 Jun 2021 06:23:03 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9C662E0895 for ; Tue, 29 Jun 2021 06:23:03 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E883433BE33 for ; Tue, 29 Jun 2021 06:23:01 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8555D744 for ; Tue, 29 Jun 2021 06:23:00 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1624947772.ae01728421dd36f2c5d669cc1d0edfbdef5cc479.grobian@gentoo> Subject: [gentoo-commits] repo/proj/prefix:master commit in: eclass/ X-VCS-Repository: repo/proj/prefix X-VCS-Files: eclass/java-utils-2.eclass eclass/python-utils-r1.eclass eclass/toolchain-funcs.eclass eclass/toolchain.eclass X-VCS-Directories: eclass/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: ae01728421dd36f2c5d669cc1d0edfbdef5cc479 X-VCS-Branch: master Date: Tue, 29 Jun 2021 06:23:00 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 55a2f851-6897-40a8-afb9-73a99f061562 X-Archives-Hash: d88d1999feb6ba4049ba66ab14c67c74 commit: ae01728421dd36f2c5d669cc1d0edfbdef5cc479 Author: Fabian Groffen gentoo org> AuthorDate: Tue Jun 29 06:22:14 2021 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Tue Jun 29 06:22:52 2021 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=ae017284 eclass/*: sync with gx86 Signed-off-by: Fabian Groffen gentoo.org> eclass/java-utils-2.eclass | 37 +++++---------- eclass/python-utils-r1.eclass | 102 ++++++++++++++++++++++++------------------ eclass/toolchain-funcs.eclass | 29 ++++-------- eclass/toolchain.eclass | 5 ++- 4 files changed, 81 insertions(+), 92 deletions(-) diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass index cef79405bf..1b7fcc295a 100644 --- a/eclass/java-utils-2.eclass +++ b/eclass/java-utils-2.eclass @@ -6,6 +6,7 @@ # java@gentoo.org # @AUTHOR: # Thomas Matthijs , Karl Trygve Kalleberg +# @SUPPORTED_EAPIS: 5 6 7 # @BLURB: Base eclass for Java packages # @DESCRIPTION: # This eclass provides functionality which is used by java-pkg-2.eclass, @@ -16,18 +17,23 @@ # that have optional Java support. In addition you can inherit java-ant-2 for # Ant-based packages. +case ${EAPI:-0} in + [567]) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + +if [[ -z ${_JAVA_UTILS_2_ECLASS} ]] ; then +_JAVA_UTILS_2_ECLASS=1 + # EAPI 7 has version functions built-in. Use eapi7-ver for all earlier eclasses. # Keep versionator inheritance in case consumers are using it implicitly. -[[ ${EAPI} == [0123456] ]] && inherit eapi7-ver eutils multilib versionator +[[ ${EAPI} == [56] ]] && inherit eapi7-ver eutils multilib versionator IUSE="elibc_FreeBSD" # Make sure we use java-config-2 export WANT_JAVA_CONFIG="2" -# Prefix variables are only available for EAPI>=3 -has "${EAPI:-0}" 0 1 2 && ED="${D}" EPREFIX= EROOT="${ROOT}" - has test ${JAVA_PKG_IUSE} && RESTRICT+=" !test? ( test )" # @VARIABLE: JAVA_PKG_E_DEPEND @@ -975,10 +981,6 @@ java-pkg_jar-from() { [[ -z ${target_pkg} ]] && die "Must specify a package" - if [[ "${EAPI}" == "1" ]]; then - target_pkg="${target_pkg//:/-}" - fi - # default destjar to the target jar [[ -z "${destjar}" ]] && destjar="${target_jar}" @@ -1114,10 +1116,6 @@ java-pkg_getjars() { local pkgs="${1}" - if [[ "${EAPI}" == "1" ]]; then - pkgs="${pkgs//:/-}" - fi - jars="$(java-config ${deep} --classpath=${pkgs})" [[ $? != 0 ]] && die "java-config --classpath=${pkgs} failed" debug-print "${pkgs}:${jars}" @@ -1183,10 +1181,6 @@ java-pkg_getjar() { local pkg="${1}" target_jar="${2}" jar - if [[ "${EAPI}" == "1" ]]; then - pkg="${pkg//:/-}" - fi - [[ -z ${pkg} ]] && die "Must specify package to get a jar from" [[ -z ${target_jar} ]] && die "Must specify jar to get" @@ -1272,10 +1266,6 @@ java-pkg_register-dependency() { [[ -z "${pkgs}" ]] && die "${FUNCNAME} called with no package(s) specified" - if [[ "${EAPI}" == "1" ]]; then - pkgs="${pkgs//:/-}" - fi - if [[ -z "${jar}" ]]; then for pkg in ${pkgs//,/ }; do java-pkg_ensure-dep runtime "${pkg}" @@ -1329,10 +1319,6 @@ java-pkg_register-optional-dependency() { [[ -z "${pkgs}" ]] && die "${FUNCNAME} called with no package(s) specified" - if [[ "${EAPI}" == "1" ]]; then - pkgs="${pkgs//:/-}" - fi - if [[ -z "${jar}" ]]; then for pkg in ${pkgs//,/ }; do java-pkg_record-jar_ --optional "${pkg}" @@ -2195,9 +2181,6 @@ java-pkg_init() { # Don't set up build environment if installing from binary. #206024 #258423 [[ "${MERGE_TYPE}" == "binary" ]] && return - # Also try Portage's nonstandard EMERGE_FROM for old EAPIs, if it doesn't - # work nothing is lost. - has ${EAPI:-0} 0 1 2 3 && [[ "${EMERGE_FROM}" == "binary" ]] && return unset JAVAC unset JAVA_HOME diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index 5023750fd6..0c173e2308 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -7,7 +7,7 @@ # @AUTHOR: # Author: Michał Górny # Based on work of: Krzysztof Pawlik -# @SUPPORTED_EAPIS: 6 7 +# @SUPPORTED_EAPIS: 6 7 8 # @BLURB: Utility functions for packages with Python parts. # @DESCRIPTION: # A utility eclass providing functions to query Python implementations, @@ -24,7 +24,7 @@ # See bug #704286, bug #781878 case "${EAPI:-0}" in [0-5]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;; - [6-7]) ;; + [6-8]) ;; *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;; esac @@ -34,6 +34,7 @@ fi if [[ ! ${_PYTHON_UTILS_R1} ]]; then +[[ ${EAPI} == [67] ]] && inherit eapi8-dosym inherit toolchain-funcs # @ECLASS-VARIABLE: _PYTHON_ALL_IMPLS @@ -42,7 +43,7 @@ inherit toolchain-funcs # All supported Python implementations, most preferred last. _PYTHON_ALL_IMPLS=( pypy3 - python3_{7..10} + python3_{8..10} ) readonly _PYTHON_ALL_IMPLS @@ -54,7 +55,7 @@ _PYTHON_HISTORICAL_IMPLS=( jython2_7 pypy pypy1_{8,9} pypy2_0 python2_{5..7} - python3_{1..6} + python3_{1..7} ) readonly _PYTHON_HISTORICAL_IMPLS @@ -188,11 +189,8 @@ _python_set_impls() { # of the patterns following it. Return 0 if it does, 1 otherwise. # Matches if no patterns are provided. # -# can be in PYTHON_COMPAT or EPYTHON form. The patterns can be -# either: -# a) fnmatch-style patterns, e.g. 'python2*', 'pypy'... -# b) '-2' to indicate all Python 2 variants (= !python_is_python3) -# c) '-3' to indicate all Python 3 variants (= python_is_python3) +# can be in PYTHON_COMPAT or EPYTHON form. The patterns +# are fnmatch-style. _python_impl_matches() { [[ ${#} -ge 1 ]] || die "${FUNCNAME}: takes at least 1 parameter" [[ ${#} -eq 1 ]] && return 0 @@ -201,15 +199,30 @@ _python_impl_matches() { shift for pattern; do - if [[ ${pattern} == -2 ]]; then - python_is_python3 "${impl}" || return 0 - elif [[ ${pattern} == -3 ]]; then - python_is_python3 "${impl}" && return 0 - return - # unify value style to allow lax matching - elif [[ ${impl/./_} == ${pattern/./_} ]]; then - return 0 - fi + case ${pattern} in + -2|python2*|pypy) + if [[ ${EAPI} != [67] ]]; then + eerror + eerror "Python 2 is no longer supported in Gentoo, please remove Python 2" + eerror "${FUNCNAME[1]} calls." + die "Passing ${pattern} to ${FUNCNAME[1]} is banned in EAPI ${EAPI}" + fi + ;; + -3) + # NB: "python3*" is fine, as "not pypy3" + if [[ ${EAPI} != [67] ]]; then + eerror + eerror "Python 2 is no longer supported in Gentoo, please remove Python 2" + eerror "${FUNCNAME[1]} calls." + die "Passing ${pattern} to ${FUNCNAME[1]} is banned in EAPI ${EAPI}" + fi + return 0 + ;; + *) + # unify value style to allow lax matching + [[ ${impl/./_} == ${pattern/./_} ]] && return 0 + ;; + esac done return 1 @@ -265,6 +278,8 @@ python_export() { eqawarn "python_export() is part of private eclass API." eqawarn "Please call python_get*() instead." + [[ ${EAPI} == [67] ]] || die "${FUNCNAME} banned in EAPI ${EAPI}" + _python_export "${@}" } @@ -690,7 +705,7 @@ python_optimize() { python_scriptinto() { debug-print-function ${FUNCNAME} "${@}" - python_scriptroot=${1} + _PYTHON_SCRIPTROOT=${1} } # @FUNCTION: python_doexe @@ -725,7 +740,7 @@ python_newexe() { [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).' [[ ${#} -eq 2 ]] || die "Usage: ${FUNCNAME} " - local wrapd=${python_scriptroot:-/usr/bin} + local wrapd=${_PYTHON_SCRIPTROOT:-/usr/bin} local f=${1} local newfn=${2} @@ -742,8 +757,9 @@ python_newexe() { ) # install the wrapper - _python_ln_rel "${ED%/}"/usr/lib/python-exec/python-exec2 \ - "${ED%/}/${wrapd}/${newfn}" || die + local dosym=dosym + [[ ${EAPI} == [67] ]] && dosym=dosym8 + "${dosym}" -r /usr/lib/python-exec/python-exec2 "${wrapd}/${newfn}" # don't use this at home, just call python_doscript() instead if [[ ${_PYTHON_REWRITE_SHEBANG} ]]; then @@ -829,7 +845,7 @@ python_newscript() { python_moduleinto() { debug-print-function ${FUNCNAME} "${@}" - python_moduleroot=${1} + _PYTHON_MODULEROOT=${1} } # @FUNCTION: python_domodule @@ -853,15 +869,13 @@ python_domodule() { [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).' local d - if [[ ${python_moduleroot} == /* ]]; then + if [[ ${_PYTHON_MODULEROOT} == /* ]]; then # absolute path - d=${python_moduleroot} + d=${_PYTHON_MODULEROOT} else # relative to site-packages - local PYTHON_SITEDIR=${PYTHON_SITEDIR} - [[ ${PYTHON_SITEDIR} ]] || _python_export PYTHON_SITEDIR PYTHON_EPREFIX - - d=${PYTHON_SITEDIR#${PYTHON_EPREFIX:-${EPREFIX}}}/${python_moduleroot} + local sitedir=$(python_get_sitedir) + d=${sitedir#${EPREFIX}}/${_PYTHON_MODULEROOT//.//} fi ( @@ -891,10 +905,8 @@ python_doheader() { [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).' - local d PYTHON_INCLUDEDIR=${PYTHON_INCLUDEDIR} - [[ ${PYTHON_INCLUDEDIR} ]] || _python_export PYTHON_INCLUDEDIR PYTHON_EPREFIX - - d=${PYTHON_INCLUDEDIR#${PYTHON_EPREFIX:-${EPREFIX}}} + local includedir=$(python_get_includedir) + local d=${includedir#${EPREFIX}} ( insopts -m 0644 @@ -914,6 +926,8 @@ python_wrapper_setup() { eqawarn "python_wrapper_setup() is part of private eclass API." eqawarn "Please call python_setup() instead." + [[ ${EAPI} == [67] ]] || die "${FUNCNAME} banned in EAPI ${EAPI}" + _python_wrapper_setup "${@}" } @@ -953,7 +967,7 @@ _python_wrapper_setup() { _python_export "${impl}" EPYTHON PYTHON local pyver pyother - if python_is_python3; then + if [[ ${EPYTHON} != python2* ]]; then pyver=3 pyother=2 else @@ -1032,6 +1046,9 @@ _python_wrapper_setup() { # # Returns 0 (true) if it is, 1 (false) otherwise. python_is_python3() { + eqawarn "${FUNCNAME} is deprecated, as Python 2 is not supported anymore" + [[ ${EAPI} == [67] ]] || die "${FUNCNAME} banned in EAPI ${EAPI}" + local impl=${1:-${EPYTHON}} [[ ${impl} ]] || die "python_is_python3: no impl nor EPYTHON" @@ -1130,32 +1147,31 @@ python_fix_shebang() { if [[ ${i} == *python2 ]]; then from=python2 if [[ ! ${force} ]]; then - python_is_python3 "${EPYTHON}" && error=1 + error=1 fi elif [[ ${i} == *python3 ]]; then from=python3 - if [[ ! ${force} ]]; then - python_is_python3 "${EPYTHON}" || error=1 - fi else from=python fi break ;; - *python[23].[0123456789]|*pypy|*pypy3|*jython[23].[0123456789]) + *python[23].[0-9]|*python3.[1-9][0-9]|*pypy|*pypy3|*jython[23].[0-9]) # Explicit mismatch. if [[ ! ${force} ]]; then error=1 else case "${i}" in - *python[23].[0123456789]) - from="python[23].[0123456789]";; + *python[23].[0-9]) + from="python[23].[0-9]";; + *python3.[1-9][0-9]) + from="python3.[1-9][0-9]";; *pypy) from="pypy";; *pypy3) from="pypy3";; - *jython[23].[0123456789]) - from="jython[23].[0123456789]";; + *jython[23].[0-9]) + from="jython[23].[0-9]";; *) die "${FUNCNAME}: internal error in 2nd pattern match";; esac diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index 70709b96d6..170ea19057 100644 --- a/eclass/toolchain-funcs.eclass +++ b/eclass/toolchain-funcs.eclass @@ -4,6 +4,7 @@ # @ECLASS: toolchain-funcs.eclass # @MAINTAINER: # Toolchain Ninjas +# @SUPPORTED_EAPIS: 5 6 7 8 # @BLURB: functions to query common info about the toolchain # @DESCRIPTION: # The toolchain-funcs aims to provide a complete suite of functions @@ -12,6 +13,12 @@ # 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) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + if [[ -z ${_TOOLCHAIN_FUNCS_ECLASS} ]]; then _TOOLCHAIN_FUNCS_ECLASS=1 @@ -1040,7 +1047,7 @@ gen_usr_ldscript() { # Eventually we'd like to get rid of this func completely #417451 case ${CTARGET:-${CHOST}} in - *-darwin*) type -P scanmacho > /dev/null || return ;; # excluded for now due to known breakage + *-darwin*) ;; *-android*) return 0 ;; *linux*|*-freebsd*|*-openbsd*|*-netbsd*) use prefix && return 0 ;; @@ -1115,26 +1122,6 @@ gen_usr_ldscript() { -id "${EPREFIX}"/${libdir}/${tlib} \ "${ED}"/${libdir}/${tlib} || die "install_name_tool failed" [[ -n ${nowrite} ]] && chmod u-w "${ED}${libdir}/${tlib}" - # In the build image, stuff may have already recorded the now moved - # install_name, so hunt those down and fix the install_name - # references. - local l obj needed lib - scanmacho -qyRF '%p;%n' "${D}" | { while IFS= read l ; do - obj=${l%%;*} - needed=${l#*;} - # this is ugly, paths with spaces won't work - for lib in ${needed//,/ } ; do - if [[ ${lib} == */usr/lib*/${tlib} ]] ; then - # don't masquerade other problems, only remove usr/ - # from input - local s=${lib%usr/*}${lib##*/usr/} - [[ ${lib} != ${s} ]] || continue - einfo "gen_usr_ldscript: correcting install_name from ${lib} to ${s} in ${obj}" - install_name_tool -change \ - "${lib}" "${s}" "${D}${obj}" - fi - done - done } # Now as we don't use GNU binutils and our linker doesn't # understand linker scripts, just create a symlink. pushd "${ED}/usr/${libdir}" > /dev/null diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index e85900934f..ff032dac0b 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # Maintainer: Toolchain Ninjas @@ -7,6 +7,8 @@ DESCRIPTION="The GNU Compiler Collection" HOMEPAGE="https://gcc.gnu.org/" +# TODO: Please audit this inherit list on future EAPI bumps and ideally +# conditonalise them where possible. inherit eutils flag-o-matic gnuconfig libtool multilib pax-utils toolchain-funcs prefix tc_is_live() { @@ -1349,6 +1351,7 @@ downgrade_arch_flags() { # "added" "arch" "replacement" local archlist=( + 10 znver3 znver2 9 znver2 znver1 4.9 bdver4 bdver3 4.9 bonnell atom