diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-03-20 00:40:44 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-03-20 00:40:44 +0000 |
commit | 4cbcc855382a06088e2f016f62cafdbcb7e40665 (patch) | |
tree | 356496503d52354aa6d9f2d36126302fed5f3a73 /eclass | |
parent | fcc5224904648a8e6eb528d7603154160a20022f (diff) |
gentoo resync : 20.03.2022
Diffstat (limited to 'eclass')
67 files changed, 1036 insertions, 887 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz Binary files differindex 59246ceb6c5b..1ef4583da99c 100644 --- a/eclass/Manifest.gz +++ b/eclass/Manifest.gz diff --git a/eclass/apache-2.eclass b/eclass/apache-2.eclass index cd930aaf54f4..ccdfaa4533b2 100644 --- a/eclass/apache-2.eclass +++ b/eclass/apache-2.eclass @@ -10,21 +10,15 @@ # This eclass handles apache-2.x ebuild functions such as LoadModule generation # and inter-module dependency checking. -inherit autotools flag-o-matic multilib ssl-cert user toolchain-funcs +LUA_COMPAT=( lua5-{1..4} ) +inherit autotools flag-o-matic lua-single multilib ssl-cert user toolchain-funcs [[ ${CATEGORY}/${PN} != www-servers/apache ]] \ && die "Do not use this eclass with anything else than www-servers/apache ebuilds!" case ${EAPI:-0} in - 0|1|2|3|4|5) - die "This eclass is banned for EAPI<6" - ;; - 6) - inherit eapi7-ver - ;; - *) - LUA_COMPAT=( lua5-{1..4} ) - inherit lua-single + 0|1|2|3|4|5|6) + die "This eclass is banned for EAPI<7" ;; esac @@ -101,6 +95,9 @@ for module in ${IUSE_MODULES} ; do http2) IUSE+=" +apache2_modules_${module}" ;; + systemd) + IUSE+=" systemd" + ;; *) IUSE+=" apache2_modules_${module}" ;; @@ -147,6 +144,7 @@ RDEPEND=" >=net-libs/nghttp2-1.2.1 kernel_linux? ( sys-apps/util-linux ) ) + apache2_modules_lua? ( ${LUA_DEPS} ) apache2_modules_md? ( >=dev-libs/jansson-2.10 ) apache2_modules_mime? ( app-misc/mime-types ) apache2_modules_proxy_http2? ( @@ -163,6 +161,7 @@ RDEPEND=" >=dev-libs/openssl-1.0.2:0= kernel_linux? ( sys-apps/util-linux ) ) + systemd? ( sys-apps/systemd ) " DEPEND="${RDEPEND}" @@ -170,13 +169,11 @@ BDEPEND=" virtual/pkgconfig suexec? ( suexec-caps? ( sys-libs/libcap ) ) " -if [[ ${EAPI} == 6 ]] ; then - DEPEND+=" ${BDEPEND}" -fi PDEPEND="~app-admin/apache-tools-${PV}" REQUIRED_USE+=" apache2_modules_http2? ( ssl ) + apache2_modules_lua? ( ${LUA_REQUIRED_USE} ) apache2_modules_md? ( ssl ) " @@ -347,7 +344,12 @@ setup_modules() { MY_CONF+=( --disable-suexec ) fi - for x in ${IUSE_MODULES} ; do + if use systemd ; then + MY_CONF+=( --enable-systemd=${mod_type} ) + MY_MODS+=( systemd ) + fi + + for x in ${IUSE_MODULES/ systemd} ; do if use apache2_modules_${x} ; then MY_CONF+=( --enable-${x}=${mod_type} ) MY_MODS+=( ${x} ) @@ -450,7 +452,7 @@ apache-2_pkg_setup() { elog "Make sure CONFIG_SYSVIPC=y is set." elog - if [[ ${EAPI} != 6 ]] && use apache2_modules_lua ; then + if use apache2_modules_lua ; then lua-single_pkg_setup fi } diff --git a/eclass/bazel.eclass b/eclass/bazel.eclass index 8ae405c6941c..641da6194ca7 100644 --- a/eclass/bazel.eclass +++ b/eclass/bazel.eclass @@ -6,7 +6,7 @@ # Jason Zaman <perfinion@gentoo.org> # @AUTHOR: # Jason Zaman <perfinion@gentoo.org> -# @SUPPORTED_EAPIS: 7 +# @SUPPORTED_EAPIS: 7 8 # @BLURB: Utility functions for packages using Bazel Build # @DESCRIPTION: # A utility eclass providing functions to run the Bazel Build system. diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass index 02683634af9f..c9ff40f42c2e 100644 --- a/eclass/cmake.eclass +++ b/eclass/cmake.eclass @@ -406,6 +406,12 @@ cmake_src_prepare() { _CMAKE_SRC_PREPARE_HAS_RUN=1 } +# @VARIABLE: MYCMAKEARGS +# @DEFAULT_UNSET +# @DESCRIPTION: +# User-controlled environment variable containing arguments to be passed to +# cmake in cmake_src_configure. + # @FUNCTION: cmake_src_configure # @DESCRIPTION: # General function for configuring with cmake. Default behaviour is to start an @@ -593,9 +599,12 @@ cmake_src_configure() { "${mycmakeargs_local[@]}" -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" -DCMAKE_TOOLCHAIN_FILE="${toolchain_file}" - "${MYCMAKEARGS}" ) + if [[ -n ${MYCMAKEARGS} ]] ; then + cmakeargs+=( "${MYCMAKEARGS}" ) + fi + if [[ -n "${CMAKE_EXTRA_CACHE_FILE}" ]] ; then cmakeargs+=( -C "${CMAKE_EXTRA_CACHE_FILE}" ) fi diff --git a/eclass/db-use.eclass b/eclass/db-use.eclass index d23b08d19996..55e72286fda4 100644 --- a/eclass/db-use.eclass +++ b/eclass/db-use.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 # This is a common location for functions that aid the use of sys-libs/db # @@ -8,16 +8,17 @@ # maintainer-needed@gentoo.org # @AUTHOR: # Paul de Vrieze <pauldv@gentoo.org> -# @SUPPORTED_EAPIS: 5 6 7 +# @SUPPORTED_EAPIS: 5 6 7 8 # @BLURB: This is a common location for functions that aid the use of sys-libs/db # @DESCRIPTION: # This eclass is designed to provide helpful functions for depending on # sys-libs/db. # multilib is used for get_libname in all EAPI -case "${EAPI:-0}" in - 0|1|2|3|4|5|6) inherit eapi7-ver multilib ;; - *) inherit multilib ;; +case ${EAPI} in + 5|6) inherit eapi7-ver ;& # fallthrough + 7|8) inherit multilib ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac #Convert a version to a db slot @@ -40,7 +41,6 @@ db_ver_to_slot() { #Find the version that correspond to the given atom db_findver() { - has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= if [ $# -ne 1 ]; then eerror "Function db_findver needs one argument" >&2 eerror "args given:" >&2 @@ -68,7 +68,6 @@ db_findver() { # to test for, it will aim to find the library corresponding to it. db_includedir() { - has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= if [ $# -eq 0 ]; then VER="$(db_findver sys-libs/db)" || return 1 VER="$(db_ver_to_slot "$VER")" @@ -102,7 +101,6 @@ db_includedir() { # packages to test for, it will aim to find the library corresponding to it. db_libname() { - has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= if [ $# -eq 0 ]; then VER="$(db_findver sys-libs/db)" || return 1 if [ -e "${EPREFIX}/usr/$(get_libdir)/libdb-${VER}$(get_libname)" ]; then diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index 2b5acb09d926..4ce666eee902 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -82,11 +82,16 @@ esac # @PRE_INHERIT # @DEFAULT_UNSET # @DESCRIPTION: -# Enable experimental PEP 517 mode for the specified build system. -# In this mode, the complete build and install is done -# in python_compile(), venv-style install tree is provided -# to python_test() and python_install() just merges the temporary -# install tree into real fs. +# Enable the PEP 517 mode for the specified build system. In this mode, +# the complete build and install is done in python_compile(), +# a venv-style install tree is provided to python_test(), +# and python_install() just merges the temporary install tree +# into the real fs. +# +# This mode is recommended for Python packages. However, some packages +# using custom hacks on top of distutils/setuptools may not install +# correctly in this mode. Please verify the list of installed files +# when using it. # # The variable specifies the build system used. Currently, # the following values are supported: @@ -176,7 +181,7 @@ _distutils_set_globals() { # tomli is used to read build-backend from pyproject.toml bdep=' >=dev-python/installer-0.4.0_p20220124[${PYTHON_USEDEP}] - dev-python/tomli[${PYTHON_USEDEP}]' + >=dev-python/tomli-1.2.3[${PYTHON_USEDEP}]' case ${DISTUTILS_USE_PEP517} in flit) bdep+=' @@ -333,11 +338,8 @@ unset -f _distutils_set_globals # (allowing any implementation). If multiple values are specified, # implementations matching any of the patterns will be accepted. # -# The patterns can be either fnmatch-style patterns (matched via bash -# == operator against PYTHON_COMPAT values) or '-2' / '-3' to indicate -# appropriately all enabled Python 2/3 implementations (alike -# python_is_python3). Remember to escape or quote the fnmatch patterns -# to prevent accidental shell filename expansion. +# For the pattern syntax, please see _python_impl_matches +# in python-utils-r1.eclass. # # If the restriction needs to apply conditionally to a USE flag, # the variable should be set conditionally as well (e.g. in an early @@ -426,9 +428,11 @@ distutils_enable_sphinx() { python_check_deps() { use doc || return 0 + local p for p in dev-python/sphinx "${_DISTUTILS_SPHINX_PLUGINS[@]}"; do - has_version "${p}[${PYTHON_USEDEP}]" || return 1 + python_has_version "${p}[${PYTHON_USEDEP}]" || + return 1 done } else @@ -922,6 +926,130 @@ _distutils-r1_backend_to_key() { esac } +# @FUNCTION: _distutils-r1_get_backend +# @INTERNAL +# @DESCRIPTION: +# Read (or guess, in case of setuptools) the build-backend +# for the package in the current directory. +_distutils-r1_get_backend() { + debug-print-function ${FUNCNAME} "${@}" + + local build_backend + if [[ -f pyproject.toml ]]; then + # if pyproject.toml exists, try getting the backend from it + # NB: this could fail if pyproject.toml doesn't list one + build_backend=$( + "${EPYTHON}" - 3>&1 <<-EOF + import os + import tomli + print(tomli.load(open("pyproject.toml", "rb")) + .get("build-system", {}) + .get("build-backend", ""), + file=os.fdopen(3, "w")) + EOF + ) + fi + if [[ -z ${build_backend} && ${DISTUTILS_USE_PEP517} == setuptools && + -f setup.py ]] + then + # use the legacy setuptools backend as a fallback + build_backend=setuptools.build_meta:__legacy__ + fi + if [[ -z ${build_backend} ]]; then + die "Unable to obtain build-backend from pyproject.toml" + fi + + if [[ ${DISTUTILS_USE_PEP517} != standalone ]]; then + # verify whether DISTUTILS_USE_PEP517 was set correctly + local expected_value=$(_distutils-r1_backend_to_key "${build_backend}") + if [[ ${DISTUTILS_USE_PEP517} != ${expected_value} ]]; then + eerror "DISTUTILS_USE_PEP517 does not match pyproject.toml!" + eerror " have: DISTUTILS_USE_PEP517=${DISTUTILS_USE_PEP517}" + eerror "expected: DISTUTILS_USE_PEP517=${expected_value}" + 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 [[ ! -f ${T}/.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." + > "${T}"/.distutils_deprecated_backend_warned || die + fi + build_backend=${new_backend} + fi + fi + + echo "${build_backend}" +} + +# @FUNCTION: distutils_pep517_install +# @USAGE: <root> +# @DESCRIPTION: +# Build the wheel for the package in the current directory using PEP 517 +# backend and install it into <root>. +# +# This function is intended for expert use only. It does not handle +# wrapping executables. +distutils_pep517_install() { + debug-print-function ${FUNCNAME} "${@}" + [[ ${#} -eq 1 ]] || die "${FUNCNAME} takes exactly one argument: root" + + local root=${1} + local -x WHEEL_BUILD_DIR=${BUILD_DIR}/wheel + mkdir -p "${WHEEL_BUILD_DIR}" || die + + local build_backend=$(_distutils-r1_get_backend) + einfo " Building the wheel for ${PWD#${WORKDIR}/} via ${build_backend}" + local wheel=$( + "${EPYTHON}" - 3>&1 >&2 <<-EOF || die "Wheel build failed" + import ${build_backend%:*} + import os + print(${build_backend/:/.}.build_wheel(os.environ['WHEEL_BUILD_DIR']), + file=os.fdopen(3, 'w')) + EOF + ) + [[ -n ${wheel} ]] || die "No wheel name returned" + + 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 + # NB: we override sys.prefix & sys.exec_prefix because otherwise + # installer would use virtualenv's prefix + local -x PYTHON_PREFIX=${EPREFIX}/usr + "${EPYTHON}" - -d "${root}" "${WHEEL_BUILD_DIR}/${wheel}" --no-compile-bytecode \ + <<-EOF || die "installer failed" + import os, sys + sys.prefix = sys.exec_prefix = os.environ["PYTHON_PREFIX"] + from installer.__main__ import main + main(sys.argv[1:]) + EOF + + # 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 +} + # @FUNCTION: distutils-r1_python_compile # @USAGE: [additional-args...] # @DESCRIPTION: @@ -965,86 +1093,8 @@ distutils-r1_python_compile() { addpredict /usr/lib/portage/pym addpredict /usr/local # bug 498232 - local -x WHEEL_BUILD_DIR=${BUILD_DIR}/wheel - mkdir -p "${WHEEL_BUILD_DIR}" || die - - local build_backend - if [[ -f pyproject.toml ]]; then - build_backend=$("${EPYTHON}" -c 'import tomli; \ - print(tomli.load(open("pyproject.toml", "rb")) \ - ["build-system"]["build-backend"])' 2>/dev/null) - fi - if [[ -z ${build_backend} && ${DISTUTILS_USE_PEP517} == setuptools && - -f setup.py ]] - then - # use the legacy setuptools backend - build_backend=setuptools.build_meta:__legacy__ - fi - [[ -z ${build_backend} ]] && - die "Unable to obtain build-backend from pyproject.toml" - - if [[ ${DISTUTILS_USE_PEP517} != standalone ]]; then - local expected_value=$(_distutils-r1_backend_to_key "${build_backend}") - if [[ ${DISTUTILS_USE_PEP517} != ${expected_value} ]]; then - eerror "DISTUTILS_USE_PEP517 does not match pyproject.toml!" - eerror " have: DISTUTILS_USE_PEP517=${DISTUTILS_USE_PEP517}" - eerror "expected: DISTUTILS_USE_PEP517=${expected_value}" - 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 the wheel via ${build_backend}" - "${EPYTHON}" -c "import ${build_backend%:*}; \ - import os; \ - ${build_backend/:/.}.build_wheel(os.environ['WHEEL_BUILD_DIR'])" || - die "Wheel build failed" - - local wheel=( "${WHEEL_BUILD_DIR}"/*.whl ) - if [[ ${#wheel[@]} -ne 1 ]]; then - die "Incorrect number of wheels created (${#wheel[@]}): ${wheel[*]}" - 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 - "${EPYTHON}" -m installer -d "${root}" "${wheel}" \ - --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 + distutils_pep517_install "${root}" # copy executables to python-exec directory # we do it early so that we can alter bindir recklessly diff --git a/eclass/dune.eclass b/eclass/dune.eclass index 5b0418152da0..522dc2a8b52f 100644 --- a/eclass/dune.eclass +++ b/eclass/dune.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: dune.eclass @@ -26,6 +26,8 @@ case ${EAPI:-0} in *) die "${ECLASS}: EAPI ${EAPI} not supported" ;; esac +inherit multiprocessing + # Do not complain about CFLAGS etc since ml projects do not use them. QA_FLAGS_IGNORED='.*' @@ -44,13 +46,13 @@ esac dune_src_compile() { ebegin "Building" - dune build @install --profile release + dune build @install -j $(makeopts_jobs) --profile release eend $? || die } dune_src_test() { ebegin "Testing" - dune runtest --profile release + dune runtest -j $(makeopts_jobs) --profile release eend $? || die } diff --git a/eclass/emboss-r2.eclass b/eclass/emboss-r2.eclass index bcab338ad614..1fb7369304a7 100644 --- a/eclass/emboss-r2.eclass +++ b/eclass/emboss-r2.eclass @@ -1,6 +1,9 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +# @DEAD +# Removal on 2022-03-15. + # @ECLASS: emboss-r2.eclass # @MAINTAINER: # sci-biology@gentoo.org diff --git a/eclass/emboss-r3.eclass b/eclass/emboss-r3.eclass new file mode 100644 index 000000000000..bc372152cd93 --- /dev/null +++ b/eclass/emboss-r3.eclass @@ -0,0 +1,131 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: emboss-r3.eclass +# @MAINTAINER: +# sci-biology@gentoo.org +# @AUTHOR: +# Original author: Author Olivier Fisette <ofisette@gmail.com> +# Next gen author: Justin Lecher <jlec@gentoo.org> +# Next gen author: Ted Tanberry <ted.tanberry@gmail.com> +# @SUPPORTED_EAPIS: 8 +# @BLURB: Use this to easy install EMBOSS and EMBASSY programs (EMBOSS add-ons). +# @DESCRIPTION: +# The inheriting ebuild must provide EBO_DESCRIPTION before the inherit line. +# +# Example: +# +# EAPI=8 +# +# EBO_DESCRIPTION="applications from the CBS group" +# +# inherit emboss-r3 + +# @ECLASS-VARIABLE: EBO_DESCRIPTION +# @PRE_INHERIT +# @DEFAULT_UNSET +# @DESCRIPTION: +# Completes the generic description of the embassy module as follows: +# +# EMBOSS integrated version of ${EBO_DESCRIPTION}, e.g. +# +# "EMBOSS integrated version of applications from the CBS group" +# +# Defaults to the upstream name of the module. + +case ${EAPI} in + 8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + +if [[ ! ${_EMBOSS_R3_ECLASS} ]]; then +_EMBOSS_R3_ECLASS=1 + +inherit flag-o-matic + +HOMEPAGE="http://emboss.sourceforge.net/" + +LICENSE="LGPL-2 GPL-2" +SLOT="0" +IUSE="mysql pdf png postgres X" + +RDEPEND=" + dev-libs/expat + dev-libs/libpcre:3 + sci-libs/plplot:= + sys-libs/zlib + mysql? ( dev-db/mysql-connector-c:0= ) + pdf? ( media-libs/libharu:= ) + png? ( media-libs/gd:2=[png] ) + postgres? ( dev-db/postgresql:= ) + X? ( x11-libs/libXt )" + +if [[ ${PN} == embassy-* ]]; then + EMBASSY_PACKAGE=yes + # The EMBASSY package name, retrieved from the inheriting ebuild's name + EN=${PN:8} + # The full name and version of the EMBASSY package (excluding the Gentoo + # revision number) + EF="${EN^^}-${PV}" + + [[ ${EBO_DESCRIPTION} ]] || die "EBO_DESCRIPTION was not set before inheriting emboss-r3.eclass" + + DESCRIPTION="EMBOSS integrated version of ${EBO_DESCRIPTION}" + SRC_URI="ftp://emboss.open-bio.org/pub/EMBOSS/${EF}.tar.gz -> embassy-${EN}-${PV}.tar.gz" + RDEPEND+=" >=sci-biology/emboss-6.6.0-r1[mysql=,pdf=,png=,postgres=,X=]" + + S="${WORKDIR}/${EF}" +fi + +DEPEND="${RDEPEND}" + +# @FUNCTION: emboss-r3_src_configure +# @DESCRIPTION: +# runs econf with following options. +# +# --enable-shared +# $(use_with X x) +# $(use_with png pngdriver) +# $(use_with pdf hpdf) +# $(use_with mysql mysql) +# $(use_with postgres postgresql) +# --enable-large +# --without-java +# --enable-systemlibs +# +# can be appended to like econf, e.g. +# emboss-r3_src_configure --enable-foo + +emboss-r3_src_configure() { + local myconf=( + --enable-shared + $(use_with X x) + $(use_with png pngdriver "${ESYSROOT}"/usr) + $(use_with pdf hpdf "${ESYSROOT}"/usr) + $(use_with mysql mysql "${EPREFIX}"/usr/bin/mysql_config) + $(use_with postgres postgresql "${EPREFIX}"/usr/bin/pg_config) + --enable-large + --without-java + --enable-systemlibs + ) + + [[ ${EMBASSY_PACKAGE} == yes ]] && + append-cppflags "-I${ESYSROOT}/usr/include/emboss" + + econf "${myconf[@]}" "$@" +} + +# @FUNCTION: emboss-r3_src_install +# @DESCRIPTION: +# Installs the package into the staging area and removes unnecessary .la files. + +emboss-r3_src_install() { + default + + # delete .la files + find "${ED}" -name '*.la' -delete || die +} + +fi + +EXPORT_FUNCTIONS src_configure src_install diff --git a/eclass/fortran-2.eclass b/eclass/fortran-2.eclass index 2409cfcda5be..8fea2b4ceced 100644 --- a/eclass/fortran-2.eclass +++ b/eclass/fortran-2.eclass @@ -229,11 +229,11 @@ _fortran_test_function() { : ${FORTRAN_STANDARD:=77} for dialect in ${FORTRAN_STANDARD}; do case ${dialect} in - 77) _fortran_compile_test $(tc-getF77) || \ + 77) _fortran_compile_test "$(tc-getF77)" || \ _fortran_die_msg ;; - 90|95) _fortran_compile_test $(tc-getFC) 90 || \ + 90|95) _fortran_compile_test "$(tc-getFC)" 90 || \ _fortran_die_msg ;; - 2003) _fortran_compile_test $(tc-getFC) 03 || \ + 2003) _fortran_compile_test "$(tc-getFC)" 03 || \ _fortran_die_msg ;; 2008) die "Future" ;; *) die "${dialect} is not a Fortran dialect." ;; diff --git a/eclass/gkrellm-plugin.eclass b/eclass/gkrellm-plugin.eclass index 3d13409933e7..fb3800f56b7d 100644 --- a/eclass/gkrellm-plugin.eclass +++ b/eclass/gkrellm-plugin.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: gkrellm-plugin.eclass @@ -8,6 +8,7 @@ # Original author: Jim Ramsay <lack@gentoo.org> # EAPI 6 author: David Seifert <soap@gentoo.org> # @SUPPORTED_EAPIS: 6 +# @PROVIDES: multilib # @BLURB: Provides src_install used by (almost) all gkrellm plugins # @DESCRIPTION: # - Sets up default dependencies diff --git a/eclass/go-module.eclass b/eclass/go-module.eclass index 984698bfbafa..9fada315fdbf 100644 --- a/eclass/go-module.eclass +++ b/eclass/go-module.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: go-module.eclass @@ -12,15 +12,33 @@ # @DESCRIPTION: # This eclass provides basic settings and functions needed by all software # written in the go programming language that uses modules. +# If the software you are packaging has a file named go.mod in its top level +# directory, it uses modules. +# +# Modules have been the preferred method of tracking dependencies in software +# written in Go since version 1.16, +# so if the software isn't using modules, it should be updated. # -# If the software you are packaging has a file named go.mod in its top -# level directory, it uses modules and your ebuild should inherit this -# eclass. If it does not, your ebuild should use the golang-* eclasses. +# Also, if the top level go.mod file contains a go directive that +# specifies a version of go prior to 1.14, this should be reported +# upstream and updated. # -# If, besides go.mod, your software has a directory named vendor in its +# If the software has a directory named vendor in its # top level directory, the only thing you need to do is inherit the -# eclass. If there is no vendor directory, you need to also populate -# EGO_SUM and call go-module_set_globals as discussed below. +# eclass. If it doesn't, you need to also create a dependency tarball and +# host it somewhere, for example in your dev space. +# +# Here is an example of how to create a dependency tarball. +# The base directory in the GOMODCACHE setting must be go-mod in order +# to match the settings in this eclass. +# +# @CODE +# +# $ cd /path/to/project +# $ GOMODCACHE="${PWD}"/go-mod go mod download -modcacherw +# $ tar -acf project-1.0-deps.tar.xz go-mod +# +# @CODE # # Since Go programs are statically linked, it is important that your ebuild's # LICENSE= setting includes the licenses of all statically linked @@ -34,15 +52,9 @@ # # inherit go-module # -# EGO_SUM=( -# "github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod" -# "github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59" -# ) -# -# go-module_set_globals -# -# SRC_URI="https://github.com/example/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz -# ${EGO_SUM_SRC_URI}" +# SRC_URI="https://github.com/example/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" +# Add this line if you have a dependency tarball. +# SRC_URI+=" ${P}-deps.tar.xz" # # @CODE @@ -56,7 +68,7 @@ if [[ -z ${_GO_MODULE} ]]; then _GO_MODULE=1 if [[ ! ${GO_OPTIONAL} ]]; then - BDEPEND=">=dev-lang/go-1.12" + BDEPEND=">=dev-lang/go-1.16" # Workaround for pkgcheck false positive: https://github.com/pkgcore/pkgcheck/issues/214 # MissingUnpackerDep: version ...: missing BDEPEND="app-arch/unzip" @@ -76,10 +88,15 @@ export GO111MODULE=on # See "go help environment" for information on this setting export GOCACHE="${T}/go-build" +# Set the default for the go module cache +# See "go help environment" for information on this setting +export GOMODCACHE="${WORKDIR}/go-mod" + # The following go flags should be used for all builds. +# -modcacherw makes the build cache read/write # -v prints the names of packages as they are compiled # -x prints commands as they are executed -export GOFLAGS="-v -x -modcacherw" +export GOFLAGS="-modcacherw -v -x" # Do not complain about CFLAGS etc since go projects do not use them. QA_FLAGS_IGNORED='.*' @@ -88,13 +105,28 @@ QA_FLAGS_IGNORED='.*' RESTRICT+=" strip" # @ECLASS-VARIABLE: EGO_SUM +# @DEPRECATED # @DESCRIPTION: -# This is an array based on the go.sum content from inside the target package. -# Each array entry must be quoted and contain information from a single -# line from go.sum. +# This is replaced by a dependency tarball, see above for how to create +# one. +# +# This array is based on the contents of the go.sum file from the top +# level directory of the software you are packaging. Each entry must be +# quoted and contain the first two fields of a line from go.sum. +# +# You can use some combination of sed/awk/cut to extract the +# contents of EGO_SUM or use the dev-go/get-ego-vendor tool. +# +# One manual way to do this is the following: +# +# @CODE +# +# cat go.sum | cut -d" " -f1,2 | awk '{print "\t\"" $0 "\""}' +# +# @CODE # # The format of go.sum is described upstream here: -# https://tip.golang.org/cmd/go/#hdr-Module_authentication_using_go_sum +# https://go.dev/ref/mod#go-sum-files # # For inclusion in EGO_SUM, the h1: value and other future extensions SHOULD be # omitted at this time. The EGO_SUM parser will accept them for ease of ebuild @@ -121,6 +153,7 @@ RESTRICT+=" strip" # go.sum copy of the Hash1 values during building of the package. # @ECLASS-VARIABLE: _GOMODULE_GOPROXY_BASEURI +# @DEPRECATED # @DESCRIPTION: # Golang module proxy service to fetch module files from. Note that the module # proxy generally verifies modules via the Hash1 code. @@ -143,6 +176,7 @@ RESTRICT+=" strip" : "${_GOMODULE_GOPROXY_BASEURI:=mirror://goproxy/}" # @ECLASS-VARIABLE: _GOMODULE_GOSUM_REVERSE_MAP +# @DEPRECATED # @DESCRIPTION: # Mapping back from Gentoo distfile name to upstream distfile path. # Associative array to avoid O(N*M) performance when populating the GOPROXY @@ -153,14 +187,26 @@ declare -A -g _GOMODULE_GOSUM_REVERSE_MAP # @DEFAULT_UNSET # @PRE_INHERIT # @DESCRIPTION: -# If set to a non-null value before inherit, then the Go part of the +# If set to a non-null value before inherit, the Go part of the # ebuild will be considered optional. No dependencies will be added and -# no phase functions will be exported. -# -# If you enable GO_OPTIONAL, you have to set BDEPEND on >=dev-lang/go-1.12 -# for your package and call go-module_src_unpack manually. +# no phase functions will be exported. You will need to set BDEPEND and +# call go-module_src_unpack in your ebuild. + +# @FUNCTION: ego +# @USAGE: [<args>...] +# @DESCRIPTION: +# Call go, passing the supplied arguments. +# This function dies if go fails. It also supports being called via 'nonfatal'. +# If you need to call go directly in your ebuilds, this is the way it +# should be done. +ego() { + set -- go "$@" + echo "$@" >&2 + "$@" || die -n "${*} failed" +} # @FUNCTION: go-module_set_globals +# @DEPRECATED # @DESCRIPTION: # Convert the information in EGO_SUM for other usage in the ebuild. # - Populates EGO_SUM_SRC_URI that can be added to SRC_URI @@ -251,6 +297,7 @@ go-module_set_globals() { } # @FUNCTION: go-module_setup_proxy +# @DEPRECATED # @DESCRIPTION: # If your ebuild redefines src_unpack and uses EGO_SUM you need to call # this function in src_unpack. @@ -294,11 +341,14 @@ go-module_setup_proxy() { # @FUNCTION: go-module_src_unpack # @DESCRIPTION: # If EGO_SUM is set, unpack the base tarball(s) and set up the -# local go proxy. +# local go proxy. Also warn that this usage is deprecated. # - Otherwise, if EGO_VENDOR is set, bail out. # - Otherwise do a normal unpack. go-module_src_unpack() { if [[ "${#EGO_SUM[@]}" -gt 0 ]]; then + eqawarn "This ebuild uses EGO_SUM which is deprecated" + eqawarn "Please migrate to a dependency tarball" + eqawarn "This will become a fatal error in the future" _go-module_src_unpack_gosum elif [[ "${#EGO_VENDOR[@]}" -gt 0 ]]; then eerror "${EBUILD} is using EGO_VENDOR which is no longer supported" @@ -309,6 +359,7 @@ go-module_src_unpack() { } # @FUNCTION: _go-module_src_unpack_gosum +# @DEPRECATED # @DESCRIPTION: # Populate a GOPROXY directory hierarchy with distfiles from EGO_SUM and # unpack the base distfiles. @@ -354,6 +405,7 @@ _go-module_src_unpack_gosum() { } # @FUNCTION: _go-module_gosum_synthesize_files +# @DEPRECATED # @DESCRIPTION: # Given a path & version, populate all Goproxy metadata files which aren't # needed to be downloaded directly. @@ -381,6 +433,7 @@ _go-module_gosum_synthesize_files() { } # @FUNCTION: _go-module_src_unpack_verify_gosum +# @DEPRECATED # @DESCRIPTION: # Validate the Go modules declared by EGO_SUM are sufficient to cover building # the package, without actually building it yet. @@ -398,7 +451,7 @@ _go-module_src_unpack_verify_gosum() { # This will print 'downloading' messages, but it's accessing content from # the $GOPROXY file:/// URL! einfo "Tidying go.mod/go.sum" - go mod tidy >/dev/null + nonfatal ego mod tidy >/dev/null # This used to call 'go get' to verify by fetching everything from the main # go.mod. However 'go get' also turns out to recursively try to fetch @@ -424,11 +477,12 @@ go-module_live_vendor() { die "${FUNCNAME} only allowed when upstream isn't vendoring" pushd "${S}" >& /dev/null || die - go mod vendor || die + ego mod vendor popd >& /dev/null || die } # @FUNCTION: _go-module_gomod_encode +# @DEPRECATED # @DESCRIPTION: # Encode the name(path) of a Golang module in the format expected by Goproxy. # diff --git a/eclass/golang-base.eclass b/eclass/golang-base.eclass index 8e859d0fdf63..f506e32dc7ca 100644 --- a/eclass/golang-base.eclass +++ b/eclass/golang-base.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: golang-base.eclass @@ -6,6 +6,7 @@ # William Hubbs <williamh@gentoo.org> # @SUPPORTED_EAPIS: 5 6 7 # @BLURB: Eclass that provides base functions for Go packages. +# @DEPRECATED: go-module.eclass # @DESCRIPTION: # This eclass provides base functions for software written in the Go # programming language; it also provides the build-time dependency on diff --git a/eclass/golang-build.eclass b/eclass/golang-build.eclass index 308503e84950..846593e1c019 100644 --- a/eclass/golang-build.eclass +++ b/eclass/golang-build.eclass @@ -7,6 +7,7 @@ # @SUPPORTED_EAPIS: 5 6 7 # @PROVIDES: golang-base # @BLURB: Eclass for compiling go packages. +# @DEPRECATED: go-module.eclass # @DESCRIPTION: # This eclass provides default src_compile, src_test and src_install # functions for software written in the Go programming language. diff --git a/eclass/golang-vcs-snapshot.eclass b/eclass/golang-vcs-snapshot.eclass index 66503e38b59d..fb1e3c4a1eb2 100644 --- a/eclass/golang-vcs-snapshot.eclass +++ b/eclass/golang-vcs-snapshot.eclass @@ -7,6 +7,7 @@ # @SUPPORTED_EAPIS: 5 6 7 # @PROVIDES: golang-base # @BLURB: eclass to unpack VCS snapshot tarballs for Go software +# @DEPRECATED: go-module.eclass # @DESCRIPTION: # This eclass provides a convenience src_unpack() which unpacks the # first tarball mentioned in SRC_URI to its appropriate location in diff --git a/eclass/golang-vcs.eclass b/eclass/golang-vcs.eclass index 27b2e5fa9c9b..6492fe4378c5 100644 --- a/eclass/golang-vcs.eclass +++ b/eclass/golang-vcs.eclass @@ -7,6 +7,7 @@ # @SUPPORTED_EAPIS: 5 6 7 # @PROVIDES: golang-base # @BLURB: Eclass for fetching and unpacking go repositories. +# @DEPRECATED: go-module.eclass # @DESCRIPTION: # This eclass is written to ease the maintenance of live ebuilds # of software written in the Go programming language. diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index f1c27a36d99b..9ec3d18d17c5 100644 --- a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@ -17,164 +17,238 @@ # added functionality: # unipatch - a flexible, singular method to extract, add and remove patches. -# @ECLASS-VARIABLE: K_USEPV +# @ECLASS-VARIABLE: CTARGET +# @INTERNAL +# @DESCRIPTION: +# Utilized for 32-bit userland on ppc64. + +# @ECLASS-VARIABLE: CKV # @DEFAULT_UNSET # @DESCRIPTION: -# When setting the EXTRAVERSION variable, it should -# add PV to the end. -# this is useful for things like wolk. IE: -# EXTRAVERSION would be something like : -wolk-4.19-r1 +# Used as a comparison kernel version, which is used when +# PV doesnt reflect the genuine kernel version. +# This gets set to the portage style versioning. ie: +# CKV=2.6.11_rc4 -# @ECLASS-VARIABLE: K_NODRYRUN +# @ECLASS-VARIABLE: EXTRAVERSION # @DEFAULT_UNSET # @DESCRIPTION: -# if this is set then patch --dry-run will not -# be run. Certain patches will fail with this parameter -# See bug #507656 +# The additional version appended to OKV (-gentoo/-gentoo-r1) -# @ECLASS-VARIABLE: K_NOSETEXTRAVERSION +# @ECLASS-VARIABLE: H_SUPPORTEDARCH # @DEFAULT_UNSET # @DESCRIPTION: -# if this is set then EXTRAVERSION will not be -# automatically set within the kernel Makefile +# this should be a space separated list of ARCH's which +# can be supported by the headers ebuild -# @ECLASS-VARIABLE: K_NOUSENAME +# @ECLASS-VARIABLE: K_BASE_VER # @DEFAULT_UNSET # @DESCRIPTION: -# if this is set then EXTRAVERSION will not include the -# first part of ${PN} in EXTRAVERSION +# for git-sources, declare the base version this patch is +# based off of. -# @ECLASS-VARIABLE: K_NOUSEPR +# @ECLASS-VARIABLE: K_DEBLOB_AVAILABLE # @DEFAULT_UNSET # @DESCRIPTION: -# if this is set then EXTRAVERSION will not include the -# anything based on ${PR}. +# A value of "0" will disable all of the optional deblob +# code. If empty, will be set to "1" if deblobbing is +# possible. Test ONLY for "1". -# @ECLASS-VARIABLE: K_PREPATCHED +# @ECLASS-VARIABLE: K_DEBLOB_TAG # @DEFAULT_UNSET # @DESCRIPTION: -# if the patchset is prepatched (ie: pf-sources, -# zen-sources etc) it will use PR (ie: -r5) as the -# patchset version for and not use it as a true package -# revision +# This will be the version of deblob script. It's a upstream SVN tag +# such asw -gnu or -gnu1. -# @ECLASS-VARIABLE: K_EXTRAEINFO +# @ECLASS-VARIABLE: K_DEFCONFIG +# @DEFAULT_UNSET +# @DESCRIPTION: +# Allow specifying a different defconfig target. +# If length zero, defaults to "defconfig". + +# @ECLASS-VARIABLE: K_EXP_GENPATCHES_PULL +# @DEFAULT_UNSET +# @DESCRIPTION: +# If set, we pull "experimental" regardless of the USE FLAG +# but expect the ebuild maintainer to use K_EXP_GENPATCHES_LIST. + +# @ECLASS-VARIABLE: K_EXP_GENPATCHES_NOUSE +# @DEFAULT_UNSET +# @DESCRIPTION: +# If set, no USE flag will be provided for "experimental"; +# as a result the user cannot choose to apply those patches. + +# @ECLASS-VARIABLE: K_EXP_GENPATCHES_LIST +# @DEFAULT_UNSET +# @DESCRIPTION: +# A list of patches to pick from "experimental" to apply when +# the USE flag is unset and K_EXP_GENPATCHES_PULL is set. + +# @ECLASS-VARIABLE: K_EXTRAEINFO # @DEFAULT_UNSET # @DESCRIPTION: # this is a new-line seperated list of einfo displays in # postinst and can be used to carry additional postinst # messages -# @ECLASS-VARIABLE: K_EXTRAELOG +# @ECLASS-VARIABLE: K_EXTRAELOG # @DEFAULT_UNSET # @DESCRIPTION: # same as K_EXTRAEINFO except using elog instead of einfo -# @ECLASS-VARIABLE: K_EXTRAEWARN +# @ECLASS-VARIABLE: K_EXTRAEWARN # @DEFAULT_UNSET # @DESCRIPTION: # same as K_EXTRAEINFO except using ewarn instead of einfo -# @ECLASS-VARIABLE: K_SYMLINK +# @ECLASS-VARIABLE: K_FROM_GIT # @DEFAULT_UNSET # @DESCRIPTION: -# if this is set, then forcably create symlink anyway +# If set, this variable signals that the kernel sources derives +# from a git tree and special handling will be applied so that +# any patches that are applied will actually apply. -# @ECLASS-VARIABLE: K_BASE_VER +# @ECLASS-VARIABLE: K_GENPATCHES_VER # @DEFAULT_UNSET # @DESCRIPTION: -# for git-sources, declare the base version this patch is -# based off of. +# The version of the genpatches tarball(s) to apply. +# A value of "5" would apply genpatches-2.6.12-5 to +# my-sources-2.6.12.ebuild -# @ECLASS-VARIABLE: K_DEFCONFIG +# @ECLASS-VARIABLE: K_LONGTERM # @DEFAULT_UNSET # @DESCRIPTION: -# Allow specifying a different defconfig target. -# If length zero, defaults to "defconfig". +# If set, the eclass will search for the kernel source +# in the long term directories on the upstream servers +# as the location has been changed by upstream -# @ECLASS-VARIABLE: K_WANT_GENPATCHES +# @ECLASS-VARIABLE: K_NODRYRUN # @DEFAULT_UNSET # @DESCRIPTION: -# Apply genpatches to kernel source. Provide any -# combination of "base", "extras" or "experimental". +# if this is set then patch --dry-run will not +# be run. Certain patches will fail with this parameter +# See bug #507656 -# @ECLASS-VARIABLE: K_EXP_GENPATCHES_PULL +# @ECLASS-VARIABLE: K_NOSETEXTRAVERSION # @DEFAULT_UNSET # @DESCRIPTION: -# If set, we pull "experimental" regardless of the USE FLAG -# but expect the ebuild maintainer to use K_EXP_GENPATCHES_LIST. +# if this is set then EXTRAVERSION will not be +# automatically set within the kernel Makefile -# @ECLASS-VARIABLE: K_EXP_GENPATCHES_NOUSE +# @ECLASS-VARIABLE: K_NOUSENAME # @DEFAULT_UNSET # @DESCRIPTION: -# If set, no USE flag will be provided for "experimental"; -# as a result the user cannot choose to apply those patches. +# if this is set then EXTRAVERSION will not include the +# first part of ${PN} in EXTRAVERSION -# @ECLASS-VARIABLE: K_EXP_GENPATCHES_LIST +# @ECLASS-VARIABLE: K_NOUSEPR # @DEFAULT_UNSET # @DESCRIPTION: -# A list of patches to pick from "experimental" to apply when -# the USE flag is unset and K_EXP_GENPATCHES_PULL is set. +# if this is set then EXTRAVERSION will not include the +# anything based on ${PR}. -# @ECLASS-VARIABLE: K_FROM_GIT +# @ECLASS-VARIABLE: K_PREDEBLOBBED # @DEFAULT_UNSET # @DESCRIPTION: -# If set, this variable signals that the kernel sources derives -# from a git tree and special handling will be applied so that -# any patches that are applied will actually apply. +# This kernel was already deblobbed elsewhere. +# If false, either optional deblobbing will be available +# or the license will note the inclusion of linux-firmware code. -# @ECLASS-VARIABLE: K_GENPATCHES_VER +# @ECLASS-VARIABLE: K_PREPATCHED # @DEFAULT_UNSET # @DESCRIPTION: -# The version of the genpatches tarball(s) to apply. -# A value of "5" would apply genpatches-2.6.12-5 to -# my-sources-2.6.12.ebuild +# if the patchset is prepatched (ie: pf-sources, +# zen-sources etc) it will use PR (ie: -r5) as the +# patchset version for and not use it as a true package +# revision -# @ECLASS-VARIABLE: K_SECURITY_UNSUPPORTED +# @ECLASS-VARIABLE: K_SECURITY_UNSUPPORTED # @DEFAULT_UNSET # @DESCRIPTION: # If set, this kernel is unsupported by Gentoo Security # to the current eclass maintainer :) -# @ECLASS-VARIABLE: K_DEBLOB_AVAILABLE +# @ECLASS-VARIABLE: K_SYMLINK # @DEFAULT_UNSET # @DESCRIPTION: -# A value of "0" will disable all of the optional deblob -# code. If empty, will be set to "1" if deblobbing is -# possible. Test ONLY for "1". +# if this is set, then forcably create symlink anyway -# @ECLASS-VARIABLE: K_DEBLOB_TAG +# @ECLASS-VARIABLE: K_USEPV # @DEFAULT_UNSET # @DESCRIPTION: -# This will be the version of deblob script. It's a upstream SVN tag -# such asw -gnu or -gnu1. +# When setting the EXTRAVERSION variable, it should +# add PV to the end. +# this is useful for things like wolk. IE: +# EXTRAVERSION would be something like : -wolk-4.19-r1 -# @ECLASS-VARIABLE: K_PREDEBLOBBED +# @ECLASS-VARIABLE: K_WANT_GENPATCHES # @DEFAULT_UNSET # @DESCRIPTION: -# This kernel was already deblobbed elsewhere. -# If false, either optional deblobbing will be available -# or the license will note the inclusion of linux-firmware code. +# Apply genpatches to kernel source. Provide any +# combination of "base", "extras" or "experimental". -# @ECLASS-VARIABLE: K_LONGTERM +# @ECLASS-VARIABLE: KERNEL_URI # @DEFAULT_UNSET # @DESCRIPTION: -# If set, the eclass will search for the kernel source -# in the long term directories on the upstream servers -# as the location has been changed by upstream +# Upstream kernel src URI -# @ECLASS-VARIABLE: H_SUPPORTEDARCH +# @ECLASS-VARIABLE: KV # @DEFAULT_UNSET +# @OUTPUT_VARIABLE # @DESCRIPTION: -# this should be a space separated list of ARCH's which -# can be supported by the headers ebuild +# Kernel Version (2.6.0-gentoo/2.6.0-test11-gentoo-r1) -# @ECLASS-VARIABLE: UNIPATCH_LIST +# @ECLASS-VARIABLE: KV_FULL # @DEFAULT_UNSET +# @OUTPUT_VARIABLE # @DESCRIPTION: -# space delimetered list of patches to be applied to the kernel +# Kernel full version + +# @ECLASS-VARIABLE: KV_MAJOR +# @DEFAULT_UNSET +# @OUTPUT_VARIABLE +# @DESCRIPTION: +# Kernel major version from <KV_MAJOR>.<KV_MINOR>.<KV_PATCH + +# @ECLASS-VARIABLE: KV_MINOR +# @DEFAULT_UNSET +# @OUTPUT_VARIABLE +# @DESCRIPTION: +# Kernel minor version from <KV_MAJOR>.<KV_MINOR>.<KV_PATCH + +# @ECLASS-VARIABLE: KV_PATCH +# @DEFAULT_UNSET +# @OUTPUT_VARIABLE +# @DESCRIPTION: +# Kernel patch version from <KV_MAJOR>.<KV_MINOR>.<KV_PATCH + +# @ECLASS-VARIABLE: LINUX_HOSTCFLAGS +# @DEFAULT_UNSET +# @DESCRIPTION: +# Default cflags if not already set + +# @ECLASS-VARIABLE: OKV +# @DEFAULT_UNSET +# @DESCRIPTION: +# Original Kernel Version (2.6.0/2.6.0-test11) + +# @ECLASS-VARIABLE: RELEASE +# @DEFAULT_UNSET +# @DESCRIPTION: +# Representative of the kernel release tag (-rc3/-git3) + +# @ECLASS-VARIABLE: RELEASETYPE +# @DEFAULT_UNSET +# @DESCRIPTION: +# The same as RELEASE but with its numerics stripped (-rc/-git) -# @ECLASS-VARIABLE: UNIPATCH_EXCLUDE +# @ECLASS-VARIABLE: UNIPATCH_DOCS +# @DEFAULT_UNSET +# @DESCRIPTION: +# space delimemeted list of docs to be installed to +# the doc dir + +# @ECLASS-VARIABLE: UNIPATCH_EXCLUDE # @DEFAULT_UNSET # @DESCRIPTION: # An addition var to support exlusion based completely @@ -182,13 +256,22 @@ # this should _NOT_ be used from the ebuild as this is # reserved for end users passing excludes from the cli -# @ECLASS-VARIABLE: UNIPATCH_DOCS +# @ECLASS-VARIABLE: UNIPATCH_LIST # @DEFAULT_UNSET # @DESCRIPTION: -# space delimemeted list of docs to be installed to -# the doc dir +# space delimetered list of patches to be applied to the kernel + +# @ECLASS-VARIABLE: UNIPATCH_LIST_DEFAULT +# @INTERNAL +# @DESCRIPTION: +# Upstream kernel patch archive + +# @ECLASS-VARIABLE: UNIPATCH_LIST_GENPATCHES +# @INTERNAL +# @DESCRIPTION: +# List of genpatches archives to apply to the kernel -# @ECLASS-VARIABLE: UNIPATCH_STRICTORDER +# @ECLASS-VARIABLE: UNIPATCH_STRICTORDER # @DEFAULT_UNSET # @DESCRIPTION: # if this is set places patches into directories of diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass index 496b9c98b526..e327be7ca13f 100644 --- a/eclass/linux-mod.eclass +++ b/eclass/linux-mod.eclass @@ -7,7 +7,7 @@ # @AUTHOR: # John Mylchreest <johnm@gentoo.org>, # Stefan Schweizer <genstef@gentoo.org> -# @SUPPORTED_EAPIS: 5 6 7 +# @SUPPORTED_EAPIS: 6 7 8 # @PROVIDES: linux-info # @BLURB: It provides the functionality required to install external modules against a kernel source tree. # @DESCRIPTION: @@ -150,7 +150,11 @@ # It's a read-only variable. It contains the extension of the kernel modules. case ${EAPI:-0} in - [567]) inherit eutils ;; + [67]) + inherit eutils + ;; + 8) + ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac @@ -603,11 +607,6 @@ linux-mod_pkg_setup() { local is_bin="${MERGE_TYPE}" # If we are installing a binpkg, take a different path. - # use MERGE_TYPE if available (eapi>=4); else use non-PMS EMERGE_FROM (eapi<4) - if has ${EAPI} 0 1 2 3; then - is_bin=${EMERGE_FROM} - fi - if [[ ${is_bin} == binary ]]; then linux-mod_pkg_setup_binary return diff --git a/eclass/llvm.eclass b/eclass/llvm.eclass index 359f3a669d06..9a6f0c8b6b85 100644 --- a/eclass/llvm.eclass +++ b/eclass/llvm.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: llvm.eclass @@ -6,7 +6,7 @@ # Michał Górny <mgorny@gentoo.org> # @AUTHOR: # Michał Górny <mgorny@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 +# @SUPPORTED_EAPIS: 6 7 8 # @BLURB: Utility functions to build against slotted LLVM # @DESCRIPTION: # The llvm.eclass provides utility functions that can be used to build @@ -60,7 +60,7 @@ case "${EAPI:-0}" in 0|1|2|3|4|5) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;; - 6|7) + 6|7|8) ;; *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" @@ -85,7 +85,7 @@ DEPEND="!!sys-devel/llvm:0" # @INTERNAL # @DESCRIPTION: # Correct values of LLVM slots, newest first. -declare -g -r _LLVM_KNOWN_SLOTS=( {14..8} ) +declare -g -r _LLVM_KNOWN_SLOTS=( {15..8} ) # @FUNCTION: get_llvm_prefix # @USAGE: [-b|-d] [<max_slot>] diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass index 72e6a3ef25a6..5411d81a7877 100644 --- a/eclass/llvm.org.eclass +++ b/eclass/llvm.org.eclass @@ -45,7 +45,7 @@ esac # @DESCRIPTION: # The major version of current LLVM trunk. Used to determine # the correct branch to use. -_LLVM_MASTER_MAJOR=14 +_LLVM_MASTER_MAJOR=15 # @ECLASS-VARIABLE: _LLVM_SOURCE_TYPE # @INTERNAL @@ -142,13 +142,20 @@ case ${PV} in PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore ) ;; - *) + 14*) ALL_LLVM_EXPERIMENTAL_TARGETS=( ARC CSKY M68k ) ALL_LLVM_PRODUCTION_TARGETS=( AArch64 AMDGPU ARM AVR BPF Hexagon Lanai Mips MSP430 NVPTX PowerPC RISCV Sparc SystemZ VE WebAssembly X86 XCore ) ;; + *) + ALL_LLVM_EXPERIMENTAL_TARGETS=( ARC CSKY LoongArch M68k ) + ALL_LLVM_PRODUCTION_TARGETS=( + AArch64 AMDGPU ARM AVR BPF Hexagon Lanai Mips MSP430 NVPTX + PowerPC RISCV Sparc SystemZ VE WebAssembly X86 XCore + ) + ;; esac ALL_LLVM_TARGET_FLAGS=( diff --git a/eclass/meson.eclass b/eclass/meson.eclass index 5fab2f8df6be..f6cb39ef4794 100644 --- a/eclass/meson.eclass +++ b/eclass/meson.eclass @@ -47,7 +47,7 @@ inherit multiprocessing ninja-utils python-utils-r1 toolchain-funcs EXPORT_FUNCTIONS src_configure src_compile src_test src_install -_MESON_DEPEND=">=dev-util/meson-0.58.2-r1 +_MESON_DEPEND=">=dev-util/meson-0.59.4 >=dev-util/ninja-1.8.2 dev-util/meson-format-array " diff --git a/eclass/mozcoreconf-v6.eclass b/eclass/mozcoreconf-v6.eclass index 250f49bd58bd..c79854659f1f 100644 --- a/eclass/mozcoreconf-v6.eclass +++ b/eclass/mozcoreconf-v6.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: mozcoreconf-v6.eclass @@ -76,18 +76,6 @@ mozconfig_use_with() { mozconfig_annotate "$(use $1 && echo +$1 || echo -$1)" "${flag}" } -# @FUNCTION: mozconfig_use_extension -# @DESCRIPTION: -# enable or disable an extension based on a USE-flag -# -# Example: -# mozconfig_use_extension gnome gnomevfs -# => ac_add_options --enable-extensions=gnomevfs -mozconfig_use_extension() { - declare minus=$(use $1 || echo -) - mozconfig_annotate "${minus:-+}$1" --enable-extensions=${minus}${2} -} - moz_pkgsetup() { # Ensure we use C locale when building export LANG="C" @@ -289,12 +277,6 @@ mozconfig_final() { done echo "==========================================================" echo - - # Resolve multiple --enable-extensions down to one - declare exts=$(sed -n 's/^ac_add_options --enable-extensions=\([^ ]*\).*/\1/p' \ - .mozconfig | xargs) - sed -i '/^ac_add_options --enable-extensions/d' .mozconfig - echo "ac_add_options --enable-extensions=${exts// /,}" >> .mozconfig } _MOZCORECONF=1 diff --git a/eclass/openib.eclass b/eclass/openib.eclass deleted file mode 100644 index 02a6b40fcd3c..000000000000 --- a/eclass/openib.eclass +++ /dev/null @@ -1,158 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# @DEAD -# @ECLASS: openib.eclass -# @MAINTAINER: -# maintainer-needed@gentoo.org -# @AUTHOR: -# Author: Alexey Shvetsov <alexxy@gentoo.org> -# @SUPPORTED_EAPIS: 5 6 -# @BLURB: Simplify working with OFED packages - -case ${EAPI:-0} in - [56]) inherit eutils rpm versionator ;; - *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; -esac - -EXPORT_FUNCTIONS src_unpack - -if [[ -z ${_OPENIB_ECLASS} ]] ; then -_OPENIB_ECLASS=1 - -HOMEPAGE="https://www.openfabrics.org/" -LICENSE="|| ( GPL-2 BSD-2 )" - -# @ECLASS-VARIABLE: OFED_VER -# @DESCRIPTION: -# Defines OFED version eg 1.4 or 1.4.0.1 - -# @ECLASS-VARIABLE: OFED_RC -# @DESCRIPTION: -# Sets if this version is RC - -# @ECLASS-VARIABLE: OFED_RC_VER -# @DESCRIPTION: -# Sets RC version - - -# @ECLASS-VARIABLE: OFED_SUFFIX -# @DESCRIPTION: -# Defines OFED package suffix eg -1.ofed1.4 - -# @ECLASS-VARIABLE: OFED_SNAPSHOT -# @DESCRIPTION: -# Defines if src tarball is git snapshot - -SLOT="${OFED_VER}" - -# @ECLASS-VARIABLE: OFED_VERSIONS -# @DESCRIPTION: -# Defines array of ofed version supported by eclass - -OFED_VERSIONS=( - "3.5" - "3.12" - ) - -# @FUNCTION: block_other_ofed_versions -# @DESCRIPTION: -# function that creates blockers list for ofed -block_other_ofed_versions() { - local slot - RDEPEND="${RDEPEND} !sys-fabric/${PN}:0" - for slot in ${OFED_VERSIONS[@]}; do - if [[ ${slot} != ${SLOT} ]]; then - RDEPEND+=" !sys-fabric/${PN}:${slot}" - fi - done -} - -OFED_BASE_VER=$(get_version_component_range 1-3 ${OFED_VER}) - -if [ -z $OFED_RC ] ; then - SRC_URI="https://www.openfabrics.org/downloads/OFED/ofed-${OFED_BASE_VER}/OFED-${OFED_VER}.tgz" -else - SRC_URI="https://www.openfabrics.org/downloads/OFED/ofed-${OFED_BASE_VER}/OFED-${OFED_VER}-rc${OFED_RC_VER}.tgz" -fi - -case ${PN} in - ofed) - MY_PN="compat-rdma" - ;; - *) - MY_PN="${PN}" - ;; -esac - -case ${PV} in - *p*) - MY_PV="${PV/p/}" - ;; - *) - MY_PV="${PV}" - ;; -esac - -case ${MY_PN} in - ofa_kernel|compat-rdma) - EXT="tgz" - ;; - *) - EXT="tar.gz" - ;; -esac - -if [ -z ${OFED_SRC_SNAPSHOT} ]; then - S="${WORKDIR}/${MY_PN}-${MY_PV}" -else - S="${WORKDIR}/${MY_PN}-${MY_PV}-${OFED_SUFFIX}" -fi - - -# @FUNCTION: openib_src_unpack -# @DESCRIPTION: -# This function will unpack OFED packages -openib_src_unpack() { - unpack ${A} - if [ -z ${OFED_RC} ]; then - case ${PN} in - ofed) - rpm_unpack "./OFED-${OFED_VER}/SRPMS/${MY_PN}-${OFED_VER}-${OFED_SUFFIX}.src.rpm" - ;; - *) - rpm_unpack "./OFED-${OFED_VER}/SRPMS/${MY_PN}-${MY_PV}-${OFED_SUFFIX}.src.rpm" - ;; - esac - else - case ${PN} in - ofed) - rpm_unpack "./OFED-${OFED_VER}-rc${OFED_RC_VER}/SRPMS/${MY_PN}-${OFED_VER}-${OFED_SUFFIX}.src.rpm" - ;; - *) - rpm_unpack "./OFED-${OFED_VER}-rc${OFED_RC_VER}/SRPMS/${MY_PN}-${MY_PV}-${OFED_SUFFIX}.src.rpm" - ;; - esac - fi - if [ -z ${OFED_SNAPSHOT} ]; then - case ${PN} in - ofed) - unpack ./${MY_PN}-${OFED_VER}.${EXT} - ;; - *) - unpack ./${MY_PN}-${MY_PV}.${EXT} - ;; - esac - else - case ${PN} in - ofed) - unpack ./${MY_PN}-${OFED_VER}-${OFED_SUFFIX}.${EXT} - ;; - *) - unpack ./${MY_PN}-${MY_PV}-${OFED_SUFFIX}.${EXT} - ;; - esac - fi -} - -fi diff --git a/eclass/postgres.eclass b/eclass/postgres.eclass index 0d7a1aa50f39..cd9f90fc1c31 100644 --- a/eclass/postgres.eclass +++ b/eclass/postgres.eclass @@ -1,7 +1,6 @@ # Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -inherit user EXPORT_FUNCTIONS pkg_setup # @ECLASS: postgres.eclass @@ -119,32 +118,6 @@ postgres_check_slot() { fi } -# @FUNCTION: postgres_new_user -# @USAGE: [user [(uid|-1) [(shell|-1) [(homedir|-1) [groups]]]]] -# @DESCRIPTION: -# Creates the "postgres" system group and user -- which is separate from -# the database user -- and, optionally, the developer defined user. There -# are no required parameters. -# -# When given a user to create, it'll be created with the next available -# uid, default shell set to /bin/false, default homedir is /dev/null, -# and added to the "postgres" system group. You can use "-1" to skip any -# parameter except user or groups. -postgres_new_user() { - enewgroup postgres 70 - enewuser postgres 70 /bin/bash /var/lib/postgresql postgres - - if [[ $# -gt 0 ]] ; then - if [[ "$1" = "postgres" ]] ; then - ewarn "Username 'postgres' implied, skipping" - else - local groups=$5 - [[ -n "${groups}" ]] && groups+=",postgres" || groups="postgres" - enewuser "$1" "${2:--1}" "${3:--1}" "${4:--1}" "${groups}" - fi - fi -} - # @FUNCTION: postgres_pkg_setup # @DESCRIPTION: # Initialize environment variable(s) according to the best diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass index 282c449f2a03..805981bb7aa8 100644 --- a/eclass/python-any-r1.eclass +++ b/eclass/python-any-r1.eclass @@ -271,44 +271,6 @@ python_gen_any_dep() { echo "|| ( ${out})" } -# @FUNCTION: _python_EPYTHON_supported -# @USAGE: <epython> -# @INTERNAL -# @DESCRIPTION: -# Check whether the specified implementation is supported by package -# (specified in PYTHON_COMPAT). Calls python_check_deps() if declared. -_python_EPYTHON_supported() { - debug-print-function ${FUNCNAME} "${@}" - - local EPYTHON=${1} - local i=${EPYTHON/./_} - - case "${i}" in - python*|jython*|pypy*) - ;; - *) - ewarn "Invalid EPYTHON: ${EPYTHON}" - return 1 - ;; - esac - - if has "${i}" "${_PYTHON_SUPPORTED_IMPLS[@]}"; then - if python_is_installed "${i}"; then - if declare -f python_check_deps >/dev/null; then - local PYTHON_USEDEP="python_targets_${i}(-)" - local PYTHON_SINGLE_USEDEP="python_single_target_${i}(-)" - python_check_deps - return ${?} - fi - - return 0 - fi - elif ! has "${i}" "${_PYTHON_ALL_IMPLS[@]}"; then - ewarn "Invalid EPYTHON: ${EPYTHON}" - fi - return 1 -} - # @FUNCTION: python_setup # @DESCRIPTION: # Determine what the best installed (and supported) Python @@ -332,27 +294,37 @@ python_setup() { _python_export "${impls[0]}" EPYTHON PYTHON _python_wrapper_setup - einfo "Using ${EPYTHON} to build" + einfo "Using ${EPYTHON} to build (via PYTHON_COMPAT_OVERRIDE)" return fi # first, try ${EPYTHON}... maybe it's good enough for us. - if [[ ${EPYTHON} ]]; then - if _python_EPYTHON_supported "${EPYTHON}"; then + local epython_impl=${EPYTHON/./_} + if [[ ${epython_impl} ]]; then + if ! has "${epython_impl}" "${_PYTHON_SUPPORTED_IMPLS[@]}"; then + if ! has "${epython_impl}" "${_PYTHON_ALL_IMPLS[@]}"; then + ewarn "Invalid EPYTHON: ${EPYTHON}" + else + einfo "EPYTHON (${EPYTHON}) not supported by the package" + fi + elif _python_run_check_deps "${epython_impl}"; then _python_export EPYTHON PYTHON _python_wrapper_setup - einfo "Using ${EPYTHON} to build" + einfo "Using ${EPYTHON} to build (via EPYTHON)" return fi fi - # fallback to best installed impl. + # fallback to the best installed impl. # (reverse iteration over _PYTHON_SUPPORTED_IMPLS) for (( i = ${#_PYTHON_SUPPORTED_IMPLS[@]} - 1; i >= 0; i-- )); do - _python_export "${_PYTHON_SUPPORTED_IMPLS[i]}" EPYTHON PYTHON - if _python_EPYTHON_supported "${EPYTHON}"; then + local impl=${_PYTHON_SUPPORTED_IMPLS[i]} + # avoid checking EPYTHON twice + [[ ${impl} == ${epython_impl} ]] && continue + _python_export "${impl}" EPYTHON PYTHON + if _python_run_check_deps "${impl}"; then _python_wrapper_setup - einfo "Using ${EPYTHON} to build" + einfo "Using ${EPYTHON} to build (via PYTHON_COMPAT iteration)" return fi done diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass index 40ad4ef4bbf8..bf2fd62fdcba 100644 --- a/eclass/python-r1.eclass +++ b/eclass/python-r1.eclass @@ -289,13 +289,7 @@ _python_validate_useflags() { # are both in PYTHON_COMPAT and match any of the patterns passed # as parameters to the function. # -# The patterns are fnmatch-style patterns (matched via bash -# == operator against PYTHON_COMPAT values). Remember to escape -# or quote the fnmatch patterns to prevent accidental shell filename -# expansion. -# -# This is an internal function used to implement python_gen_cond_dep -# and deprecated python_gen_usedep. +# This is an internal function used to implement python_gen_cond_dep. _python_gen_usedep() { debug-print-function ${FUNCNAME} "${@}" @@ -316,46 +310,6 @@ _python_gen_usedep() { echo "${out// /,}" } -# @FUNCTION: python_gen_usedep -# @USAGE: <pattern> [...] -# @DESCRIPTION: -# DEPRECATED. Please use python_gen_cond_dep instead. -# -# Output a USE dependency string for Python implementations which -# are both in PYTHON_COMPAT and match any of the patterns passed -# as parameters to the function. -# -# The patterns are fnmatch-style patterns (matched via bash -# == operator against PYTHON_COMPAT values). Remember to escape -# or quote the fnmatch patterns to prevent accidental shell filename -# expansion. -# -# When all implementations are requested, please use ${PYTHON_USEDEP} -# instead. Please also remember to set an appropriate REQUIRED_USE -# to avoid ineffective USE flags. -# -# Example: -# @CODE -# PYTHON_COMPAT=( python{2_7,3_4} ) -# BDEPEND="doc? ( dev-python/epydoc[$(python_gen_usedep 'python2*')] )" -# @CODE -# -# It will cause the dependency to look like: -# @CODE -# BDEPEND="doc? ( dev-python/epydoc[python_targets_python2_7?] )" -# @CODE -python_gen_usedep() { - debug-print-function ${FUNCNAME} "${@}" - - # output only once, during some reasonable phase - # (avoid spamming cache regen runs) - if [[ ${EBUILD_PHASE} == setup ]]; then - eqawarn "python_gen_usedep() is deprecated. Please use python_gen_cond_dep instead." - fi - [[ ${EAPI} == [67] ]] || die "${FUNCNAME} banned in EAPI ${EAPI}" - _python_gen_usedep "${@}" -} - # @FUNCTION: python_gen_useflags # @USAGE: [<pattern>...] # @DESCRIPTION: @@ -363,10 +317,8 @@ python_gen_usedep() { # are both in PYTHON_COMPAT and match any of the patterns passed # as parameters to the function. # -# The patterns are fnmatch-style patterns (matched via bash -# == operator against PYTHON_COMPAT values). Remember to escape -# or quote the fnmatch patterns to prevent accidental shell filename -# expansion. +# For the pattern syntax, please see _python_impl_matches +# in python-utils-r1.eclass. # # Example: # @CODE @@ -400,10 +352,8 @@ python_gen_useflags() { # of Python implementations which are both in PYTHON_COMPAT and match # any of the patterns passed as the remaining parameters. # -# The patterns are fnmatch-style patterns (matched via bash -# == operator against PYTHON_COMPAT values). Remember to escape -# or quote the fnmatch patterns to prevent accidental shell filename -# expansion. +# For the pattern syntax, please see _python_impl_matches +# in python-utils-r1.eclass. # # In order to enforce USE constraints on the packages, verbatim # '${PYTHON_USEDEP}' (quoted!) may be placed in the dependency @@ -434,9 +384,15 @@ python_gen_cond_dep() { _python_verify_patterns "${@}" for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do if _python_impl_matches "${impl}" "${@}"; then - # substitute ${PYTHON_USEDEP} if used - # (since python_gen_usedep() will not return ${PYTHON_USEDEP} - # the code is run at most once) + # substitute ${PYTHON_USEDEP} with USE-dep on *all* matching + # targets, if it is used. this ensures that Portage will + # report all missing USE flags simultaneously rather than + # requesting the user to enable them one by one. + # + # NB: the first call with replace all instances + # of ${PYTHON_USEDEP}, so the condition will be false + # on subsequent loop iterations and _python_gen_usedep() + # will run at most once. if [[ ${dep} == *'${PYTHON_USEDEP}'* ]]; then local usedep=$(_python_gen_usedep "${@}") dep=${dep//\$\{PYTHON_USEDEP\}/${usedep}} @@ -458,10 +414,8 @@ python_gen_cond_dep() { # patterns are passed, the output dependencies will be generated only # for the implementations matching them. # -# The patterns are fnmatch-style patterns (matched via bash -# == operator against PYTHON_COMPAT values). Remember to escape -# or quote the fnmatch patterns to prevent accidental shell filename -# expansion. +# For the pattern syntax, please see _python_impl_matches +# in python-utils-r1.eclass. # # Use this function when you need to request different USE flags # on the Python interpreter depending on package's USE flags. If you @@ -514,10 +468,8 @@ python_gen_impl_dep() { # # Optionally, patterns may be specified to restrict the dependency to # a subset of Python implementations supported by the ebuild. -# The patterns are fnmatch-style patterns (matched via bash -# == operator against PYTHON_COMPAT values). Remember to escape -# or quote the fnmatch patterns to prevent accidental shell filename -# expansion. +# For the pattern syntax, please see _python_impl_matches +# in python-utils-r1.eclass. # # This should be used along with an appropriate python_check_deps() # that checks which of the any-of blocks were matched, and python_setup @@ -704,10 +656,8 @@ python_foreach_impl() { # The python_check_deps() function in the any-of mode needs to be # accompanied by appropriate any-of dependencies. # -# The patterns are fnmatch-style patterns (matched via bash -# == operator against PYTHON_COMPAT values). Remember to escape -# or quote the fnmatch patterns to prevent accidental shell filename -# expansion. +# For the pattern syntax, please see _python_impl_matches +# in python-utils-r1.eclass. # # This function needs to be used when Python is being called outside # of python_foreach_impl calls (e.g. for shared processes like doc @@ -781,12 +731,7 @@ python_setup() { # if python_check_deps() is declared, switch into any-of mode if [[ ${has_check_deps} ]]; then - # first check if the interpreter is installed - python_is_installed "${impl}" || continue - # then run python_check_deps - local PYTHON_USEDEP="python_targets_${impl}(-)" - local PYTHON_SINGLE_USEDEP="python_single_target_${impl}(-)" - python_check_deps || continue + _python_run_check_deps "${impl}" || continue fi found=1 diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass index 574ee9cfc04e..998e6faad841 100644 --- a/eclass/python-single-r1.eclass +++ b/eclass/python-single-r1.eclass @@ -259,40 +259,6 @@ unset -f _python_single_set_globals if [[ ! ${_PYTHON_SINGLE_R1} ]]; then -# @FUNCTION: _python_gen_usedep -# @USAGE: [<pattern>...] -# @INTERNAL -# @DESCRIPTION: -# Output a USE dependency string for Python implementations which -# are both in PYTHON_COMPAT and match any of the patterns passed -# as parameters to the function. -# -# The patterns are fnmatch-style patterns (matched via bash -# == operator against PYTHON_COMPAT values). Remember to escape -# or quote the fnmatch patterns to prevent accidental shell filename -# expansion. -# -# This is an internal function used to implement python_gen_cond_dep. -_python_gen_usedep() { - debug-print-function ${FUNCNAME} "${@}" - - local impl matches=() - - _python_verify_patterns "${@}" - for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do - if _python_impl_matches "${impl}" "${@}"; then - matches+=( - "python_single_target_${impl}(-)?" - ) - fi - done - - [[ ${matches[@]} ]] || die "No supported implementations match python_gen_usedep patterns: ${@}" - - local out=${matches[@]} - echo "${out// /,}" -} - # @FUNCTION: python_gen_useflags # @USAGE: [<pattern>...] # @DESCRIPTION: @@ -300,10 +266,8 @@ _python_gen_usedep() { # are both in PYTHON_COMPAT and match any of the patterns passed # as parameters to the function. # -# The patterns are fnmatch-style patterns (matched via bash -# == operator against PYTHON_COMPAT values). Remember to escape -# or quote the fnmatch patterns to prevent accidental shell filename -# expansion. +# For the pattern syntax, please see _python_impl_matches +# in python-utils-r1.eclass. # # Example: # @CODE @@ -337,10 +301,8 @@ python_gen_useflags() { # of Python implementations which are both in PYTHON_COMPAT and match # any of the patterns passed as the remaining parameters. # -# The patterns are fnmatch-style patterns (matched via bash -# == operator against PYTHON_COMPAT values). Remember to escape -# or quote the fnmatch patterns to prevent accidental shell filename -# expansion. +# For the pattern syntax, please see _python_impl_matches +# in python-utils-r1.eclass. # # In order to enforce USE constraints on the packages, verbatim # '${PYTHON_SINGLE_USEDEP}' and '${PYTHON_USEDEP}' (quoted!) may @@ -372,22 +334,10 @@ python_gen_cond_dep() { _python_verify_patterns "${@}" for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do if _python_impl_matches "${impl}" "${@}"; then - # substitute ${PYTHON_SINGLE_USEDEP} if used - # (since python_gen_usedep() will not return - # ${PYTHON_SINGLE_USEDEP}, the code is run at most once) - if [[ ${dep} == *'${PYTHON_SINGLE_USEDEP}'* ]]; then - local usedep=$(_python_gen_usedep "${@}") - dep=${dep//\$\{PYTHON_SINGLE_USEDEP\}/${usedep}} - fi + local single_usedep="python_single_target_${impl}(-)" local multi_usedep="python_targets_${impl}(-)" - if [[ ${EAPI} != [67] ]]; then - if [[ ${dep} == *\$\{PYTHON_MULTI_USEDEP\}* ]]; then - die "Replace PYTHON_MULTI_USEDEP with PYTHON_USEDEP in EAPI ${EAPI}" - fi - fi - - local subdep=${dep//\$\{PYTHON_MULTI_USEDEP\}/${multi_usedep}} + local subdep=${dep//\$\{PYTHON_SINGLE_USEDEP\}/${single_usedep}} matches+=( "python_single_target_${impl}? ( ${subdep//\$\{PYTHON_USEDEP\}/${multi_usedep}} )" ) fi @@ -405,10 +355,8 @@ python_gen_cond_dep() { # patterns are passed, the output dependencies will be generated only # for the implementations matching them. # -# The patterns are fnmatch-style patterns (matched via bash -# == operator against PYTHON_COMPAT values). Remember to escape -# or quote the fnmatch patterns to prevent accidental shell filename -# expansion. +# For the pattern syntax, please see _python_impl_matches +# in python-utils-r1.eclass. # # Use this function when you need to request different USE flags # on the Python interpreter depending on package's USE flags. If you diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index c8367f8065f4..5f8c49298090 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -82,7 +82,11 @@ _python_verify_patterns() { local impl pattern for pattern; do - [[ ${pattern} == -[23] ]] && continue + case ${pattern} in + -[23]|3.[89]|3.10) + continue + ;; + esac for impl in "${_PYTHON_ALL_IMPLS[@]}" "${_PYTHON_HISTORICAL_IMPLS[@]}" do @@ -119,6 +123,8 @@ _python_set_impls() { if [[ $(declare -p PYTHON_COMPAT) != "declare -a"* ]]; then die 'PYTHON_COMPAT must be an array.' fi + + local obsolete=() if [[ ! ${PYTHON_COMPAT_NO_STRICT} ]]; then for i in "${PYTHON_COMPAT[@]}"; do # check for incorrect implementations @@ -126,7 +132,10 @@ _python_set_impls() { # please keep them in sync with _PYTHON_ALL_IMPLS # and _PYTHON_HISTORICAL_IMPLS case ${i} in - jython2_7|pypy|pypy1_[89]|pypy2_0|pypy3|python2_[5-7]|python3_[1-9]|python3_10) + pypy3|python2_7|python3_[89]|python3_10) + ;; + jython2_7|pypy|pypy1_[89]|pypy2_0|python2_[5-6]|python3_[1-7]) + obsolete+=( "${i}" ) ;; *) if has "${i}" "${_PYTHON_ALL_IMPLS[@]}" \ @@ -140,6 +149,17 @@ _python_set_impls() { done fi + if [[ -n ${obsolete[@]} && ${EBUILD_PHASE} == setup ]]; then + # complain if people don't clean up old impls while touching + # the ebuilds recently. use the copyright year to infer last + # modification + # NB: this check doesn't have to work reliably + if [[ $(head -n 1 "${EBUILD}" 2>/dev/null) == *2022* ]]; then + eqawarn "Please clean PYTHON_COMPAT of obsolete implementations:" + eqawarn " ${obsolete[*]}" + fi + fi + local supp=() unsupp=() for i in "${_PYTHON_ALL_IMPLS[@]}"; do @@ -190,12 +210,14 @@ _python_set_impls() { # Matches if no patterns are provided. # # <impl> can be in PYTHON_COMPAT or EPYTHON form. The patterns -# are fnmatch-style. +# can either be fnmatch-style or stdlib versions, e.g. "3.8", "3.9". +# In the latter case, pypy3 will match if there is at least one pypy3 +# version matching the stdlib version. _python_impl_matches() { [[ ${#} -ge 1 ]] || die "${FUNCNAME}: takes at least 1 parameter" [[ ${#} -eq 1 ]] && return 0 - local impl=${1} pattern + local impl=${1/./_} pattern shift for pattern; do @@ -218,9 +240,17 @@ _python_impl_matches() { fi return 0 ;; + 3.8) + # the only unmasked pypy3 version is pypy3.8 atm + [[ ${impl} == python${pattern/./_} || ${impl} == pypy3 ]] && + return 0 + ;; + 3.9|3.10) + [[ ${impl} == python${pattern/./_} ]] && return 0 + ;; *) # unify value style to allow lax matching - [[ ${impl/./_} == ${pattern/./_} ]] && return 0 + [[ ${impl} == ${pattern/./_} ]] && return 0 ;; esac done @@ -266,23 +296,6 @@ _python_impl_matches() { # python2.7 # @CODE -# @FUNCTION: python_export -# @USAGE: [<impl>] <variables>... -# @INTERNAL -# @DESCRIPTION: -# Backwards compatibility function. The relevant API is now considered -# private, please use python_get* instead. -python_export() { - debug-print-function ${FUNCNAME} "${@}" - - 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 "${@}" -} - # @FUNCTION: _python_export # @USAGE: [<impl>] <variables>... # @INTERNAL @@ -333,13 +346,23 @@ _python_export() { ;; PYTHON_SITEDIR) [[ -n ${PYTHON} ]] || die "PYTHON needs to be set for ${var} to be exported, or requested before it" - PYTHON_SITEDIR=$("${PYTHON}" -c 'import sysconfig; print(sysconfig.get_path("purelib"))') || die + PYTHON_SITEDIR=$( + "${PYTHON}" - <<-EOF || die + import sysconfig + print(sysconfig.get_path("purelib")) + EOF + ) export PYTHON_SITEDIR debug-print "${FUNCNAME}: PYTHON_SITEDIR = ${PYTHON_SITEDIR}" ;; PYTHON_INCLUDEDIR) [[ -n ${PYTHON} ]] || die "PYTHON needs to be set for ${var} to be exported, or requested before it" - PYTHON_INCLUDEDIR=$("${PYTHON}" -c 'import sysconfig; print(sysconfig.get_path("platinclude"))') || die + PYTHON_INCLUDEDIR=$( + "${PYTHON}" - <<-EOF || die + import sysconfig + print(sysconfig.get_path("platinclude")) + EOF + ) export PYTHON_INCLUDEDIR debug-print "${FUNCNAME}: PYTHON_INCLUDEDIR = ${PYTHON_INCLUDEDIR}" @@ -350,7 +373,17 @@ _python_export() { ;; PYTHON_LIBPATH) [[ -n ${PYTHON} ]] || die "PYTHON needs to be set for ${var} to be exported, or requested before it" - PYTHON_LIBPATH=$("${PYTHON}" -c 'import os.path, sysconfig; print(os.path.join(sysconfig.get_config_var("LIBDIR"), sysconfig.get_config_var("LDLIBRARY")) if sysconfig.get_config_var("LDLIBRARY") else "")') || die + PYTHON_LIBPATH=$( + "${PYTHON}" - <<-EOF || die + import os.path, sysconfig + print( + os.path.join( + sysconfig.get_config_var("LIBDIR"), + sysconfig.get_config_var("LDLIBRARY")) + if sysconfig.get_config_var("LDLIBRARY") + else "") + EOF + ) export PYTHON_LIBPATH debug-print "${FUNCNAME}: PYTHON_LIBPATH = ${PYTHON_LIBPATH}" @@ -400,7 +433,13 @@ _python_export() { case "${impl}" in python*) [[ -n ${PYTHON} ]] || die "PYTHON needs to be set for ${var} to be exported, or requested before it" - flags=$("${PYTHON}" -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS") or "")') || die + flags=$( + "${PYTHON}" - <<-EOF || die + import sysconfig + print(sysconfig.get_config_var("ABIFLAGS") + or "") + EOF + ) val=${PYTHON}${flags}-config ;; *) @@ -564,15 +603,6 @@ python_get_scriptdir() { python_optimize() { debug-print-function ${FUNCNAME} "${@}" - if [[ ${EBUILD_PHASE} == pre* || ${EBUILD_PHASE} == post* ]]; then - eerror "The new Python eclasses expect the compiled Python files to" - eerror "be controlled by the Package Manager. For this reason," - eerror "the python_optimize function can be used only during src_* phases" - eerror "(src_install most commonly) and not during pkg_* phases." - echo - die "python_optimize is not to be used in pre/post* phases" - fi - [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).' local PYTHON=${PYTHON} @@ -591,7 +621,12 @@ python_optimize() { if [[ ${f} == /* && -d ${D%/}${f} ]]; then set -- "${D%/}${f}" "${@}" fi - done < <("${PYTHON}" -c 'import sys; print("".join(x + "\0" for x in sys.path))' || die) + done < <( + "${PYTHON}" - <<-EOF || die + import sys + print("".join(x + "\0" for x in sys.path)) + EOF + ) debug-print "${FUNCNAME}: using sys.path: ${*/%/;}" fi @@ -605,6 +640,7 @@ python_optimize() { local instpath=${d#${D%/}} instpath=/${instpath##/} + einfo "Optimize Python modules for ${instpath}" case "${EPYTHON}" in python2.7|python3.[34]) "${PYTHON}" -m compileall -q -f -d "${instpath}" "${d}" @@ -855,22 +891,6 @@ python_doheader() { ) } -# @FUNCTION: python_wrapper_setup -# @USAGE: [<path> [<impl>]] -# @DESCRIPTION: -# Backwards compatibility function. The relevant API is now considered -# private, please use python_setup instead. -python_wrapper_setup() { - debug-print-function ${FUNCNAME} "${@}" - - 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 "${@}" -} - # @FUNCTION: _python_wrapper_setup # @USAGE: [<path> [<impl>]] # @INTERNAL @@ -978,41 +998,6 @@ _python_wrapper_setup() { export PATH PKG_CONFIG_PATH } -# @FUNCTION: python_is_python3 -# @USAGE: [<impl>] -# @DESCRIPTION: -# Check whether <impl> (or ${EPYTHON}) is a Python3k variant -# (i.e. uses syntax and stdlib of Python 3.*). -# -# 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" - - [[ ${impl} == python3* || ${impl} == pypy3 ]] -} - -# @FUNCTION: python_is_installed -# @USAGE: [<impl>] -# @DESCRIPTION: -# Check whether the interpreter for <impl> (or ${EPYTHON}) is installed. -# Uses has_version with a proper dependency string. -# -# Returns 0 (true) if it is, 1 (false) otherwise. -python_is_installed() { - local impl=${1:-${EPYTHON}} - [[ ${impl} ]] || die "${FUNCNAME}: no impl nor EPYTHON" - local hasv_args=( -b ) - [[ ${EAPI} == 6 ]] && hasv_args=( --host-root ) - - local PYTHON_PKG_DEP - _python_export "${impl}" PYTHON_PKG_DEP - has_version "${hasv_args[@]}" "${PYTHON_PKG_DEP}" -} - # @FUNCTION: python_fix_shebang # @USAGE: [-f|--force] [-q|--quiet] <path>... # @DESCRIPTION: @@ -1193,7 +1178,7 @@ python_export_utf8_locale() { debug-print-function ${FUNCNAME} "${@}" # If the locale program isn't available, just return. - type locale >/dev/null || return 0 + type locale &>/dev/null || return 0 if [[ $(locale charmap) != UTF-8 ]]; then # Try English first, then everything else. @@ -1249,10 +1234,24 @@ build_sphinx() { sed -i -e 's:^intersphinx_mapping:disabled_&:' \ "${dir}"/conf.py || die - # not all packages include the Makefile in pypi tarball - "${EPYTHON}" -m sphinx.cmd.build \ - -b html -d "${dir}"/_build/doctrees "${dir}" \ - "${dir}"/_build/html || die + # 1. not all packages include the Makefile in pypi tarball, + # so we call sphinx-build directly + # 2. if autodoc is used, we need to call sphinx via EPYTHON, + # to ensure that PEP 517 venv is respected + # 3. if autodoc is not used, then sphinx might not be installed + # for the current impl, so we need a fallback to sphinx-build + local command=( "${EPYTHON}" -m sphinx.cmd.build ) + if ! "${EPYTHON}" -c "import sphinx.cmd.build" 2>/dev/null; then + command=( sphinx-build ) + fi + command+=( + -b html + -d "${dir}"/_build/doctrees + "${dir}" + "${dir}"/_build/html + ) + echo "${command[@]}" >&2 + "${command[@]}" || die HTML_DOCS+=( "${dir}/_build/html/." ) } @@ -1368,5 +1367,77 @@ eunittest() { return ${?} } +# @FUNCTION: _python_run_check_deps +# @INTERNAL +# @USAGE: <impl> +# @DESCRIPTION: +# Verify whether <impl> is an acceptable choice to run any-r1 style +# code. Checks whether the interpreter is installed, runs +# python_check_deps() if declared. +_python_run_check_deps() { + debug-print-function ${FUNCNAME} "${@}" + + local impl=${1} + local hasv_args=( -b ) + [[ ${EAPI} == 6 ]] && hasv_args=( --host-root ) + + einfo "Checking whether ${impl} is suitable ..." + + local PYTHON_PKG_DEP + _python_export "${impl}" PYTHON_PKG_DEP + ebegin " ${PYTHON_PKG_DEP}" + has_version "${hasv_args[@]}" "${PYTHON_PKG_DEP}" + eend ${?} || return 1 + declare -f python_check_deps >/dev/null || return 0 + + local PYTHON_USEDEP="python_targets_${impl}(-)" + local PYTHON_SINGLE_USEDEP="python_single_target_${impl}(-)" + ebegin " python_check_deps" + python_check_deps + eend ${?} +} + +# @FUNCTION: python_has_version +# @USAGE: [-b|-d|-r] <atom>... +# @DESCRIPTION: +# A convenience wrapper for has_version() with verbose output and better +# defaults for use in python_check_deps(). +# +# The wrapper accepts EAPI 7+-style -b/-d/-r options to indicate +# the root to perform the lookup on. Unlike has_version, the default +# is -b. In EAPI 6, -b and -d are translated to --host-root +# for compatibility. +# +# The wrapper accepts multiple package specifications. For the check +# to succeed, *all* specified atoms must match. +python_has_version() { + debug-print-function ${FUNCNAME} "${@}" + + local root_arg=( -b ) + case ${1} in + -b|-d|-r) + root_arg=( "${1}" ) + shift + ;; + esac + + if [[ ${EAPI} == 6 ]]; then + if [[ ${root_arg} == -r ]]; then + root_arg=() + else + root_arg=( --host-root ) + fi + fi + + local pkg + for pkg; do + ebegin " ${pkg}" + has_version "${root_arg[@]}" "${pkg}" + eend ${?} || return + done + + return 0 +} + _PYTHON_UTILS_R1=1 fi diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass index 3832165761c9..7e5a62aa5b57 100644 --- a/eclass/ruby-fakegem.eclass +++ b/eclass/ruby-fakegem.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: ruby-fakegem.eclass @@ -8,7 +8,7 @@ # Author: Diego E. Pettenò <flameeyes@gentoo.org> # Author: Alex Legler <a3li@gentoo.org> # Author: Hans de Graaff <graaff@gentoo.org> -# @SUPPORTED_EAPIS: 4 5 6 7 8 +# @SUPPORTED_EAPIS: 5 6 7 8 # @PROVIDES: ruby-ng # @BLURB: An eclass for installing Ruby packages to behave like RubyGems. # @DESCRIPTION: @@ -200,9 +200,7 @@ esac SRC_URI="https://rubygems.org/gems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}${RUBY_FAKEGEM_SUFFIX:+-${RUBY_FAKEGEM_SUFFIX}}.gem" -# dev-ruby/psych is no longer installed and is incompatible with modern -# ruby versions. -ruby_add_bdepend "virtual/rubygems !!dev-ruby/psych" +ruby_add_bdepend "virtual/rubygems" ruby_add_rdepend virtual/rubygems case ${EAPI} in 5|6) @@ -218,6 +216,8 @@ esac # This function returns the gems data directory for the ruby # implementation in question. ruby_fakegem_gemsdir() { + debug-print-function ${FUNCNAME} "${@}" + local _gemsitedir=$(ruby_rbconfig_value 'sitelibdir') _gemsitedir=${_gemsitedir//site_ruby/gems} _gemsitedir=${_gemsitedir#${EPREFIX}} @@ -235,6 +235,8 @@ ruby_fakegem_gemsdir() { # @DESCRIPTION: # Installs the specified file(s) into the gems directory. ruby_fakegem_doins() { + debug-print-function ${FUNCNAME} "${@}" + ( insinto $(ruby_fakegem_gemsdir)/gems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION} doins "$@" @@ -246,6 +248,8 @@ ruby_fakegem_doins() { # @DESCRIPTION: # Installs the specified file into the gems directory using the provided filename. ruby_fakegem_newins() { + debug-print-function ${FUNCNAME} "${@}" + ( # Since newins does not accept full paths but just basenames # for the target file, we want to extend it here. @@ -265,6 +269,8 @@ ruby_fakegem_newins() { # by the RUBY_FAKEGEM_GEMSPEC variable, or generate one using # ruby_fakegem_genspec. ruby_fakegem_install_gemspec() { + debug-print-function ${FUNCNAME} "${@}" + local gemspec="${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation} ( @@ -292,6 +298,8 @@ ruby_fakegem_install_gemspec() { # RUBY_FAKEGEM_GEMSPEC. This file is eval'ed to produce a final specification # in a way similar to packaging the gemspec file. ruby_fakegem_gemspec_gemspec() { + debug-print-function ${FUNCNAME} "${@}" + ${RUBY} --disable=did_you_mean -e "puts eval(File::open('$1').read).to_ruby" > $2 } @@ -302,6 +310,8 @@ ruby_fakegem_gemspec_gemspec() { # the metadata distributed by the gem itself. This is similar to how # rubygems creates an installation from a .gem file. ruby_fakegem_metadata_gemspec() { + debug-print-function ${FUNCNAME} "${@}" + ${RUBY} --disable=did_you_mean -r yaml -e "puts Gem::Specification.from_yaml(File::open('$1', :encoding => 'UTF-8').read).to_ruby" > $2 } @@ -319,6 +329,8 @@ ruby_fakegem_metadata_gemspec() { # See RUBY_FAKEGEM_NAME and RUBY_FAKEGEM_VERSION for setting name and version. # See RUBY_FAKEGEM_REQUIRE_PATHS for setting extra require paths. ruby_fakegem_genspec() { + debug-print-function ${FUNCNAME} "${@}" + case ${EAPI} in 5|6) ;; *) @@ -358,6 +370,8 @@ EOF # to inject additional ruby code into the wrapper. This may be useful to # e.g. force a specific version using the gem command. ruby_fakegem_binwrapper() { + debug-print-function ${FUNCNAME} "${@}" + ( local gembinary=$1 local newbinary=${2:-/usr/bin/$gembinary} @@ -409,6 +423,8 @@ EOF # @DESCRIPTION: # Configure extensions defined in RUBY_FAKEGEM_EXTENSIONS, if any. each_fakegem_configure() { + debug-print-function ${FUNCNAME} "${@}" + tc-export PKG_CONFIG for extension in "${RUBY_FAKEGEM_EXTENSIONS[@]}" ; do CC=$(tc-getCC) ${RUBY} --disable=did_you_mean -C ${extension%/*} ${extension##*/} --with-cflags="${CFLAGS}" --with-ldflags="${LDFLAGS}" ${RUBY_FAKEGM_EXTENSION_OPTIONS} || die @@ -419,6 +435,8 @@ each_fakegem_configure() { # @DESCRIPTION: # Run each_fakegem_configure for each ruby target each_ruby_configure() { + debug-print-function ${FUNCNAME} "${@}" + each_fakegem_configure } @@ -427,6 +445,8 @@ each_ruby_configure() { # Build documentation for the package if indicated by the doc USE flag # and if there is a documetation task defined. all_fakegem_compile() { + debug-print-function ${FUNCNAME} "${@}" + if [[ -n ${RUBY_FAKEGEM_DOCDIR} ]] && use doc; then case ${RUBY_FAKEGEM_RECIPE_DOC} in rake) @@ -447,6 +467,8 @@ all_fakegem_compile() { # @DESCRIPTION: # Compile extensions defined in RUBY_FAKEGEM_EXTENSIONS, if any. each_fakegem_compile() { + debug-print-function ${FUNCNAME} "${@}" + for extension in "${RUBY_FAKEGEM_EXTENSIONS[@]}" ; do emake V=1 -C ${extension%/*} mkdir -p "${RUBY_FAKEGEM_EXTENSION_LIBDIR%/}" @@ -458,6 +480,8 @@ each_fakegem_compile() { # @DESCRIPTION: # Run each_fakegem_compile for each ruby target each_ruby_compile() { + debug-print-function ${FUNCNAME} "${@}" + each_fakegem_compile } @@ -465,6 +489,8 @@ each_ruby_compile() { # @DESCRIPTION: # Unpack the source archive, including support for unpacking gems. all_ruby_unpack() { + debug-print-function ${FUNCNAME} "${@}" + # Special support for extracting .gem files; the file need to be # extracted twice and the mtime from the archive _has_ to be # ignored (it's always set to epoch 0). @@ -511,6 +537,8 @@ all_ruby_unpack() { # @DESCRIPTION: # Compile the package. all_ruby_compile() { + debug-print-function ${FUNCNAME} "${@}" + all_fakegem_compile } @@ -518,6 +546,8 @@ all_ruby_compile() { # @DESCRIPTION: # Run tests for the package for each ruby target if the test task is defined. each_fakegem_test() { + debug-print-function ${FUNCNAME} "${@}" + case ${RUBY_FAKEGEM_RECIPE_TEST} in rake) ${RUBY} --disable=did_you_mean -S rake ${RUBY_FAKEGEM_TASK_TEST} || die "tests failed" @@ -552,6 +582,8 @@ fi # installed. This is normally done as part of the extension # installation, but may be useful when we handle extensions manually. ruby_fakegem_extensions_installed() { + debug-print-function ${FUNCNAME} "${@}" + mkdir -p "${ED}$(ruby_fakegem_extensionsdir)" || die touch "${ED}$(ruby_fakegem_extensionsdir)/gem.build_complete" || die } @@ -561,13 +593,20 @@ ruby_fakegem_extensions_installed() { # The directory where rubygems expects extensions for this package # version. ruby_fakegem_extensionsdir() { - echo "$(ruby_fakegem_gemsdir)/extensions/$(ruby_rbconfig_value 'arch')/$(ruby_rbconfig_value 'ruby_version')/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}" + debug-print-function ${FUNCNAME} "${@}" + + # Using formula from ruby src/lib/rubygems/basic_specification. + extensions_dir=$(${RUBY} --disable=did_you_mean -e "puts File.join('extensions', Gem::Platform.local.to_s, Gem.extension_api_version)") + + echo "$(ruby_fakegem_gemsdir)/${extensions_dir}/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}" } # @FUNCTION: each_fakegem_install # @DESCRIPTION: # Install the package for each ruby target. each_fakegem_install() { + debug-print-function ${FUNCNAME} "${@}" + ruby_fakegem_install_gemspec local _gemlibdirs="${RUBY_FAKEGEM_EXTRAINSTALL}" @@ -593,6 +632,8 @@ each_fakegem_install() { # @DESCRIPTION: # Install the package for each target. each_ruby_install() { + debug-print-function ${FUNCNAME} "${@}" + each_fakegem_install } @@ -600,6 +641,8 @@ each_ruby_install() { # @DESCRIPTION: # Install files common to all ruby targets. all_fakegem_install() { + debug-print-function ${FUNCNAME} "${@}" + if [[ -n ${RUBY_FAKEGEM_DOCDIR} ]] && use doc; then for dir in ${RUBY_FAKEGEM_DOCDIR}; do [[ -d ${dir} ]] || continue @@ -633,5 +676,7 @@ all_fakegem_install() { # @DESCRIPTION: # Install files common to all ruby targets. all_ruby_install() { + debug-print-function ${FUNCNAME} "${@}" + all_fakegem_install } diff --git a/eclass/ruby-ng-gnome2.eclass b/eclass/ruby-ng-gnome2.eclass index cc475b36b731..732cf9c96b3a 100644 --- a/eclass/ruby-ng-gnome2.eclass +++ b/eclass/ruby-ng-gnome2.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: ruby-ng-gnome2.eclass @@ -82,6 +82,8 @@ all_ruby_prepare() { # @DESCRIPTION: # Run the configure script in the subbinding for each specific ruby target. each_ruby_configure() { + debug-print-function ${FUNCNAME} "${@}" + [[ -e extconf.rb ]] || return ${RUBY} extconf.rb || die "extconf.rb failed" @@ -91,6 +93,8 @@ each_ruby_configure() { # @DESCRIPTION: # Compile the C bindings in the subbinding for each specific ruby target. each_ruby_compile() { + debug-print-function ${FUNCNAME} "${@}" + [[ -e Makefile ]] || return # We have injected --no-undefined in Ruby as a safety precaution @@ -109,6 +113,8 @@ each_ruby_compile() { # @DESCRIPTION: # Install the files in the subbinding for each specific ruby target. each_ruby_install() { + debug-print-function ${FUNCNAME} "${@}" + if [[ -e Makefile ]]; then # Create the directories, or the package will create them as files. local archdir=$(ruby_rbconfig_value "sitearchdir") @@ -124,6 +130,8 @@ each_ruby_install() { # @DESCRIPTION: # Install the files common to all ruby targets. all_ruby_install() { + debug-print-function ${FUNCNAME} "${@}" + for doc in ../AUTHORS ../NEWS ChangeLog README; do [[ -s ${doc} ]] && dodoc $doc done @@ -139,6 +147,8 @@ all_ruby_install() { # @DESCRIPTION: # Run the tests for this package. each_ruby_test() { + debug-print-function ${FUNCNAME} "${@}" + [[ -e test/run-test.rb ]] || return if [[ ${RUBY_GNOME2_NEED_VIRTX} == yes ]]; then diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass index 90da695a04c2..8e7c7f76290b 100644 --- a/eclass/ruby-ng.eclass +++ b/eclass/ruby-ng.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: ruby-ng.eclass @@ -102,6 +102,8 @@ esac # Set `comparator' and `version' to include a comparator (=, >=, etc.) and a # version string to the returned string ruby_implementation_depend() { + debug-print-function ${FUNCNAME} "${@}" + _ruby_implementation_depend $1 } @@ -132,6 +134,8 @@ _ruby_get_all_impls() { # ruby_add_bdepend(), but may also be useful in an ebuild to specify # more complex dependencies. ruby_samelib() { + debug-print-function ${FUNCNAME} "${@}" + local res= for _ruby_implementation in $(_ruby_get_all_impls); do has -${_ruby_implementation} $@ || \ @@ -164,6 +168,8 @@ _ruby_atoms_samelib_generic() { # Not all implementations have the same command basename as the # target; This function translate between the two ruby_implementation_command() { + debug-print-function ${FUNCNAME} "${@}" + local _ruby_name=$1 # Add all USE_RUBY values where the flag name diverts from the binary here @@ -203,6 +209,8 @@ _ruby_wrap_conditions() { # Note: runtime dependencies are also added as build-time test # dependencies. ruby_add_rdepend() { + debug-print-function ${FUNCNAME} "${@}" + case $# in 1) ;; 2) @@ -248,6 +256,8 @@ ruby_add_rdepend() { # dependencies instead of setting DEPEND or BDEPEND yourself. The list # of atoms uses the same syntax as normal dependencies. ruby_add_bdepend() { + debug-print-function ${FUNCNAME} "${@}" + case $# in 1) ;; 2) @@ -282,6 +292,8 @@ ruby_add_bdepend() { # Adds the specified dependencies to DEPEND in EAPI7, similar to # ruby_add_bdepend. ruby_add_depend() { + debug-print-function ${FUNCNAME} "${@}" + case ${EAPI} in 5|6) die "only available in EAPI 7 and newer" ;; *) ;; @@ -301,6 +313,8 @@ ruby_add_depend() { # @DESCRIPTION: # Gets an array of ruby use targets enabled by the user ruby_get_use_implementations() { + debug-print-function ${FUNCNAME} "${@}" + local i implementation for implementation in $(_ruby_get_all_impls); do use ruby_targets_${implementation} && i+=" ${implementation}" @@ -312,6 +326,8 @@ ruby_get_use_implementations() { # @DESCRIPTION: # Gets an array of ruby use targets that the ebuild sets ruby_get_use_targets() { + debug-print-function ${FUNCNAME} "${@}" + local t implementation for implementation in $(_ruby_get_all_impls); do t+=" ruby_targets_${implementation}" @@ -336,6 +352,8 @@ ruby_get_use_targets() { # DEPEND="ruby? ( $(ruby_implementations_depend) )" # RDEPEND="${DEPEND}" ruby_implementations_depend() { + debug-print-function ${FUNCNAME} "${@}" + local depend for _ruby_implementation in $(_ruby_get_all_impls); do depend="${depend}${depend+ }ruby_targets_${_ruby_implementation}? ( $(ruby_implementation_depend $_ruby_implementation) )" @@ -430,6 +448,8 @@ _ruby_each_implementation() { # @DESCRIPTION: # Check whether at least one ruby target implementation is present. ruby-ng_pkg_setup() { + debug-print-function ${FUNCNAME} "${@}" + # This only checks that at least one implementation is present # before doing anything; by leaving the parameters empty we know # it's a special case. @@ -440,6 +460,8 @@ ruby-ng_pkg_setup() { # @DESCRIPTION: # Unpack the source archive. ruby-ng_src_unpack() { + debug-print-function ${FUNCNAME} "${@}" + mkdir "${WORKDIR}"/all pushd "${WORKDIR}"/all &>/dev/null || die @@ -496,6 +518,8 @@ _ruby_source_copy() { # Apply patches and prepare versions for each ruby target # implementation. Also carry out common clean up tasks. ruby-ng_src_prepare() { + debug-print-function ${FUNCNAME} "${@}" + # Way too many Ruby packages are prepared on OSX without removing # the extra data forks, we do it here to avoid repeating it for # almost every other ebuild. @@ -524,6 +548,8 @@ ruby-ng_src_prepare() { # @DESCRIPTION: # Configure the package. ruby-ng_src_configure() { + debug-print-function ${FUNCNAME} "${@}" + if type each_ruby_configure &>/dev/null; then _ruby_each_implementation each_ruby_configure fi @@ -536,6 +562,8 @@ ruby-ng_src_configure() { # @DESCRIPTION: # Compile the package. ruby-ng_src_compile() { + debug-print-function ${FUNCNAME} "${@}" + if type each_ruby_compile &>/dev/null; then _ruby_each_implementation each_ruby_compile fi @@ -548,6 +576,8 @@ ruby-ng_src_compile() { # @DESCRIPTION: # Run tests for the package. ruby-ng_src_test() { + debug-print-function ${FUNCNAME} "${@}" + if type each_ruby_test &>/dev/null; then _ruby_each_implementation each_ruby_test fi @@ -589,6 +619,8 @@ _each_ruby_check_install() { # @DESCRIPTION: # Install the package for each ruby target implementation. ruby-ng_src_install() { + debug-print-function ${FUNCNAME} "${@}" + if type each_ruby_install &>/dev/null; then _ruby_each_implementation each_ruby_install fi @@ -604,6 +636,8 @@ ruby-ng_src_install() { # @USAGE: rbconfig item # @RETURN: Returns the value of the given rbconfig item of the Ruby interpreter in ${RUBY}. ruby_rbconfig_value() { + debug-print-function ${FUNCNAME} "${@}" + echo $(${RUBY} --disable=did_you_mean -rrbconfig -e "puts RbConfig::CONFIG['$1']" || die "Could not read ruby configuration for '${1}'") } @@ -612,6 +646,8 @@ ruby_rbconfig_value() { # @DESCRIPTION: # Installs the specified file(s) into the sitelibdir of the Ruby interpreter in ${RUBY}. doruby() { + debug-print-function ${FUNCNAME} "${@}" + [[ -z ${RUBY} ]] && die "\$RUBY is not set" ( # don't want to pollute calling env sitelibdir=$(ruby_rbconfig_value 'sitelibdir') @@ -624,12 +660,16 @@ doruby() { # @FUNCTION: ruby_get_libruby # @RETURN: The location of libruby*.so belonging to the Ruby interpreter in ${RUBY}. ruby_get_libruby() { + debug-print-function ${FUNCNAME} "${@}" + ${RUBY} -rrbconfig -e 'puts File.join(RbConfig::CONFIG["libdir"], RbConfig::CONFIG["LIBRUBY"])' } # @FUNCTION: ruby_get_hdrdir # @RETURN: The location of the header files belonging to the Ruby interpreter in ${RUBY}. ruby_get_hdrdir() { + debug-print-function ${FUNCNAME} "${@}" + local rubyhdrdir=$(ruby_rbconfig_value 'rubyhdrdir') if [[ "${rubyhdrdir}" = "nil" ]] ; then @@ -642,6 +682,8 @@ ruby_get_hdrdir() { # @FUNCTION: ruby_get_version # @RETURN: The version of the Ruby interpreter in ${RUBY}, or what 'ruby' points to. ruby_get_version() { + debug-print-function ${FUNCNAME} "${@}" + local ruby=${RUBY:-$(type -p ruby 2>/dev/null)} echo $(${ruby} -e 'puts RUBY_VERSION') @@ -650,6 +692,8 @@ ruby_get_version() { # @FUNCTION: ruby_get_implementation # @RETURN: The implementation of the Ruby interpreter in ${RUBY}, or what 'ruby' points to. ruby_get_implementation() { + debug-print-function ${FUNCNAME} "${@}" + local ruby=${RUBY:-$(type -p ruby 2>/dev/null)} case $(${ruby} --version) in @@ -671,6 +715,8 @@ ruby_get_implementation() { # rspec version that must be executed. It defaults to 2 for historical # compatibility. ruby-ng_rspec() { + debug-print-function ${FUNCNAME} "${@}" + local version=${RSPEC_VERSION-2} local files="$@" @@ -711,6 +757,8 @@ ruby-ng_rspec() { # This is simply a wrapper around the cucumber command (executed by $RUBY}) # which also respects TEST_VERBOSE and NOCOLOR environment variables. ruby-ng_cucumber() { + debug-print-function ${FUNCNAME} "${@}" + if [[ "${DEPEND}${BDEPEND}" != *"dev-util/cucumber"* ]]; then ewarn "Missing test dependency dev-util/cucumber" fi @@ -745,6 +793,8 @@ ruby-ng_cucumber() { # their script and we installed a broken wrapper for a while. # This also respects TEST_VERBOSE and NOCOLOR environment variables. ruby-ng_testrb-2() { + debug-print-function ${FUNCNAME} "${@}" + if [[ "${DEPEND}${BDEPEND}" != *"dev-ruby/test-unit"* ]]; then ewarn "Missing test dependency dev-ruby/test-unit" fi diff --git a/eclass/ruby-utils.eclass b/eclass/ruby-utils.eclass index 2506aee25541..d871ee74b411 100644 --- a/eclass/ruby-utils.eclass +++ b/eclass/ruby-utils.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: ruby-utils.eclass @@ -36,7 +36,7 @@ if [[ ! ${_RUBY_UTILS} ]]; then RUBY_TARGETS_PREFERENCE="ruby26 " # All other active ruby targets -RUBY_TARGETS_PREFERENCE+="ruby27 ruby30" +RUBY_TARGETS_PREFERENCE+="ruby27 ruby30 ruby31" _ruby_implementation_depend() { @@ -88,6 +88,10 @@ _ruby_implementation_depend() { rubypn="dev-lang/ruby" rubyslot=":3.0" ;; + ruby31) + rubypn="dev-lang/ruby" + rubyslot=":3.1" + ;; ree18) rubypn="dev-lang/ruby-enterprise" rubyslot=":1.8" diff --git a/eclass/scons-utils.eclass b/eclass/scons-utils.eclass index 93eac1a4c4aa..35bda2bc1ac3 100644 --- a/eclass/scons-utils.eclass +++ b/eclass/scons-utils.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: scons-utils.eclass @@ -128,9 +128,9 @@ if [[ ${_PYTHON_ANY_R1} ]]; then } python_check_deps() { scons-utils_python_check_deps; } elif [[ ${_PYTHON_SINGLE_R1} ]]; then - # when using python-single-r1, use PYTHON_MULTI_USEDEP API + # when using python-single-r1, use PYTHON_USEDEP API BDEPEND=" - $(python_gen_cond_dep "${SCONS_DEPEND}[\${PYTHON_MULTI_USEDEP}]") + $(python_gen_cond_dep "${SCONS_DEPEND}[\${PYTHON_USEDEP}]") ${PYTHON_DEPS}" elif [[ ${EAPI:-0} == [0123456] ]]; then # in older EAPIs, just force Python 2.7 diff --git a/eclass/subversion.eclass b/eclass/subversion.eclass index aa1a5c355877..8b12382a649d 100644 --- a/eclass/subversion.eclass +++ b/eclass/subversion.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: subversion.eclass @@ -6,17 +6,16 @@ # Akinori Hattori <hattya@gentoo.org> # @AUTHOR: # Original Author: Akinori Hattori <hattya@gentoo.org> -# @SUPPORTED_EAPIS: 4 5 6 7 +# @SUPPORTED_EAPIS: 6 7 8 # @BLURB: Fetch software sources from subversion repositories # @DESCRIPTION: -# The subversion eclass provides functions to fetch, patch and bootstrap -# software sources from subversion repositories. +# The subversion eclass provides functions to fetch software sources +# from subversion repositories. ESVN="${ECLASS}" case ${EAPI} in - 4|5) inherit eutils ;; - 6|7) inherit estack ;; + 6|7|8) inherit estack ;; *) die "${ESVN}: EAPI ${EAPI:-0} is not supported" ;; esac @@ -27,7 +26,7 @@ DEPEND=" net-misc/rsync" case ${EAPI} in - 4|5|6) ;; + 6) ;; *) BDEPEND="${DEPEND}"; DEPEND="" ;; esac @@ -117,24 +116,6 @@ ESVN_PASSWORD="${ESVN_PASSWORD:-}" # default: ${PN/-svn}. ESVN_PROJECT="${ESVN_PROJECT:-${PN/-svn}}" -# @ECLASS-VARIABLE: ESVN_BOOTSTRAP -# @DESCRIPTION: -# Bootstrap script or command like autogen.sh or etc.. -# Removed in EAPI 6 and later. -ESVN_BOOTSTRAP="${ESVN_BOOTSTRAP:-}" - -# @ECLASS-VARIABLE: ESVN_PATCHES -# @DESCRIPTION: -# subversion eclass can apply patches in subversion_bootstrap(). -# you can use regexp in this variable like *.diff or *.patch or etc. -# NOTE: patches will be applied before ESVN_BOOTSTRAP is processed. -# -# Patches are searched both in ${PWD} and ${FILESDIR}, if not found in either -# location, the installation dies. -# -# Removed in EAPI 6 and later, use PATCHES instead. -ESVN_PATCHES="${ESVN_PATCHES:-}" - # @ECLASS-VARIABLE: ESVN_RESTRICT # @DESCRIPTION: # this should be a space delimited list of subversion eclass features to @@ -363,50 +344,6 @@ subversion_fetch() { echo } -# @FUNCTION: subversion_bootstrap -# @DESCRIPTION: -# Apply patches in ${ESVN_PATCHES} and run ${ESVN_BOOTSTRAP} if specified. -# Removed in EAPI 6 and later. -subversion_bootstrap() { - [[ ${EAPI} == [012345] ]] || die "${FUNCNAME} is removed from subversion.eclass in EAPI 6 and later" - - if has "export" ${ESVN_RESTRICT}; then - return - fi - - cd "${S}" - - if [[ -n ${ESVN_PATCHES} ]]; then - local patch fpatch - einfo "apply patches -->" - for patch in ${ESVN_PATCHES}; do - if [[ -f ${patch} ]]; then - epatch "${patch}" - else - for fpatch in ${FILESDIR}/${patch}; do - if [[ -f ${fpatch} ]]; then - epatch "${fpatch}" - else - die "${ESVN}: ${patch} not found" - fi - done - fi - done - echo - fi - - if [[ -n ${ESVN_BOOTSTRAP} ]]; then - einfo "begin bootstrap -->" - if [[ -f ${ESVN_BOOTSTRAP} && -x ${ESVN_BOOTSTRAP} ]]; then - einfo " bootstrap with a file: ${ESVN_BOOTSTRAP}" - eval "./${ESVN_BOOTSTRAP}" || die "${ESVN}: can't execute ESVN_BOOTSTRAP." - else - einfo " bootstrap with command: ${ESVN_BOOTSTRAP}" - eval "${ESVN_BOOTSTRAP}" || die "${ESVN}: can't eval ESVN_BOOTSTRAP." - fi - fi -} - # @FUNCTION: subversion_wc_info # @USAGE: [repo_uri] # @RETURN: ESVN_WC_URL, ESVN_WC_ROOT, ESVN_WC_UUID, ESVN_WC_REVISION and ESVN_WC_PATH @@ -440,15 +377,6 @@ subversion_src_unpack() { subversion_fetch || die "${ESVN}: unknown problem occurred in subversion_fetch." } -# @FUNCTION: subversion_src_prepare -# @DESCRIPTION: -# Default src_prepare. Bootstrap. -# Removed in EAPI 6 and later. -subversion_src_prepare() { - [[ ${EAPI} == [012345] ]] || die "${FUNCNAME} is removed from subversion.eclass in EAPI 6 and later" - subversion_bootstrap || die "${ESVN}: unknown problem occurred in subversion_bootstrap." -} - # @FUNCTION: subversion_pkg_preinst # @USAGE: [repo_uri] # @DESCRIPTION: @@ -537,6 +465,3 @@ subversion__get_peg_revision() { } EXPORT_FUNCTIONS src_unpack pkg_preinst -if [[ ${EAPI} == [45] ]]; then - EXPORT_FUNCTIONS src_prepare -fi diff --git a/eclass/tests/autotools_eaclocal_amflags.sh b/eclass/tests/autotools_eaclocal_amflags.sh index f9f02bb77893..b64f857ec102 100755 --- a/eclass/tests/autotools_eaclocal_amflags.sh +++ b/eclass/tests/autotools_eaclocal_amflags.sh @@ -2,7 +2,7 @@ # Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -source tests-common.sh +source tests-common.sh || exit EAPI=7 diff --git a/eclass/tests/distutils-r1.sh b/eclass/tests/distutils-r1.sh index cd768066bf37..a42d4cc4641a 100755 --- a/eclass/tests/distutils-r1.sh +++ b/eclass/tests/distutils-r1.sh @@ -4,7 +4,7 @@ EAPI=7 PYTHON_COMPAT=( python3_8 ) -source tests-common.sh +source tests-common.sh || exit test-phase_name_free() { local ph=${1} diff --git a/eclass/tests/distutils-r1_single.sh b/eclass/tests/distutils-r1_single.sh index fdeba2e2b9b2..0a671e2b739b 100755 --- a/eclass/tests/distutils-r1_single.sh +++ b/eclass/tests/distutils-r1_single.sh @@ -4,7 +4,7 @@ EAPI=7 PYTHON_COMPAT=( python3_8 ) -source tests-common.sh +source tests-common.sh || exit test-distutils_enable_tests() { local runner=${1} diff --git a/eclass/tests/eapi7-ver.sh b/eclass/tests/eapi7-ver.sh index d4aa4fdbd289..13cd671e7158 100755 --- a/eclass/tests/eapi7-ver.sh +++ b/eclass/tests/eapi7-ver.sh @@ -4,7 +4,7 @@ EAPI=6 -source tests-common.sh +source tests-common.sh || exit inherit eapi7-ver diff --git a/eclass/tests/eapi7-ver_benchmark.sh b/eclass/tests/eapi7-ver_benchmark.sh index c46713713368..ab324edb95c9 100755 --- a/eclass/tests/eapi7-ver_benchmark.sh +++ b/eclass/tests/eapi7-ver_benchmark.sh @@ -4,7 +4,7 @@ EAPI=6 -source tests-common.sh +source tests-common.sh || exit inherit eapi7-ver versionator diff --git a/eclass/tests/eapi8-dosym.sh b/eclass/tests/eapi8-dosym.sh index e1160c42d875..9290026a26de 100755 --- a/eclass/tests/eapi8-dosym.sh +++ b/eclass/tests/eapi8-dosym.sh @@ -4,7 +4,7 @@ EAPI=7 -source tests-common.sh +source tests-common.sh || exit inherit eapi8-dosym diff --git a/eclass/tests/estack_eshopts.sh b/eclass/tests/estack_eshopts.sh index 28346c65ec13..c070e99b6569 100755 --- a/eclass/tests/estack_eshopts.sh +++ b/eclass/tests/estack_eshopts.sh @@ -2,7 +2,7 @@ # Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source tests-common.sh +source tests-common.sh || exit inherit estack diff --git a/eclass/tests/estack_estack.sh b/eclass/tests/estack_estack.sh index 4845243d3ae4..18d337ec1f0c 100755 --- a/eclass/tests/estack_estack.sh +++ b/eclass/tests/estack_estack.sh @@ -2,7 +2,7 @@ # Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source tests-common.sh +source tests-common.sh || exit inherit estack diff --git a/eclass/tests/estack_evar.sh b/eclass/tests/estack_evar.sh index 29badba0079e..1bf35f2d6e0e 100755 --- a/eclass/tests/estack_evar.sh +++ b/eclass/tests/estack_evar.sh @@ -2,7 +2,7 @@ # Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source tests-common.sh +source tests-common.sh || exit inherit estack diff --git a/eclass/tests/flag-o-matic.sh b/eclass/tests/flag-o-matic.sh index dc8cfd375c1e..1e4bfdb2fcfe 100755 --- a/eclass/tests/flag-o-matic.sh +++ b/eclass/tests/flag-o-matic.sh @@ -2,7 +2,7 @@ # Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -source tests-common.sh +source tests-common.sh || exit EAPI=7 diff --git a/eclass/tests/git-r3.sh b/eclass/tests/git-r3.sh index 2f452bfd68a8..02cbcbc59125 100755 --- a/eclass/tests/git-r3.sh +++ b/eclass/tests/git-r3.sh @@ -7,7 +7,7 @@ exit 0 EAPI=7 -source tests-common.sh +source tests-common.sh || exit inherit git-r3 diff --git a/eclass/tests/git-r3_GIT_DIR.sh b/eclass/tests/git-r3_GIT_DIR.sh index c17ae7bb43c0..2c9fa07b7041 100755 --- a/eclass/tests/git-r3_GIT_DIR.sh +++ b/eclass/tests/git-r3_GIT_DIR.sh @@ -4,7 +4,7 @@ EAPI=7 -source tests-common.sh +source tests-common.sh || exit inherit git-r3 diff --git a/eclass/tests/git-r3_subrepos.sh b/eclass/tests/git-r3_subrepos.sh index 0fcf1cd08081..76dbb1981bfc 100755 --- a/eclass/tests/git-r3_subrepos.sh +++ b/eclass/tests/git-r3_subrepos.sh @@ -4,7 +4,7 @@ EAPI=7 -source tests-common.sh +source tests-common.sh || exit inherit git-r3 diff --git a/eclass/tests/linux-info_get_running_version.sh b/eclass/tests/linux-info_get_running_version.sh index ce65ae51fee9..57aaf2fedcd4 100755 --- a/eclass/tests/linux-info_get_running_version.sh +++ b/eclass/tests/linux-info_get_running_version.sh @@ -3,7 +3,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=6 -source tests-common.sh +source tests-common.sh || exit inherit linux-info diff --git a/eclass/tests/llvm.sh b/eclass/tests/llvm.sh index 8527d81765dd..93bc124a82af 100755 --- a/eclass/tests/llvm.sh +++ b/eclass/tests/llvm.sh @@ -3,7 +3,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=7 -source tests-common.sh +source tests-common.sh || exit inherit llvm diff --git a/eclass/tests/multilib.sh b/eclass/tests/multilib.sh index ce2b4c2a5833..95be9530881e 100755 --- a/eclass/tests/multilib.sh +++ b/eclass/tests/multilib.sh @@ -3,7 +3,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=7 -source tests-common.sh +source tests-common.sh || exit inherit multilib diff --git a/eclass/tests/multiprocessing_makeopts_jobs.sh b/eclass/tests/multiprocessing_makeopts_jobs.sh index b045121cfa17..70a6085d5362 100755 --- a/eclass/tests/multiprocessing_makeopts_jobs.sh +++ b/eclass/tests/multiprocessing_makeopts_jobs.sh @@ -3,7 +3,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=7 -source tests-common.sh +source tests-common.sh || exit inherit multiprocessing diff --git a/eclass/tests/multiprocessing_makeopts_loadavg.sh b/eclass/tests/multiprocessing_makeopts_loadavg.sh index 28e5e557601a..d6e4bf0451fb 100755 --- a/eclass/tests/multiprocessing_makeopts_loadavg.sh +++ b/eclass/tests/multiprocessing_makeopts_loadavg.sh @@ -3,7 +3,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=7 -source tests-common.sh +source tests-common.sh || exit inherit multiprocessing diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh index 7ba4a864ff10..8c733b22294e 100755 --- a/eclass/tests/python-utils-r1.sh +++ b/eclass/tests/python-utils-r1.sh @@ -3,7 +3,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=7 -source tests-common.sh +source tests-common.sh || exit eqawarn() { : # stub @@ -156,11 +156,6 @@ fi test_var PYTHON_PKG_DEP pypy3 '*dev-python/pypy3*:0=' test_var PYTHON_SCRIPTDIR pypy3 /usr/lib/python-exec/pypy3 -test_is "python_is_python3 python2.7" 1 -test_is "python_is_python3 python3.2" 0 -test_is "python_is_python3 pypy" 1 -test_is "python_is_python3 pypy3" 0 - # generic shebangs test_fix_shebang '#!/usr/bin/python' python3.6 '#!/usr/bin/python3.6' test_fix_shebang '#!/usr/bin/python' pypy3 '#!/usr/bin/pypy3' diff --git a/eclass/tests/qmail.sh b/eclass/tests/qmail.sh index 3520ed2a9d5b..8cf0abdae1a6 100755 --- a/eclass/tests/qmail.sh +++ b/eclass/tests/qmail.sh @@ -3,7 +3,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=8 -source tests-common.sh +source tests-common.sh || exit inherit qmail diff --git a/eclass/tests/rebar_fix_include_path.sh b/eclass/tests/rebar_fix_include_path.sh index 8164e39d7252..339633e91e3a 100755 --- a/eclass/tests/rebar_fix_include_path.sh +++ b/eclass/tests/rebar_fix_include_path.sh @@ -2,7 +2,7 @@ # Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source tests-common.sh +source tests-common.sh || exit EAPI=6 diff --git a/eclass/tests/rebar_remove_deps.sh b/eclass/tests/rebar_remove_deps.sh index 1b877b33929b..b544a3078dbb 100755 --- a/eclass/tests/rebar_remove_deps.sh +++ b/eclass/tests/rebar_remove_deps.sh @@ -2,7 +2,7 @@ # Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source tests-common.sh +source tests-common.sh || exit EAPI=6 diff --git a/eclass/tests/rebar_set_vsn.sh b/eclass/tests/rebar_set_vsn.sh index 315d8a76ec4b..c828732b0079 100755 --- a/eclass/tests/rebar_set_vsn.sh +++ b/eclass/tests/rebar_set_vsn.sh @@ -2,7 +2,7 @@ # Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source tests-common.sh +source tests-common.sh || exit EAPI=6 diff --git a/eclass/tests/savedconfig.sh b/eclass/tests/savedconfig.sh index 7643cf4cc823..16645fc05854 100755 --- a/eclass/tests/savedconfig.sh +++ b/eclass/tests/savedconfig.sh @@ -4,7 +4,7 @@ EAPI=7 -source tests-common.sh +source tests-common.sh || exit inherit savedconfig diff --git a/eclass/tests/scons-utils.sh b/eclass/tests/scons-utils.sh index c329cf1bcbd1..32a0a944706e 100755 --- a/eclass/tests/scons-utils.sh +++ b/eclass/tests/scons-utils.sh @@ -3,7 +3,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=7 -source tests-common.sh +source tests-common.sh || exit inherit scons-utils diff --git a/eclass/tests/toolchain-funcs.sh b/eclass/tests/toolchain-funcs.sh index f78ecc4ebaab..56379b10cded 100755 --- a/eclass/tests/toolchain-funcs.sh +++ b/eclass/tests/toolchain-funcs.sh @@ -3,7 +3,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=7 -source tests-common.sh +source tests-common.sh || exit inherit toolchain-funcs diff --git a/eclass/tests/toolchain.sh b/eclass/tests/toolchain.sh index 8e070cad4b98..c012448a1478 100755 --- a/eclass/tests/toolchain.sh +++ b/eclass/tests/toolchain.sh @@ -8,7 +8,7 @@ EAPI=5 TOOLCHAIN_GCC_PV=7.3.0 PR=r0 -source tests-common.sh +source tests-common.sh || exit inherit toolchain diff --git a/eclass/tests/versionator_version_compare.sh b/eclass/tests/versionator_version_compare.sh index c7a238cf9d1e..2875c0f693da 100755 --- a/eclass/tests/versionator_version_compare.sh +++ b/eclass/tests/versionator_version_compare.sh @@ -2,7 +2,7 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source tests-common.sh +source tests-common.sh || exit inherit versionator diff --git a/eclass/tree-sitter-grammar.eclass b/eclass/tree-sitter-grammar.eclass index 10baa3c4adb6..18b42f15d62b 100644 --- a/eclass/tree-sitter-grammar.eclass +++ b/eclass/tree-sitter-grammar.eclass @@ -1,12 +1,12 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: tree-sitter-grammar.eclass # @MAINTAINER: -# Matthew Smith <matt@offtopica.uk> +# Matthew Smith <matthew@gentoo.org> # Nick Sarnie <sarnex@gentoo.org> # @AUTHOR: -# Matthew Smith <matt@offtopica.uk> +# Matthew Smith <matthew@gentoo.org> # @SUPPORTED_EAPIS: 8 # @BLURB: Common functions and variables for Tree Sitter grammars diff --git a/eclass/unpacker.eclass b/eclass/unpacker.eclass index 4c0641d59ce1..de89cd7959a4 100644 --- a/eclass/unpacker.eclass +++ b/eclass/unpacker.eclass @@ -212,7 +212,7 @@ unpack_makeself() { skip=`grep -a ^offset= "${src}" | awk '{print $3}'` (( skip++ )) ;; - 2.1.4|2.1.5|2.1.6|2.2.0|2.4.0) + 2.1.4|2.1.5|2.1.6|2.2.0|2.3.0|2.4.0) skip=$(grep -a offset=.*head.*wc "${src}" | awk '{print $3}' | head -n 1) skip=$(head -n ${skip} "${src}" | wc -c) exe="dd" diff --git a/eclass/vala.eclass b/eclass/vala.eclass index 677520748c62..23a3ae1deb6c 100644 --- a/eclass/vala.eclass +++ b/eclass/vala.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: vala.eclass @@ -6,23 +6,20 @@ # gnome@gentoo.org # @AUTHOR: # Alexandre Rostovtsev <tetromino@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 +# @SUPPORTED_EAPIS: 6 7 8 # @BLURB: Sets up the environment for using a specific version of vala. # @DESCRIPTION: # This eclass sets up commonly used environment variables for using a specific -# version of dev-lang/vala to configure and build a package. It is needed for +# version of dev-lang/vala to configure and build a package. It is needed for # packages whose build systems assume the existence of certain unversioned vala # executables, pkgconfig files, etc., which Gentoo does not provide. -# -# This eclass provides one phase function: src_prepare. -case ${EAPI:-0} in - [67]) inherit eutils multilib ;; +case ${EAPI} in + 6|7) inherit eutils multilib ;; + 8) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac -EXPORT_FUNCTIONS src_prepare - if [[ -z ${_VALA_ECLASS} ]] ; then _VALA_ECLASS=1 @@ -103,14 +100,17 @@ vala_depend() { # VALA_MAX_API_VERSION, VALA_MIN_API_VERSION, and VALA_USE_DEPEND. vala_best_api_version() { local u v + local hv_opt="-b" + [[ ${EAPI} == 6 ]] && hv_opt="" + u=$(_vala_use_depend) for v in $(vala_api_versions); do - has_version $([[ $EAPI == [1-6] ]] || echo -b) "dev-lang/vala:${v}${u}" && echo "${v}" && return + has_version ${hv_opt} "dev-lang/vala:${v}${u}" && echo "${v}" && return done } -# @FUNCTION: vala_src_prepare +# @FUNCTION: vala_setup # @USAGE: [--ignore-use] [--vala-api-version api_version] # @DESCRIPTION: # Sets up the environment variables and pkgconfig files for the @@ -120,8 +120,10 @@ vala_best_api_version() { # Is a no-op if called without --ignore-use when USE=-vala. # Dies if the USE check is passed (or ignored) and a suitable vala # version is not available. -vala_src_prepare() { +vala_setup() { local p d valafoo version ignore_use + local hv_opt="-b" + [[ ${EAPI} == 6 ]] && hv_opt="" while [[ $1 ]]; do case $1 in @@ -140,7 +142,7 @@ vala_src_prepare() { fi if [[ ${version} ]]; then - has_version $([[ $EAPI == [1-6] ]] || echo -b) "dev-lang/vala:${version}" || die "No installed vala:${version}" + has_version ${hv_opt} "dev-lang/vala:${version}" || die "No installed vala:${version}" else version=$(vala_best_api_version) [[ ${version} ]] || die "No installed vala in $(vala_depend)" @@ -175,4 +177,11 @@ vala_src_prepare() { export PKG_CONFIG_PATH="${T}/pkgconfig:${PKG_CONFIG_PATH}" } +# @FUNCTION: vala_src_prepare +# @DESCRIPTION: +# For backwards compatibility in EAPIs 6 and 7. Calls vala_setup. +if [[ ${EAPI} == [67] ]]; then + vala_src_prepare() { vala_setup "$@"; } +fi + fi diff --git a/eclass/vdr-plugin-2.eclass b/eclass/vdr-plugin-2.eclass index 68f960c28caa..37708da0c35c 100644 --- a/eclass/vdr-plugin-2.eclass +++ b/eclass/vdr-plugin-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: vdr-plugin-2.eclass @@ -179,7 +179,7 @@ vdr_create_header_checksum_file() { # Plugins failed on compile with wrong path of libsi includes, # this can be fixed by 'function + space separated list of files' fix_vdr_libsi_include() { - eqawarn "Fixing include of libsi-headers" + eqawarn "QA Notice: Fixing include of libsi-headers" local f for f; do sed -i "${f}" \ @@ -264,7 +264,7 @@ vdr_gettext_missing() { local GETTEXT_MISSING=$( grep xgettext Makefile ) if [[ -z ${GETTEXT_MISSING} ]]; then - eqawarn "Plugin isn't converted to gettext handling!" + eqawarn "QA Notice: Plugin isn't converted to gettext handling!" fi } @@ -326,11 +326,11 @@ vdr_i18n() { if [[ -n ${I18N_OBJECT} ]]; then if [[ "${KEEP_I18NOBJECT:-no}" = "yes" ]]; then - eqawarn "Forced to keep i18n.o" + eqawarn "QA Notice: Forced to keep i18n.o" else sed -i "s:i18n.o::g" Makefile \ || die "sed failed to remove i18n from Makefile" - eqawarn "OBJECT i18n.o found, removed per sed" + eqawarn "QA Notice: OBJECT i18n.o found, removed per sed" fi fi @@ -338,7 +338,7 @@ vdr_i18n() { if [[ -n ${I18N_STRING} ]]; then sed -i "s:^extern[[:space:]]*const[[:space:]]*tI18nPhrase://static const tI18nPhrase:" i18n.h \ || die "sed failed to replace tI18nPhrase" - eqawarn "obsolete tI18nPhrase found, disabled per sed, please recheck" + eqawarn "QA Notice: obsolete tI18nPhrase found, disabled per sed, please recheck" fi } @@ -357,7 +357,7 @@ vdr_remove_i18n_include() { || die "sed failed to remove i18n_include" done - eqawarn "removed i18n.h include in ${@}" + eqawarn "QA Notice: removed i18n.h include in ${@}" } # @FUNCTION: vdr-plugin-2_print_enable_command @@ -593,7 +593,7 @@ vdr-plugin-2_src_install() { DESTDIR="${D%/}" \ || die "emake install (makefile target) failed" else - eqawarn "Plugin use still the old Makefile handling" + eqawarn "QA Notice: Plugin use still the old Makefile handling" insinto "${VDR_PLUGIN_DIR}" doins libvdr-*.so.* fi diff --git a/eclass/verify-sig.eclass b/eclass/verify-sig.eclass index 3693eb16ff41..dadfd456e101 100644 --- a/eclass/verify-sig.eclass +++ b/eclass/verify-sig.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: verify-sig.eclass @@ -22,6 +22,10 @@ # # If you need to use signify, you may want to copy distfiles into WORKDIR to # work around "Too many levels of symbolic links" error. +# +# A more complete guide can be found at: +# https://mgorny.pl/articles/verify-sig-by-example.html +# # @EXAMPLE: # Example use: # @@ -197,17 +201,27 @@ verify-sig_verify_message() { esac } -# @FUNCTION: _gpg_verify_signed_checksums -# @INTERNAL -# @USAGE: <checksum-file> <algo> <files> [<key-file>] +# @FUNCTION: verify-sig_verify_unsigned_checksums +# @USAGE: <checksum-file> <algo> <files> # @DESCRIPTION: -# GnuPG-specific function to verify a signed checksums list. -_gpg_verify_signed_checksums() { +# Verify the checksums for all files listed in the space-separated list +# <files> (akin to ${A}) using a <checksum-file>. <algo> specifies +# the checksum algorithm (e.g. sha256). <checksum-file> can be "-" +# for stdin. +# +# The function dies if one of the files does not match checksums or +# is missing from the checksum file. +# +# Note that this function itself can only verify integrity of the files. +# In order to verify their authenticity, the <checksum-file> must +# be verified against a signature first, e.g. using +# verify-sig_verify_detached. If it contains inline signature, use +# verify-sig_verify_signed_checksums instead. +verify-sig_verify_unsigned_checksums() { local checksum_file=${1} local algo=${2} local files=() read -r -d '' -a files <<<"${3}" - local key=${4:-${VERIFY_SIG_OPENPGP_KEY_PATH}} local chksum_prog chksum_len case ${algo} in @@ -220,8 +234,13 @@ _gpg_verify_signed_checksums() { ;; esac + [[ ${checksum_file} == - ]] && checksum_file=/dev/stdin local checksum filename junk ret=0 count=0 while read -r checksum filename junk; do + if [[ ${checksum} == "-----BEGIN" ]]; then + die "${FUNCNAME}: PGP armor found, use verify-sig_verify_signed_checksums instead" + fi + [[ ${#checksum} -eq ${chksum_len} ]] || continue [[ -z ${checksum//[0-9a-f]} ]] || continue has "${filename}" "${files[@]}" || continue @@ -233,7 +252,7 @@ _gpg_verify_signed_checksums() { else ret=1 fi - done < <(verify-sig_verify_message "${checksum_file}" - "${key}") + done < "${checksum_file}" [[ ${ret} -eq 0 ]] || die "${FUNCNAME}: at least one file did not verify successfully" @@ -241,6 +260,22 @@ _gpg_verify_signed_checksums() { die "${FUNCNAME}: checksums for some of the specified files were missing" } +# @FUNCTION: _gpg_verify_signed_checksums +# @INTERNAL +# @USAGE: <checksum-file> <algo> <files> [<key-file>] +# @DESCRIPTION: +# GnuPG-specific function to verify a signed checksums list. +_gpg_verify_signed_checksums() { + local checksum_file=${1} + local algo=${2} + local files=${3} + local key=${4:-${VERIFY_SIG_OPENPGP_KEY_PATH}} + + verify-sig_verify_unsigned_checksums - "${algo}" "${files}" < <( + verify-sig_verify_message "${checksum_file}" - "${key}" + ) +} + # @FUNCTION: verify-sig_verify_signed_checksums # @USAGE: <checksum-file> <algo> <files> [<key-file>] # @DESCRIPTION: |