From fcc5224904648a8e6eb528d7603154160a20022f Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 2 Feb 2022 01:39:05 +0000 Subject: gentoo resync : 02.02.2022 --- eclass/Manifest.gz | Bin 36216 -> 36171 bytes eclass/autotools.eclass | 34 +++++-- eclass/bazel.eclass | 8 +- eclass/common-lisp-3.eclass | 8 +- eclass/dist-kernel-utils.eclass | 4 +- eclass/distutils-r1.eclass | 221 ++++++++++++++++++++++++++++++---------- eclass/flag-o-matic.eclass | 52 +++++++--- eclass/go-module.eclass | 2 +- eclass/java-utils-2.eclass | 3 +- eclass/java-virtuals-2.eclass | 6 +- eclass/java-vm-2.eclass | 6 +- eclass/llvm.org.eclass | 10 +- eclass/out-of-source.eclass | 12 +-- eclass/python-any-r1.eclass | 4 +- eclass/python-r1.eclass | 2 +- eclass/python-single-r1.eclass | 2 +- eclass/python-utils-r1.eclass | 13 ++- eclass/sgml-catalog-r1.eclass | 18 +--- eclass/texlive-common.eclass | 6 +- eclass/toolchain.eclass | 133 ++++++++++-------------- eclass/user-info.eclass | 8 +- eclass/user.eclass | 14 +-- eclass/usr-ldscript.eclass | 12 +-- eclass/vcs-clean.eclass | 20 ++-- eclass/vcs-snapshot.eclass | 19 ++-- 25 files changed, 377 insertions(+), 240 deletions(-) (limited to 'eclass') diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz index 27cc36b531a2..59246ceb6c5b 100644 Binary files a/eclass/Manifest.gz and b/eclass/Manifest.gz differ diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass index 95c92cc6df8c..85be205c1032 100644 --- a/eclass/autotools.eclass +++ b/eclass/autotools.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: autotools.eclass @@ -74,7 +74,7 @@ inherit gnuconfig libtool # Do NOT change this variable in your ebuilds! # If you want to force a newer minor version, you can specify the correct # WANT value by using a colon: : -_LATEST_AUTOMAKE=( 1.16.2-r1:1.16 ) +_LATEST_AUTOMAKE=( 1.16.4:1.16 ) _automake_atom="sys-devel/automake" _autoconf_atom="sys-devel/autoconf" @@ -95,7 +95,7 @@ if [[ -n ${WANT_AUTOCONF} ]] ; then none) _autoconf_atom="" ;; # some packages don't require autoconf at all 2.1) _autoconf_atom="~sys-devel/autoconf-2.13" ;; # if you change the "latest" version here, change also autotools_env_setup - latest|2.5) _autoconf_atom=">=sys-devel/autoconf-2.69" ;; + latest|2.5) _autoconf_atom=">=sys-devel/autoconf-2.71" ;; *) die "Invalid WANT_AUTOCONF value '${WANT_AUTOCONF}'" ;; esac export WANT_AUTOCONF @@ -332,8 +332,26 @@ eaclocal_amflags() { # They also force installing the support files for safety. # Respects AT_M4DIR for additional directories to search for macros. eaclocal() { + # Feed in a list of paths: + # - ${BROOT}/usr/share/aclocal + # - ${ESYSROOT}/usr/share/aclocal + # See bug #677002 + if [[ ${EAPI} != [56] ]] ; then + if [[ ! -f "${T}"/aclocal/dirlist ]] ; then + mkdir "${T}"/aclocal || die + cat <<- EOF > "${T}"/aclocal/dirlist || die + ${BROOT}/usr/share/aclocal + ${ESYSROOT}/usr/share/aclocal + EOF + fi + + local system_acdir=" --system-acdir=${T}/aclocal" + else + local system_acdir="" + fi + [[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \ - autotools_run_tool --at-m4flags aclocal "$@" $(eaclocal_amflags) + autotools_run_tool --at-m4flags aclocal "$@" $(eaclocal_amflags) ${system_acdir} } # @FUNCTION: _elibtoolize @@ -510,7 +528,7 @@ autotools_env_setup() { [[ ${WANT_AUTOMAKE} == "latest" ]] && \ die "Cannot find the latest automake! Tried ${_LATEST_AUTOMAKE[*]}" fi - [[ ${WANT_AUTOCONF} == "latest" ]] && export WANT_AUTOCONF=2.5 + [[ ${WANT_AUTOCONF} == "latest" ]] && export WANT_AUTOCONF=2.71 } # @FUNCTION: autotools_run_tool @@ -666,12 +684,6 @@ autotools_m4sysdir_include() { # First try to use the paths the system integrator has set up. local paths=( $(eval echo ${AT_SYS_M4DIR}) ) - if [[ ${#paths[@]} -eq 0 && -n ${SYSROOT} ]] ; then - # If they didn't give us anything, then default to the SYSROOT. - # This helps when cross-compiling. - local path="${SYSROOT}/usr/share/aclocal" - [[ -d ${path} ]] && paths+=( "${path}" ) - fi _autotools_m4dir_include "${paths[@]}" } diff --git a/eclass/bazel.eclass b/eclass/bazel.eclass index 9e09255fd66f..8ae405c6941c 100644 --- a/eclass/bazel.eclass +++ b/eclass/bazel.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: bazel.eclass @@ -17,7 +17,7 @@ case "${EAPI:-0}" in 0|1|2|3|4|5|6) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;; - 7) + 7|8) ;; *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" @@ -28,7 +28,9 @@ if [[ ! ${_BAZEL_ECLASS} ]]; then inherit multiprocessing toolchain-funcs -BDEPEND=">=dev-util/bazel-0.20" +if [[ ${CATEGORY}/${PN} != "dev-util/bazel" ]]; then + BDEPEND=">=dev-util/bazel-0.20" +fi # @FUNCTION: bazel_get_flags # @DESCRIPTION: diff --git a/eclass/common-lisp-3.eclass b/eclass/common-lisp-3.eclass index 91752dcacc9b..78f18f5231fa 100644 --- a/eclass/common-lisp-3.eclass +++ b/eclass/common-lisp-3.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: common-lisp-3.eclass @@ -167,13 +167,11 @@ common-lisp-install-asdf() { # @FUNCTION: common-lisp-3_src_install # @DESCRIPTION: -# Recursively install Lisp sources, asdf files and most common doc files. +# Recursively install Lisp sources, asdf files and doc files. common-lisp-3_src_install() { common-lisp-install-sources . common-lisp-install-asdf - for i in AUTHORS README* HEADER TODO* CHANGELOG Change[lL]og CHANGES BUGS CONTRIBUTORS *NEWS* ; do - [[ -f ${i} ]] && dodoc ${i} - done + einstalldocs } # @FUNCTION: common-lisp-find-lisp-impl diff --git a/eclass/dist-kernel-utils.eclass b/eclass/dist-kernel-utils.eclass index f514a3da65a9..71c96a37e642 100644 --- a/eclass/dist-kernel-utils.eclass +++ b/eclass/dist-kernel-utils.eclass @@ -1,4 +1,4 @@ -# Copyright 2020-2021 Gentoo Authors +# Copyright 2020-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: dist-kernel-utils.eclass @@ -72,7 +72,7 @@ dist-kernel_get_image_path() { arm) echo arch/arm/boot/zImage ;; - ppc|ppc64) + hppa|ppc|ppc64) # https://www.kernel.org/doc/html/latest/powerpc/bootwrapper.html # ./ is required because of ${image_path%/*} # substitutions in the code diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index 200360510f80..2b5acb09d926 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -42,7 +42,7 @@ # relevant to the packages using distutils-r1. # # For more information, please see the Python Guide: -# https://dev.gentoo.org/~mgorny/python-guide/ +# https://projects.gentoo.org/python/guide/ case "${EAPI:-0}" in [0-5]) @@ -128,6 +128,24 @@ esac # It is available only in non-PEP517 mode. It needs to be set before # the inherit line. +# @ECLASS-VARIABLE: DISTUTILS_DEPS +# @OUTPUT_VARIABLE +# @DESCRIPTION: +# This is an eclass-generated build-time dependency string for the build +# system packages. This string is automatically appended to BDEPEND +# unless DISTUTILS_OPTIONAL is used. This variable is available only +# in PEP 517 mode. +# +# Example use: +# @CODE +# DISTUTILS_OPTIONAL=1 +# # ... +# RDEPEND="${PYTHON_DEPS}" +# BDEPEND=" +# ${PYTHON_DEPS} +# ${DISTUTILS_DEPS}" +# @CODE + if [[ ! ${_DISTUTILS_R1} ]]; then [[ ${EAPI} == 6 ]] && inherit eutils xdg-utils @@ -156,8 +174,8 @@ _distutils_set_globals() { # installer is used to install the wheel # tomli is used to read build-backend from pyproject.toml - bdep+=' - >=dev-python/installer-0.4.0_p20220115[${PYTHON_USEDEP}] + bdep=' + >=dev-python/installer-0.4.0_p20220124[${PYTHON_USEDEP}] dev-python/tomli[${PYTHON_USEDEP}]' case ${DISTUTILS_USE_PEP517} in flit) @@ -183,6 +201,11 @@ _distutils_set_globals() { die "Unknown DISTUTILS_USE_PEP517=${DISTUTILS_USE_PEP517}" ;; esac + elif [[ ${DISTUTILS_OPTIONAL} ]]; then + if [[ ${DISTUTILS_USE_SETUPTOOLS} ]]; then + eqawarn "QA Notice: DISTUTILS_USE_SETUPTOOLS is not used when DISTUTILS_OPTIONAL" + eqawarn "is enabled." + fi else local setuptools_dep='>=dev-python/setuptools-42.0.2[${PYTHON_USEDEP}]' @@ -213,15 +236,31 @@ _distutils_set_globals() { [[ -n ${rdep} ]] && rdep="$(python_gen_cond_dep "${rdep}")" fi - RDEPEND="${PYTHON_DEPS} ${rdep}" - if [[ ${EAPI} != 6 ]]; then - BDEPEND="${PYTHON_DEPS} ${bdep}" - else - DEPEND="${PYTHON_DEPS} ${bdep}" + if [[ ${DISTUTILS_USE_PEP517} ]]; then + if [[ ${DISTUTILS_DEPS+1} ]]; then + if [[ ${DISTUTILS_DEPS} != "${bdep}" ]]; then + eerror "DISTUTILS_DEPS have changed between inherits!" + eerror "Before: ${DISTUTILS_DEPS}" + eerror "Now : ${bdep}" + die "DISTUTILS_DEPS integrity check failed" + fi + else + DISTUTILS_DEPS=${bdep} + readonly DISTUTILS_DEPS + fi + fi + + if [[ ! ${DISTUTILS_OPTIONAL} ]]; then + RDEPEND="${PYTHON_DEPS} ${rdep}" + if [[ ${EAPI} != 6 ]]; then + BDEPEND="${PYTHON_DEPS} ${bdep}" + else + DEPEND="${PYTHON_DEPS} ${bdep}" + fi + REQUIRED_USE=${PYTHON_REQUIRED_USE} fi - REQUIRED_USE=${PYTHON_REQUIRED_USE} } -[[ ! ${DISTUTILS_OPTIONAL} ]] && _distutils_set_globals +_distutils_set_globals unset -f _distutils_set_globals # @ECLASS-VARIABLE: PATCHES @@ -544,6 +583,9 @@ esetup.py() { if [[ ${DISTUTILS_USE_SETUPTOOLS} == pyproject.toml ]]; then setup_py=( -m pyproject2setuppy ) elif [[ ! -f setup.py ]]; then + if [[ ! -f setup.cfg ]]; then + die "${FUNCNAME}: setup.py nor setup.cfg not found" + fi setup_py=( -c "from setuptools import setup; setup()" ) fi @@ -862,13 +904,13 @@ _distutils-r1_backend_to_key() { local backend=${1} case ${backend} in - flit_core.buildapi) + flit_core.buildapi|flit.buildapi) echo flit ;; pdm.pep517.api) echo pdm ;; - poetry.core.masonry.api) + poetry.core.masonry.api|poetry.masonry.api) echo poetry ;; setuptools.build_meta|setuptools.build_meta:__legacy__) @@ -950,9 +992,30 @@ distutils-r1_python_compile() { eerror "(backend: ${build_backend})" die "DISTUTILS_USE_PEP517 value incorrect" fi + + # fix deprecated backends up + local new_backend= + case ${build_backend} in + flit.buildapi) + new_backend=flit_core.buildapi + ;; + poetry.masonry.api) + new_backend=poetry.core.masonry.api + ;; + esac + + if [[ -n ${new_backend} ]]; then + if [[ ! ${_DISTUTILS_DEPRECATED_BACKEND_WARNED} ]]; then + eqawarn "${build_backend} backend is deprecated. Please see:" + eqawarn "https://projects.gentoo.org/python/guide/distutils.html#deprecated-pep-517-backends" + eqawarn "The eclass will be using ${new_backend} instead." + _DISTUTILS_DEPRECATED_BACKEND_WARNED=1 + fi + build_backend=${new_backend} + fi fi - einfo "Building a wheel via ${build_backend}" + einfo " Building the wheel via ${build_backend}" "${EPYTHON}" -c "import ${build_backend%:*}; \ import os; \ ${build_backend/:/.}.build_wheel(os.environ['WHEEL_BUILD_DIR'])" || @@ -964,6 +1027,7 @@ distutils-r1_python_compile() { fi local root=${BUILD_DIR}/install + einfo " Installing the wheel to ${root}" # NB: --compile-bytecode does not produce the correct paths, # and python_optimize doesn't handle being called outside D, # so we just defer compiling until the final merge @@ -971,14 +1035,41 @@ distutils-r1_python_compile() { --no-compile-bytecode || die "installer failed" + # remove installed licenses + find "${root}$(python_get_sitedir)" \ + '(' -path '*.dist-info/COPYING*' -o \ + -path '*.dist-info/LICENSE*' ')' -delete || die + + # clean the build tree; otherwise we may end up with PyPy3 + # extensions duplicated into CPython dists + if [[ ${DISTUTILS_USE_PEP517:-setuptools} == setuptools ]]; then + esetup.py clean -a + fi + + # copy executables to python-exec directory + # we do it early so that we can alter bindir recklessly + local bindir=${root}${EPREFIX}/usr/bin + local rscriptdir=${root}$(python_get_scriptdir) + [[ -d ${rscriptdir} ]] && + die "${rscriptdir} should not exist!" + if [[ -d ${bindir} ]]; then + mkdir -p "${rscriptdir}" || die + cp -a --reflink=auto "${bindir}"/. "${rscriptdir}"/ || die + fi + # enable venv magic inside the install tree - mkdir -p "${root}"/usr/bin || die - ln -s "${PYTHON}" "${root}/usr/bin/${EPYTHON}" || die - ln -s "${EPYTHON}" "${root}/usr/bin/python3" || die - ln -s "${EPYTHON}" "${root}/usr/bin/python" || die - cat > "${root}"/usr/pyvenv.cfg <<-EOF || die + mkdir -p "${bindir}" || die + ln -s "${PYTHON}" "${bindir}/${EPYTHON}" || die + ln -s "${EPYTHON}" "${bindir}/python3" || die + ln -s "${EPYTHON}" "${bindir}/python" || die + cat > "${bindir}"/pyvenv.cfg <<-EOF || die include-system-site-packages = true EOF + + # we need to change shebangs to point to the venv-python + find "${bindir}" -type f -exec sed -i \ + -e "1s@^#!\(${EPREFIX}/usr/bin/\(python\|pypy\)\)@#!${root}\1@" \ + {} + || die fi } @@ -1056,7 +1147,7 @@ distutils-r1_python_test() { case ${_DISTUTILS_TEST_RUNNER} in nose) - nosetests -v "${@}" + "${EPYTHON}" -m nose -v "${@}" ;; pytest) epytest @@ -1094,15 +1185,11 @@ distutils-r1_python_install() { local scriptdir=${EPREFIX}/usr/bin if [[ ${DISTUTILS_USE_PEP517} ]]; then local root=${BUILD_DIR}/install - local rscriptdir=${root}$(python_get_scriptdir) - [[ -d ${rscriptdir} ]] && - die "${rscriptdir} should not exist!" - # remove venv magic - rm "${root}"/usr/{pyvenv.cfg,bin/{python,python3,${EPYTHON}}} || die - find "${root}"/usr/bin -empty -delete || die - if [[ ! ${DISTUTILS_SINGLE_IMPL} && -d ${root}/usr/bin ]]; then - mkdir -p "${rscriptdir%/*}" || die - mv "${root}/usr/bin" "${rscriptdir}" || die + # remove the altered bindir, executables from the package + # are already in scriptdir + rm -r "${root}${scriptdir}" || die + if [[ ${DISTUTILS_SINGLE_IMPL} ]]; then + mv "${root}$(python_get_scriptdir)" "${root}${scriptdir}" || die fi else local root=${D%/}/_${EPYTHON} @@ -1172,8 +1259,8 @@ distutils-r1_python_install() { local shopt_save=$(shopt -p nullglob) shopt -s nullglob local pypy_dirs=( - "${root}/usr/$(get_libdir)"/pypy*/share - "${root}/usr/lib"/pypy*/share + "${root}${EPREFIX}/usr/$(get_libdir)"/pypy*/share + "${root}${EPREFIX}/usr/lib"/pypy*/share ) ${shopt_save} @@ -1232,7 +1319,7 @@ distutils-r1_run_phase() { fi if [[ ${DISTUTILS_USE_PEP517} ]]; then - local -x PATH=${BUILD_DIR}/install/usr/bin:${PATH} + local -x PATH=${BUILD_DIR}/install${EPREFIX}/usr/bin:${PATH} else local -x PYTHONPATH="${BUILD_DIR}/lib:${PYTHONPATH}" @@ -1244,15 +1331,15 @@ distutils-r1_run_phase() { # Undo the default switch in setuptools-60+ for the time being, # to avoid replacing .egg-info file with directory in-place. local -x SETUPTOOLS_USE_DISTUTILS="${SETUPTOOLS_USE_DISTUTILS:-stdlib}" - fi - # Bug 559644 - # using PYTHONPATH when the ${BUILD_DIR}/lib is not created yet might lead to - # problems in setup.py scripts that try to import modules/packages from that path - # during the build process (Python at startup evaluates PYTHONPATH, if the dir is - # not valid then associates a NullImporter object to ${BUILD_DIR}/lib storing it - # in the sys.path_importer_cache) - mkdir -p "${BUILD_DIR}/lib" || die + # Bug 559644 + # using PYTHONPATH when the ${BUILD_DIR}/lib is not created yet might lead to + # problems in setup.py scripts that try to import modules/packages from that path + # during the build process (Python at startup evaluates PYTHONPATH, if the dir is + # not valid then associates a NullImporter object to ${BUILD_DIR}/lib storing it + # in the sys.path_importer_cache) + mkdir -p "${BUILD_DIR}/lib" || die + fi # Set up build environment, bug #513664. local -x AR=${AR} CC=${CC} CPP=${CPP} CXX=${CXX} @@ -1271,8 +1358,10 @@ distutils-r1_run_phase() { local -x LDSHARED="${CC} ${ldopts}" LDCXXSHARED="${CXX} ${ldopts}" "${@}" + local ret=${?} cd "${_DISTUTILS_INITIAL_CWD}" || die + return "${ret}" } # @FUNCTION: _distutils-r1_run_common_phase @@ -1330,14 +1419,14 @@ _distutils-r1_run_foreach_impl() { distutils-r1_src_prepare() { debug-print-function ${FUNCNAME} "${@}" - + local ret=0 local _DISTUTILS_DEFAULT_CALLED # common preparations if declare -f python_prepare_all >/dev/null; then - python_prepare_all + python_prepare_all || ret=${?} else - distutils-r1_python_prepare_all + distutils-r1_python_prepare_all || ret=${?} fi if [[ ! ${_DISTUTILS_DEFAULT_CALLED} ]]; then @@ -1345,35 +1434,45 @@ distutils-r1_src_prepare() { fi if declare -f python_prepare >/dev/null; then - _distutils-r1_run_foreach_impl python_prepare + _distutils-r1_run_foreach_impl python_prepare || ret=${?} fi + + return ${ret} } distutils-r1_src_configure() { + debug-print-function ${FUNCNAME} "${@}" + local ret=0 + python_export_utf8_locale [[ ${EAPI} == 6 ]] && xdg_environment_reset # Bug 577704 if declare -f python_configure >/dev/null; then - _distutils-r1_run_foreach_impl python_configure + _distutils-r1_run_foreach_impl python_configure || ret=${?} fi if declare -f python_configure_all >/dev/null; then - _distutils-r1_run_common_phase python_configure_all + _distutils-r1_run_common_phase python_configure_all || ret=${?} fi + + return ${ret} } distutils-r1_src_compile() { debug-print-function ${FUNCNAME} "${@}" + local ret=0 if declare -f python_compile >/dev/null; then - _distutils-r1_run_foreach_impl python_compile + _distutils-r1_run_foreach_impl python_compile || ret=${?} else - _distutils-r1_run_foreach_impl distutils-r1_python_compile + _distutils-r1_run_foreach_impl distutils-r1_python_compile || ret=${?} fi if declare -f python_compile_all >/dev/null; then - _distutils-r1_run_common_phase python_compile_all + _distutils-r1_run_common_phase python_compile_all || ret=${?} fi + + return ${ret} } # @FUNCTION: _distutils-r1_clean_egg_info @@ -1383,20 +1482,29 @@ distutils-r1_src_compile() { # Those files ended up being unversioned, and caused issues: # https://bugs.gentoo.org/534058 _distutils-r1_clean_egg_info() { + if [[ ${DISTUTILS_USE_PEP517} ]]; then + die "${FUNCNAME} is not implemented in PEP517 mode" + fi + rm -rf "${BUILD_DIR}"/lib/*.egg-info || die } distutils-r1_src_test() { debug-print-function ${FUNCNAME} "${@}" + local ret=0 if declare -f python_test >/dev/null; then - _distutils-r1_run_foreach_impl python_test - _distutils-r1_run_foreach_impl _distutils-r1_clean_egg_info + _distutils-r1_run_foreach_impl python_test || ret=${?} + if [[ ! ${DISTUTILS_USE_PEP517} ]]; then + _distutils-r1_run_foreach_impl _distutils-r1_clean_egg_info + fi fi if declare -f python_test_all >/dev/null; then - _distutils-r1_run_common_phase python_test_all + _distutils-r1_run_common_phase python_test_all || ret=${?} fi + + return ${ret} } # @FUNCTION: _distutils-r1_check_namespace_pth @@ -1428,20 +1536,23 @@ _distutils-r1_check_namespace_pth() { distutils-r1_src_install() { debug-print-function ${FUNCNAME} "${@}" + local ret=0 if declare -f python_install >/dev/null; then - _distutils-r1_run_foreach_impl python_install + _distutils-r1_run_foreach_impl python_install || ret=${?} else - _distutils-r1_run_foreach_impl distutils-r1_python_install + _distutils-r1_run_foreach_impl distutils-r1_python_install || ret=${?} fi if declare -f python_install_all >/dev/null; then - _distutils-r1_run_common_phase python_install_all + _distutils-r1_run_common_phase python_install_all || ret=${?} else - _distutils-r1_run_common_phase distutils-r1_python_install_all + _distutils-r1_run_common_phase distutils-r1_python_install_all || ret=${?} fi _distutils-r1_check_namespace_pth + + return ${ret} } _DISTUTILS_R1=1 diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass index 32119cb9a526..50caa401bacf 100644 --- a/eclass/flag-o-matic.eclass +++ b/eclass/flag-o-matic.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: flag-o-matic.eclass @@ -48,21 +48,39 @@ setup-allowed-flags() { # Note: shell globs and character lists are allowed _setup-allowed-flags() { ALLOWED_FLAGS=( - -pipe -O '-O[12sg]' -mcpu -march -mtune + -pipe -O '-O[12sg]' '-mcpu=*' '-march=*' '-mtune=*' + + # Hardening flags '-fstack-protector*' - '-fsanitize*' '-fno-sanitize*' '-fstack-check*' -fno-stack-check - -fbounds-check -fbounds-checking -fno-strict-overflow - -fno-PIE -fno-pie -nopie -no-pie -fno-unit-at-a-time + -fstack-clash-protection + '-fcf-protection=*' + -fbounds-check -fbounds-checking + -fno-PIE -fno-pie -nopie -no-pie + # Spectre mitigations, bug #646076 + '-mindirect-branch=*' + -mindirect-branch-register + '-mfunction-return=*' + -mretpoline + + # Misc + -fno-unit-at-a-time -fno-strict-overflow + + # Sanitizers + '-fsanitize*' '-fno-sanitize*' - # debugging symbols should generally be very safe to add + # Debugging symbols should generally be very safe to add -g '-g[0-9]' -ggdb '-ggdb[0-9]' -gdwarf '-gdwarf-*' -gstabs -gstabs+ -gz + -glldb + # Cosmetic/output related, see e.g. bug #830534 + -fno-diagnostics-color '-fmessage-length=*' -fno-ident -fpermissive -frecord-gcc-switches + -frecord-command-line '-fdiagnostics*' '-fplugin*' '-W*' -w @@ -70,7 +88,7 @@ _setup-allowed-flags() { '-[DUILR]*' '-Wl,*' # Linker choice flag - '-fuse-ld' + '-fuse-ld=*' ) # allow a bunch of flags that negate features / control ABI @@ -80,19 +98,22 @@ _setup-allowed-flags() { -fno-omit-frame-pointer '-fno-builtin*' ) ALLOWED_FLAGS+=( - -mregparm -mno-app-regs -mapp-regs -mno-mmx -mno-sse + '-mregparm=*' -mno-app-regs -mapp-regs -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-ssse3 -mno-sse4 -mno-sse4.1 -mno-sse4.2 -mno-avx -mno-aes -mno-pclmul -mno-sse4a -mno-3dnow -mno-popcnt -mno-abm -mips1 -mips2 -mips3 -mips4 -mips32 -mips64 -mips16 -mplt - -msoft-float -mno-soft-float -mhard-float -mno-hard-float -mfpu - -mieee -mieee-with-inexact -mschedule -mfloat-gprs -mspe -mno-spe + -msoft-float -mno-soft-float -mhard-float -mno-hard-float '-mfpu=*' + -mieee -mieee-with-inexact '-mschedule=*' -mfloat-gprs -mspe -mno-spe -mtls-direct-seg-refs -mno-tls-direct-seg-refs -mflat -mno-flat - -mno-faster-structs -mfaster-structs -m32 -m64 -mx32 -mabi - -mlittle-endian -mbig-endian -EL -EB -fPIC -mlive-g0 -mcmodel - -mstack-bias -mno-stack-bias -msecure-plt '-m*-toc' -mfloat-abi + -mno-faster-structs -mfaster-structs -m32 -m64 -mx32 '-mabi=*' + -mlittle-endian -mbig-endian -EL -EB -fPIC -mlive-g0 '-mcmodel=*' + -mstack-bias -mno-stack-bias -msecure-plt '-m*-toc' '-mfloat-abi=*' -mfix-r4000 -mno-fix-r4000 -mfix-r4400 -mno-fix-r4400 -mfix-rm7000 -mno-fix-rm7000 -mfix-r10000 -mno-fix-r10000 - -mr10k-cache-barrier -mthumb -marm + '-mr10k-cache-barrier=*' -mthumb -marm + + # needed for arm64 (and in particular SCS) + -ffixed-x18 # gcc 4.5 -mno-fma4 -mno-movbe -mno-xop -mno-lwp @@ -452,9 +473,8 @@ strip-flags() { local new=() for x in ${!var} ; do - local flag=${x%%=*} for y in "${ALLOWED_FLAGS[@]}" ; do - if [[ -z ${flag%%${y}} ]] ; then + if [[ ${x} == ${y} ]] ; then new+=( "${x}" ) break fi diff --git a/eclass/go-module.eclass b/eclass/go-module.eclass index c9eb90ac62ea..984698bfbafa 100644 --- a/eclass/go-module.eclass +++ b/eclass/go-module.eclass @@ -25,7 +25,7 @@ # Since Go programs are statically linked, it is important that your ebuild's # LICENSE= setting includes the licenses of all statically linked # dependencies. So please make sure it is accurate. -# You can use a utility like dev-util/golicense (network connectivity is +# You can use a utility like dev-go/golicense (network connectivity is # required) to extract this information from the compiled binary. # # @EXAMPLE: diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass index d3d462aa9442..a79e865e66e2 100644 --- a/eclass/java-utils-2.eclass +++ b/eclass/java-utils-2.eclass @@ -2194,8 +2194,7 @@ java-pkg_init() { java-config --help >/dev/null || { eerror "" eerror "Can't run java-config --help" - eerror "Have you upgraded python recently but haven't" - eerror "run python-updater yet?" + eerror "Have you upgraded Python recently but not completed a world upgrade yet?" die "Can't run java-config --help" } diff --git a/eclass/java-virtuals-2.eclass b/eclass/java-virtuals-2.eclass index e929a7e1ceeb..d827342e9ba2 100644 --- a/eclass/java-virtuals-2.eclass +++ b/eclass/java-virtuals-2.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: java-virtuals-2.eclass @@ -6,14 +6,14 @@ # java@gentoo.org # @AUTHOR: # Original Author: Alistair John Bush -# @SUPPORTED_EAPIS: 5 6 8 +# @SUPPORTED_EAPIS: 5 6 7 8 # @BLURB: Java virtuals eclass # @DESCRIPTION: # To provide a default (and only) src_install function for ebuilds in the # java-virtuals category. case ${EAPI:-0} in - [568]) ;; + [5678]) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac diff --git a/eclass/java-vm-2.eclass b/eclass/java-vm-2.eclass index d24339200ce0..0d1eb2dc938f 100644 --- a/eclass/java-vm-2.eclass +++ b/eclass/java-vm-2.eclass @@ -1,17 +1,17 @@ -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: java-vm-2.eclass # @MAINTAINER: # java@gentoo.org -# @SUPPORTED_EAPIS: 6 8 +# @SUPPORTED_EAPIS: 6 7 8 # @BLURB: Java Virtual Machine eclass # @DESCRIPTION: # This eclass provides functionality which assists with installing # virtual machines, and ensures that they are recognized by java-config. case ${EAPI:-0} in - [68]) ;; + [678]) ;; *) die "EAPI=${EAPI} is not supported" ;; esac diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass index 7ad6d1efe94e..72e6a3ef25a6 100644 --- a/eclass/llvm.org.eclass +++ b/eclass/llvm.org.eclass @@ -1,4 +1,4 @@ -# Copyright 2019-2021 Gentoo Authors +# Copyright 2019-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: llvm.org.eclass @@ -294,6 +294,14 @@ llvm.org_src_unpack() { "${WORKDIR}/llvm-gentoo-patchset-${LLVM_PATCHSET}" | xargs rm assert + + if ver_test -ge 13.0.1_rc3; then + # fail if no patches remain + if [[ ! -s ${WORKDIR}/llvm-gentoo-patchset-${LLVM_PATCHSET} ]] + then + die "No patches in the patchset apply to the package" + fi + fi fi } diff --git a/eclass/out-of-source.eclass b/eclass/out-of-source.eclass index bbac555a7f88..81e03f3894db 100644 --- a/eclass/out-of-source.eclass +++ b/eclass/out-of-source.eclass @@ -1,10 +1,10 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: out-of-source.eclass # @MAINTAINER: # Michał Górny -# @SUPPORTED_EAPIS: 6 7 +# @SUPPORTED_EAPIS: 7 8 # @BLURB: convenient wrapper to build autotools packages out-of-source # @DESCRIPTION: # This eclass provides a minimalistic wrapper interface to easily @@ -33,13 +33,12 @@ # @CODE case ${EAPI} in - 6|7);; + 7|8);; *) die "EAPI ${EAPI:-0} unsupported (too old)";; esac -EXPORT_FUNCTIONS src_configure src_compile src_test src_install - if [[ ! ${_OUT_OF_SOURCE_ECLASS} ]]; then +_OUT_OF_SOURCE_ECLASS=1 # @FUNCTION: out-of-source_src_configure # @DESCRIPTION: @@ -121,5 +120,6 @@ out-of-source_src_install() { fi } -_OUT_OF_SOURCE_ECLASS=1 fi + +EXPORT_FUNCTIONS src_configure src_compile src_test src_install diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass index 7af9474d9a1f..282c449f2a03 100644 --- a/eclass/python-any-r1.eclass +++ b/eclass/python-any-r1.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: python-any-r1.eclass @@ -36,7 +36,7 @@ # both. # # For more information, please see the Python Guide: -# https://dev.gentoo.org/~mgorny/python-guide/ +# https://projects.gentoo.org/python/guide/ case "${EAPI:-0}" in [0-5]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;; diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass index 4b51cc18b959..40ad4ef4bbf8 100644 --- a/eclass/python-r1.eclass +++ b/eclass/python-r1.eclass @@ -28,7 +28,7 @@ # both. # # For more information, please see the Python Guide: -# https://dev.gentoo.org/~mgorny/python-guide/ +# https://projects.gentoo.org/python/guide/ case "${EAPI:-0}" in [0-5]) diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass index 5a4bcea55da4..574ee9cfc04e 100644 --- a/eclass/python-single-r1.eclass +++ b/eclass/python-single-r1.eclass @@ -35,7 +35,7 @@ # to inherit both. # # For more information, please see the Python Guide: -# https://dev.gentoo.org/~mgorny/python-guide/ +# https://projects.gentoo.org/python/guide/ case "${EAPI:-0}" in [0-5]) diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index aece257e8cba..c8367f8065f4 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -17,7 +17,7 @@ # functions. It can be inherited safely. # # For more information, please see the Python Guide: -# https://dev.gentoo.org/~mgorny/python-guide/ +# https://projects.gentoo.org/python/guide/ # NOTE: When dropping support for EAPIs here, we need to update # metadata/install-qa-check.d/60python-pyc @@ -1250,7 +1250,8 @@ build_sphinx() { sed -i -e 's:^intersphinx_mapping:disabled_&:' \ "${dir}"/conf.py || die # not all packages include the Makefile in pypi tarball - sphinx-build -b html -d "${dir}"/_build/doctrees "${dir}" \ + "${EPYTHON}" -m sphinx.cmd.build \ + -b html -d "${dir}"/_build/doctrees "${dir}" \ "${dir}"/_build/html || die HTML_DOCS+=( "${dir}/_build/html/." ) @@ -1320,6 +1321,14 @@ epytest() { -Wdefault # override color output "--color=${color}" + # disable the undesirable-dependency plugins by default to + # trigger missing argument strips. strip options that require + # them from config files. enable them explicitly via "-p ..." + # if you *really* need them. + -p no:cov + -p no:flake8 + -p no:flakes + -p no:pylint ) local x for x in "${EPYTEST_DESELECT[@]}"; do diff --git a/eclass/sgml-catalog-r1.eclass b/eclass/sgml-catalog-r1.eclass index 1e1f17815ac4..9f8bb13d6095 100644 --- a/eclass/sgml-catalog-r1.eclass +++ b/eclass/sgml-catalog-r1.eclass @@ -1,4 +1,4 @@ -# Copyright 2019 Gentoo Authors +# Copyright 2019-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: sgml-catalog-r1.eclass @@ -9,9 +9,8 @@ # @SUPPORTED_EAPIS: 7 # @BLURB: Functions for installing SGML catalogs # @DESCRIPTION: -# This eclass regenerates /etc/sgml/catalog, /etc/sgml.{,c}env -# and /etc/env.d/93sgmltools-lite as necessary for the DocBook tooling. -# This is done via exported pkg_postinst and pkg_postrm phases. +# This eclass regenerates /etc/sgml/catalog as necessary for the DocBook +# tooling. This is done via exported pkg_postinst and pkg_postrm phases. case ${EAPI:-0} in 7) ;; @@ -50,16 +49,9 @@ sgml-catalog-r1_update_catalog() { # @FUNCTION: sgml-catalog-r1_update_env # @DESCRIPTION: -# Regenerate environment variables and copy them to env.d. +# Remove obsolete environment files. They can break tools such as asciidoc. sgml-catalog-r1_update_env() { - # gensgmlenv doesn't support overriding root - if [[ -z ${ROOT} && -x "${EPREFIX}/usr/bin/gensgmlenv" ]]; then - ebegin "Regenerating SGML environment variables" - gensgmlenv && - grep -v export "${EPREFIX}/etc/sgml/sgml.env" > "${T}"/93sgmltools-lite && - mv "${T}"/93sgmltools-lite "${EPREFIX}/etc/env.d/93sgmltools-lite" - eend "${?}" - fi + rm -f "${EROOT}"/etc/env.d/93sgmltools-lite "${EROOT}"/etc/sgml/sgml.{,c}env } sgml-catalog-r1_pkg_postinst() { diff --git a/eclass/texlive-common.eclass b/eclass/texlive-common.eclass index 1fe33444f1e5..40e2c3530510 100644 --- a/eclass/texlive-common.eclass +++ b/eclass/texlive-common.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: texlive-common.eclass @@ -19,7 +19,7 @@ _TEXLIVE_COMMON_ECLASS=1 case ${EAPI:-0} in [0-6]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;; - 7) ;; + 7) inherit eapi8-dosym ;; *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;; esac @@ -46,7 +46,7 @@ texlive-common_handle_config_files() { dodir /etc/texmf/$(dirname ${f}).d einfo "Moving (and symlinking) ${EPREFIX}${TEXMF_PATH}/${f} to ${EPREFIX}/etc/texmf/$(dirname ${f}).d" mv "${ED}/${TEXMF_PATH}/${f}" "${ED}/etc/texmf/$(dirname ${f}).d" || die "mv ${f} failed." - dosym /etc/texmf/$(dirname ${f}).d/$(basename ${f}) ${TEXMF_PATH}/${f} + dosym8 -r /etc/texmf/$(dirname ${f}).d/$(basename ${f}) ${TEXMF_PATH}/${f} done < <(find -name '*.cnf' -type f -o -name '*.cfg' -type f | sed -e "s:\./::g") } diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index 61718f0d9a01..495a305ed83e 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -4,9 +4,18 @@ # @ECLASS: toolchain.eclass # @MAINTAINER: # Toolchain Ninjas -# @SUPPORTED_EAPIS: 5 6 7 8 +# @SUPPORTED_EAPIS: 7 8 # @BLURB: Common code for sys-devel/gcc ebuilds +case ${EAPI} in + 7) inherit eutils ;; + 8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + +if [[ ! ${_TOOLCHAIN_ECLASS} ]]; then +_TOOLCHAIN_ECLASS=1 + DESCRIPTION="The GNU Compiler Collection" HOMEPAGE="https://gcc.gnu.org/" @@ -30,16 +39,6 @@ fi FEATURES=${FEATURES/multilib-strict/} -case ${EAPI} in - 5|6) inherit eapi7-ver eutils ;; - 7) inherit eutils ;; - 8) ;; - *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; -esac - -EXPORT_FUNCTIONS pkg_pretend pkg_setup src_unpack src_prepare src_configure \ - src_compile src_test src_install pkg_postinst pkg_postrm - #---->> globals <<---- export CTARGET=${CTARGET:-${CHOST}} @@ -129,16 +128,6 @@ LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-excepti IUSE="test vanilla +nls" RESTRICT="!test? ( test )" -tc_supports_dostrip() { - case ${EAPI} in - 5|6) return 1 ;; - 7|8) return 0 ;; - *) die "Update apply_patches() for ${EAPI}." ;; - esac -} - -tc_supports_dostrip || RESTRICT+=" strip" # cross-compilers need controlled stripping - TC_FEATURES=() tc_has_feature() { @@ -146,21 +135,21 @@ tc_has_feature() { } if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then - IUSE+=" debug +cxx +nptl" TC_FEATURES+=(nptl) + IUSE+=" debug +cxx +nptl" TC_FEATURES+=( nptl ) [[ -n ${PIE_VER} ]] && IUSE+=" nopie" [[ -n ${SPECS_VER} ]] && IUSE+=" nossp" - IUSE+=" +fortran" TC_FEATURES+=(fortran) + IUSE+=" +fortran" TC_FEATURES+=( fortran ) IUSE+=" doc hardened multilib objc" - tc_version_is_between 3 7 && IUSE+=" awt gcj" TC_FEATURES+=(gcj) + tc_version_is_between 3 7 && IUSE+=" awt gcj" TC_FEATURES+=( gcj ) IUSE+=" pgo" - IUSE+=" objc-gc" TC_FEATURES+=(objc-gc) + IUSE+=" objc-gc" TC_FEATURES+=( objc-gc ) IUSE+=" libssp objc++" IUSE+=" +openmp" tc_version_is_at_least 4.3 && IUSE+=" fixed-point" tc_version_is_at_least 4.7 && IUSE+=" go" # sanitizer support appeared in gcc-4.8, but > S + SRC_URI essentials <<---- @@ -447,25 +432,9 @@ toolchain_src_unpack() { #---->> src_prepare <<---- -# 'epatch' is not available in EAPI=7. Abstract away patchset application -# until we eventually get all gcc ebuilds on EAPI=7 or later. -tc_apply_patches() { - [[ ${#@} -lt 2 ]] && die "usage: tc_apply_patches " - - einfo "$1"; shift - - case ${EAPI} in - # Note: even for EAPI=6 we used 'epatch' semantics. To avoid - # breaking existing ebuilds use 'eapply' only in EAPI=7 or later. - 5|6) epatch "$@" ;; - 7|8) eapply "$@" ;; - *) die "Update apply_patches() for ${EAPI}." ;; - esac -} - toolchain_src_prepare() { export BRANDING_GCC_PKGVERSION="Gentoo ${GCC_PVR}" - cd "${S}" + cd "${S}" || die do_gcc_gentoo_patches do_gcc_PIE_patches @@ -475,11 +444,7 @@ toolchain_src_prepare() { BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION}, commit ${EGIT_VERSION}" fi - case ${EAPI} in - 5) epatch_user;; - 6|7|8) eapply_user ;; - *) die "Update toolchain_src_prepare() for ${EAPI}." ;; - esac + eapply_user if ( tc_version_is_at_least 4.8.2 || _tc_use_if_iuse hardened ) \ && ! use vanilla ; then @@ -490,7 +455,7 @@ toolchain_src_prepare() { # since we configure with just one --libdir, we can't use that # (as gcc itself takes care of building multilibs). #435728 find "${S}" -name Makefile.in \ - -exec sed -i '/^pkgconfigdir/s:=.*:=$(toolexeclibdir)/pkgconfig:' {} + + -exec sed -i '/^pkgconfigdir/s:=.*:=$(toolexeclibdir)/pkgconfig:' {} + || die setup_multilib_osdirnames gcc_version_patch @@ -532,10 +497,11 @@ 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) - tc_apply_patches "Remove texinfo (bug #198182, bug #464008)" "${FILESDIR}"/gcc-configure-texinfo.patch + einfo "Remove texinfo (bug #198182, bug #464008)" + eapply "${FILESDIR}"/gcc-configure-texinfo.patch # >=gcc-4 if [[ -x contrib/gcc_update ]] ; then @@ -550,7 +516,8 @@ toolchain_src_prepare() { do_gcc_gentoo_patches() { if ! use vanilla ; then if [[ -n ${PATCH_VER} ]] ; then - tc_apply_patches "Applying Gentoo patches ..." "${WORKDIR}"/patch/*.patch + einfo "Applying Gentoo patches ..." + eapply "${WORKDIR}"/patch/*.patch BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION} p${PATCH_VER}" fi @@ -567,7 +534,8 @@ do_gcc_gentoo_patches() { local shopt_save=$(shopt -p nullglob) shopt -s nullglob - tc_apply_patches "Applying musl patches ..." "${WORKDIR}"/musl/{,nocross/}*.patch + einfo "Applying musl patches ..." + eapply "${WORKDIR}"/musl/{,nocross/}*.patch ${shopt_save} fi fi @@ -577,7 +545,8 @@ do_gcc_PIE_patches() { want_pie || return 0 use vanilla && return 0 - tc_apply_patches "Applying pie patches ..." "${WORKDIR}"/piepatch/*.patch + einfo "Applying pie patches ..." + eapply "${WORKDIR}"/piepatch/*.patch BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION}, pie-${PIE_VER}" } @@ -595,7 +564,8 @@ do_gcc_CYGWINPORTS_patches() { echo "${d}/${p}" done ) ) - tc_apply_patches "Applying cygwin port patches ..." ${patches[*]} + einfo "Applying cygwin port patches ..." + eapply -- "${patches[@]}" } # configure to build with the hardened GCC specs as the default @@ -663,12 +633,12 @@ 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 \ @@ -1744,9 +1714,9 @@ toolchain_src_install() { # - "${D}${LIBPATH}" # As dostrip does not specify host to override ${CHOST} tools just skip # non-native binary stripping. - is_crosscompile && tc_supports_dostrip && dostrip -x "${LIBPATH}" + is_crosscompile && dostrip -x "${LIBPATH}" - cd "${S}" + cd "${S}" || die if is_crosscompile; then rm -rf "${ED}"/usr/share/{man,info} rm -rf "${D}"${DATAPATH}/{man,info} @@ -2061,40 +2031,40 @@ gcc_slot_java() { toolchain_pkg_postinst() { do_gcc_config - if [[ ! ${ROOT%/} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then + if [[ ! ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then eselect compiler-shadow update all fi if ! is_crosscompile && [[ ${PN} != "kgcc64" ]] ; then # gcc stopped installing .la files fixer in June 2020. # Cleaning can be removed in June 2022. - rm -f "${EROOT%/}"/sbin/fix_libtool_files.sh - rm -f "${EROOT%/}"/usr/sbin/fix_libtool_files.sh - rm -f "${EROOT%/}"/usr/share/gcc-data/fixlafiles.awk + rm -f "${EROOT}"/sbin/fix_libtool_files.sh + rm -f "${EROOT}"/usr/sbin/fix_libtool_files.sh + rm -f "${EROOT}"/usr/share/gcc-data/fixlafiles.awk fi } toolchain_pkg_postrm() { do_gcc_config - if [[ ! ${ROOT%/} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then + if [[ ! ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then eselect compiler-shadow clean all fi # clean up the cruft left behind by cross-compilers if is_crosscompile ; then - if [[ -z $(ls "${EROOT%/}"/etc/env.d/gcc/${CTARGET}* 2>/dev/null) ]] ; then + if [[ -z $(ls "${EROOT}"/etc/env.d/gcc/${CTARGET}* 2>/dev/null) ]] ; then einfo "Removing last cross-compiler instance. Deleting dangling symlinks." - rm -f "${EROOT%/}"/etc/env.d/gcc/config-${CTARGET} - rm -f "${EROOT%/}"/etc/env.d/??gcc-${CTARGET} - rm -f "${EROOT%/}"/usr/bin/${CTARGET}-{gcc,{g,c}++}{,32,64} + rm -f "${EROOT}"/etc/env.d/gcc/config-${CTARGET} + rm -f "${EROOT}"/etc/env.d/??gcc-${CTARGET} + rm -f "${EROOT}"/usr/bin/${CTARGET}-{gcc,{g,c}++}{,32,64} fi return 0 fi # gcc stopped installing .la files fixer in June 2020. # Cleaning can be removed in June 2022. - rm -f "${EROOT%/}"/sbin/fix_libtool_files.sh - rm -f "${EROOT%/}"/usr/share/gcc-data/fixlafiles.awk + rm -f "${EROOT}"/sbin/fix_libtool_files.sh + rm -f "${EROOT}"/usr/share/gcc-data/fixlafiles.awk } do_gcc_config() { @@ -2113,7 +2083,7 @@ do_gcc_config() { [[ -n ${current_specs} ]] && use_specs=-${current_specs} if [[ -n ${use_specs} ]] && \ - [[ ! -e ${EROOT%/}/etc/env.d/gcc/${CTARGET}-${GCC_CONFIG_VER}${use_specs} ]] + [[ ! -e ${EROOT}/etc/env.d/gcc/${CTARGET}-${GCC_CONFIG_VER}${use_specs} ]] then ewarn "The currently selected specs-specific gcc config," ewarn "${current_specs}, doesn't exist anymore. This is usually" @@ -2352,6 +2322,11 @@ toolchain_death_notice() { fi } +fi + +EXPORT_FUNCTIONS pkg_pretend pkg_setup src_unpack src_prepare src_configure \ + src_compile src_test src_install pkg_postinst pkg_postrm + # Note [implicitly enabled flags] # ------------------------------- # Usually configure-based packages handle explicit feature requests diff --git a/eclass/user-info.eclass b/eclass/user-info.eclass index 8b8538bf843a..3838585ab6c1 100644 --- a/eclass/user-info.eclass +++ b/eclass/user-info.eclass @@ -1,15 +1,15 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: user-info.eclass # @MAINTAINER: # base-system@gentoo.org (Linux) # Michał Górny (NetBSD) -# @SUPPORTED_EAPIS: 5 6 7 8 +# @SUPPORTED_EAPIS: 6 7 8 # @BLURB: Read-only access to user and group information -case ${EAPI:-0} in - [5678]) ;; +case ${EAPI} in + 6|7|8) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac diff --git a/eclass/user.eclass b/eclass/user.eclass index d03d31819fcc..581704eae815 100644 --- a/eclass/user.eclass +++ b/eclass/user.eclass @@ -1,22 +1,19 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: user.eclass # @MAINTAINER: # base-system@gentoo.org (Linux) # Michał Górny (NetBSD) -# @SUPPORTED_EAPIS: 5 6 7 8 +# @SUPPORTED_EAPIS: 6 7 8 # @BLURB: user management in ebuilds # @DEPRECATED: acct-user/acct-group packages # @DESCRIPTION: # The user eclass contains a suite of functions that allow ebuilds # to quickly make sure users in the installed system are sane. -if [[ -z ${_USER_ECLASS} ]]; then -_USER_ECLASS=1 - -case ${EAPI:-0} in - 5|6|7) ;; +case ${EAPI} in + 6|7) ;; 8) if [[ ${CATEGORY} != acct-* ]]; then eerror "In EAPI ${EAPI}, packages must not inherit user.eclass" @@ -29,6 +26,9 @@ case ${EAPI:-0} in *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac +if [[ -z ${_USER_ECLASS} ]]; then +_USER_ECLASS=1 + inherit user-info # @FUNCTION: _assert_pkg_ebuild_phase diff --git a/eclass/usr-ldscript.eclass b/eclass/usr-ldscript.eclass index 2bf725abdd02..a8229ed2ac2e 100644 --- a/eclass/usr-ldscript.eclass +++ b/eclass/usr-ldscript.eclass @@ -1,20 +1,20 @@ -# Copyright 2019-2021 Gentoo Authors +# Copyright 2019-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: usr-ldscript.eclass # @MAINTAINER: # Toolchain Ninjas -# @SUPPORTED_EAPIS: 5 6 7 8 +# @SUPPORTED_EAPIS: 6 7 8 # @BLURB: Defines the gen_usr_ldscript function. -if [[ -z ${_USR_LDSCRIPT_ECLASS} ]]; then -_USR_LDSCRIPT_ECLASS=1 - case ${EAPI} in - 5|6|7|8) ;; + 6|7|8) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac +if [[ -z ${_USR_LDSCRIPT_ECLASS} ]]; then +_USR_LDSCRIPT_ECLASS=1 + inherit multilib toolchain-funcs IUSE="split-usr" diff --git a/eclass/vcs-clean.eclass b/eclass/vcs-clean.eclass index 89f6b7321879..e4c61ac7164a 100644 --- a/eclass/vcs-clean.eclass +++ b/eclass/vcs-clean.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: vcs-clean.eclass @@ -6,11 +6,11 @@ # base-system@gentoo.org # @AUTHOR: # Benedikt Böhm -# @SUPPORTED_EAPIS: 5 6 7 +# @SUPPORTED_EAPIS: 5 6 7 8 # @BLURB: helper functions to remove VCS directories -case ${EAPI:-0} in - [567]) ;; +case ${EAPI} in + 5|6|7|8) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac @@ -23,9 +23,11 @@ _VCS_CLEAN_ECLASS=1 # Remove CVS directories and .cvs* files recursively. Useful when a # source tarball contains internal CVS directories. Defaults to ${PWD}. ecvs_clean() { + debug-print-function ${FUNCNAME} "${@}" + [[ $# -eq 0 ]] && set -- . find "$@" '(' -type d -name 'CVS' -prune -o -type f -name '.cvs*' ')' \ - -exec rm -rf '{}' + + -exec rm -rf '{}' + || die } # @FUNCTION: esvn_clean @@ -34,8 +36,10 @@ ecvs_clean() { # Remove .svn directories recursively. Useful when a source tarball # contains internal Subversion directories. Defaults to ${PWD}. esvn_clean() { + debug-print-function ${FUNCNAME} "${@}" + [[ $# -eq 0 ]] && set -- . - find "$@" -type d -name '.svn' -prune -exec rm -rf '{}' + + find "$@" -type d -name '.svn' -prune -exec rm -rf '{}' + || die } # @FUNCTION: egit_clean @@ -44,8 +48,10 @@ esvn_clean() { # Remove .git* directories recursively. Useful when a source tarball # contains internal Git directories. Defaults to ${PWD}. egit_clean() { + debug-print-function ${FUNCNAME} "${@}" + [[ $# -eq 0 ]] && set -- . - find "$@" -type d -name '.git*' -prune -exec rm -rf '{}' + + find "$@" -type d -name '.git*' -prune -exec rm -rf '{}' + || die } fi diff --git a/eclass/vcs-snapshot.eclass b/eclass/vcs-snapshot.eclass index 05d963917e25..64bc1da040f4 100644 --- a/eclass/vcs-snapshot.eclass +++ b/eclass/vcs-snapshot.eclass @@ -1,10 +1,10 @@ -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: vcs-snapshot.eclass # @MAINTAINER: # mgorny@gentoo.org -# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7 +# @SUPPORTED_EAPIS: 6 7 8 # @BLURB: support eclass for unpacking VCS snapshot tarballs # @DESCRIPTION: # THIS ECLASS IS NOT NECESSARY FOR MODERN GITHUB AND GITLAB SNAPSHOTS. @@ -42,12 +42,13 @@ # and however the tarballs were originally packed, all files will appear # in ${WORKDIR}/${P} and ${WORKDIR}/${P}-otherstuff respectively. -case ${EAPI:-0} in - 0|1|2|3|4|5|6|7) ;; - *) die "vcs-snapshot.eclass API in EAPI ${EAPI} not yet established." +case ${EAPI} in + 6|7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac -EXPORT_FUNCTIONS src_unpack +if [[ ! ${_VCS_SNAPSHOT_ECLASS} ]]; then +_VCS_SNAPSHOT_ECLASS=1 # @FUNCTION: vcs-snapshot_src_unpack # @DESCRIPTION: @@ -102,7 +103,7 @@ vcs-snapshot_src_unpack() { if [[ ! ${renamed_any} ]]; then local w=eerror - [[ ${EAPI} == [0123456] ]] && w=eqawarn + [[ ${EAPI} == 6 ]] && w=eqawarn "${w}" "${FUNCNAME} did not find any archives that needed renaming." "${w}" "Please verify that its usage is really necessary, and remove" "${w}" "the inherit if it is not." @@ -110,3 +111,7 @@ vcs-snapshot_src_unpack() { [[ ${w} == eerror ]] && die "${FUNCNAME}: Unnecessary usage detected" fi } + +fi + +EXPORT_FUNCTIONS src_unpack -- cgit v1.2.3