diff options
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/Manifest.gz | bin | 35991 -> 35998 bytes | |||
-rw-r--r-- | eclass/apache-2.eclass | 3 | ||||
-rw-r--r-- | eclass/darcs.eclass | 3 | ||||
-rw-r--r-- | eclass/distutils-r1.eclass | 80 | ||||
-rw-r--r-- | eclass/flag-o-matic.eclass | 4 | ||||
-rw-r--r-- | eclass/git-r3.eclass | 70 | ||||
-rw-r--r-- | eclass/gnuconfig.eclass | 9 | ||||
-rw-r--r-- | eclass/kernel-build.eclass | 1 | ||||
-rw-r--r-- | eclass/libtool.eclass | 11 | ||||
-rw-r--r-- | eclass/multibuild.eclass | 8 | ||||
-rw-r--r-- | eclass/multilib.eclass | 6 | ||||
-rw-r--r-- | eclass/python-any-r1.eclass | 34 | ||||
-rw-r--r-- | eclass/python-r1.eclass | 90 | ||||
-rw-r--r-- | eclass/python-single-r1.eclass | 52 | ||||
-rw-r--r-- | eclass/python-utils-r1.eclass | 128 | ||||
-rwxr-xr-x | eclass/tests/linux-info_get_running_version.sh | 3 | ||||
-rwxr-xr-x | eclass/tests/multilib.sh | 3 | ||||
-rwxr-xr-x | eclass/tests/multiprocessing_makeopts_jobs.sh | 3 | ||||
-rwxr-xr-x | eclass/tests/multiprocessing_makeopts_loadavg.sh | 3 | ||||
-rwxr-xr-x | eclass/tests/python-utils-r1.sh | 4 | ||||
-rwxr-xr-x | eclass/tests/scons-utils.sh | 3 | ||||
-rwxr-xr-x | eclass/tests/toolchain-funcs.sh | 3 | ||||
-rw-r--r-- | eclass/toolchain-funcs.eclass | 4 | ||||
-rw-r--r-- | eclass/vdr-plugin-2.eclass | 127 |
24 files changed, 302 insertions, 350 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz Binary files differindex ffce1ae18c6e..19367ca775cc 100644 --- a/eclass/Manifest.gz +++ b/eclass/Manifest.gz diff --git a/eclass/apache-2.eclass b/eclass/apache-2.eclass index bd84548f6de8..a67597447ba3 100644 --- a/eclass/apache-2.eclass +++ b/eclass/apache-2.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: apache-2.eclass @@ -140,6 +140,7 @@ RDEPEND=" >=dev-libs/apr-1.5.1:= =dev-libs/apr-util-1*:=[gdbm=,ldap?] dev-libs/libpcre + virtual/libcrypt:= apache2_modules_brotli? ( >=app-arch/brotli-0.6.0:= ) apache2_modules_deflate? ( sys-libs/zlib ) apache2_modules_http2? ( diff --git a/eclass/darcs.eclass b/eclass/darcs.eclass index 1ed886fb4dce..92bd347cc5af 100644 --- a/eclass/darcs.eclass +++ b/eclass/darcs.eclass @@ -1,6 +1,9 @@ # Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +# @DEAD +# No consumers left. Removal in 30 days. + # @ECLASS: darcs.eclass # @MAINTAINER: # "Gentoo's Haskell Language team" <haskell@gentoo.org> diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index 53eee173a262..cc0416fb1d9e 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -7,7 +7,7 @@ # @AUTHOR: # Author: Michał Górny <mgorny@gentoo.org> # Based on the work of: Krzysztof Pawlik <nelchael@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 +# @SUPPORTED_EAPIS: 6 7 8 # @BLURB: A simple eclass to build Python packages using distutils. # @DESCRIPTION: # A simple eclass providing functions to build Python packages using @@ -47,7 +47,7 @@ case "${EAPI:-0}" in [0-5]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;; - [6-7]) + [6-8]) ;; *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" @@ -129,7 +129,7 @@ _distutils_set_globals() { rdep+=" ${setuptools_dep}" ;; pyproject.toml) - bdep+=' dev-python/pyproject2setuppy[${PYTHON_USEDEP}]' + bdep+=' >=dev-python/pyproject2setuppy-15[${PYTHON_USEDEP}]' ;; *) die "Invalid DISTUTILS_USE_SETUPTOOLS=${DISTUTILS_USE_SETUPTOOLS}" @@ -248,15 +248,16 @@ unset -f _distutils_set_globals # } # @CODE -# @ECLASS-VARIABLE: mydistutilsargs +# @ECLASS-VARIABLE: DISTUTILS_ARGS # @DEFAULT_UNSET # @DESCRIPTION: -# An array containing options to be passed to setup.py. +# An array containing options to be passed to setup.py. They are passed +# before the default arguments, i.e. before the first command. # # Example: # @CODE # python_configure_all() { -# mydistutilsargs=( --enable-my-hidden-option ) +# DISTUTILS_ARGS=( --enable-my-hidden-option ) # } # @CODE @@ -446,8 +447,9 @@ distutils_enable_tests() { # (if ${EPYTHON} is set; fallback 'python' otherwise). # # setup.py will be passed the following, in order: -# 1. ${mydistutilsargs[@]} -# 2. additional arguments passed to the esetup.py function. +# 1. ${DISTUTILS_ARGS[@]} +# 2. ${mydistutilsargs[@]} (deprecated) +# 3. additional arguments passed to the esetup.py function. # # Please note that setup.py will respect defaults (unless overridden # via command-line options) from setup.cfg that is created @@ -463,11 +465,15 @@ esetup.py() { local setup_py=( setup.py ) if [[ ${DISTUTILS_USE_SETUPTOOLS} == pyproject.toml ]]; then - # TODO: remove '.main' when we require v10 - setup_py=( -m pyproject2setuppy.main ) + setup_py=( -m pyproject2setuppy ) fi - set -- "${EPYTHON}" "${setup_py[@]}" "${mydistutilsargs[@]}" "${@}" + if [[ ${EAPI} != [67] && ${mydistutilsargs[@]} ]]; then + die "mydistutilsargs is banned in EAPI ${EAPI} (use DISTUTILS_ARGS)" + fi + + set -- "${EPYTHON}" "${setup_py[@]}" "${DISTUTILS_ARGS[@]}" \ + "${mydistutilsargs[@]}" "${@}" echo "${@}" >&2 "${@}" || die -n @@ -526,6 +532,7 @@ distutils_install_for_testing() { local install_method=root case ${1} in --via-home) + [[ ${EAPI} == [67] ]] || die "${*} is banned in EAPI ${EAPI}" install_method=home shift ;; @@ -769,8 +776,10 @@ _distutils-r1_wrap_scripts() { local basename=${f##*/} debug-print "${FUNCNAME}: installing wrapper at ${bindir}/${basename}" - _python_ln_rel "${path}${EPREFIX}"/usr/lib/python-exec/python-exec2 \ - "${path}${bindir}/${basename}" || die + local dosym=dosym + [[ ${EAPI} == [67] ]] && dosym=dosym8 + "${dosym}" -r "${path#${D}}"/usr/lib/python-exec/python-exec2 \ + "${path#${D}}${bindir#${EPREFIX}}/${basename}" done for f in "${non_python_files[@]}"; do @@ -836,7 +845,19 @@ distutils-r1_python_test() { distutils-r1_python_install() { debug-print-function ${FUNCNAME} "${@}" - local args=( "${@}" ) + local root=${D%/}/_${EPYTHON} + [[ ${DISTUTILS_SINGLE_IMPL} ]] && root=${D%/} + + # inline DISTUTILS_ARGS logic from esetup.py in order to make + # argv overwriting easier + local args=( + "${DISTUTILS_ARGS[@]}" + "${mydistutilsargs[@]}" + install --skip-build --root="${root}" "${args[@]}" + "${@}" + ) + local DISTUTILS_ARGS=() + local mydistutilsargs=() # enable compilation for the install phase. local -x PYTHONDONTWRITEBYTECODE= @@ -852,42 +873,31 @@ distutils-r1_python_install() { if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then # user may override --install-scripts # note: this is poor but distutils argv parsing is dumb - local mydistutilsargs=( "${mydistutilsargs[@]}" ) local scriptdir=${EPREFIX}/usr/bin - # construct a list of mydistutilsargs[0] args[0] args[1]... - local arg arg_vars - [[ ${mydistutilsargs[@]} ]] && eval arg_vars+=( - 'mydistutilsargs['{0..$(( ${#mydistutilsargs[@]} - 1 ))}']' - ) - [[ ${args[@]} ]] && eval arg_vars+=( - 'args['{0..$(( ${#args[@]} - 1 ))}']' - ) - - set -- "${arg_vars[@]}" + # rewrite all the arguments + set -- "${args[@]}" + args=() while [[ ${@} ]]; do - local arg_var=${1} + local a=${1} shift - local a=${!arg_var} - case "${a}" in + case ${a} in --install-scripts=*) scriptdir=${a#--install-scripts=} - unset "${arg_var}" ;; --install-scripts) - scriptdir=${!1} - unset "${arg_var}" "${1}" + scriptdir=${1} shift ;; + *) + args+=( "${a}" ) + ;; esac done fi - local root=${D%/}/_${EPYTHON} - [[ ${DISTUTILS_SINGLE_IMPL} ]] && root=${D%/} - - esetup.py install --skip-build --root="${root}" "${args[@]}" + esetup.py "${args[@]}" local forbidden_package_names=( examples test tests diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass index 2e04e2acb06b..d262a60b6bb2 100644 --- a/eclass/flag-o-matic.eclass +++ b/eclass/flag-o-matic.eclass @@ -4,7 +4,7 @@ # @ECLASS: flag-o-matic.eclass # @MAINTAINER: # toolchain@gentoo.org -# @SUPPORTED_EAPIS: 5 6 7 +# @SUPPORTED_EAPIS: 5 6 7 8 # @BLURB: common functions to manipulate and query toolchain flags # @DESCRIPTION: # This eclass contains a suite of functions to help developers sanely @@ -12,7 +12,7 @@ case ${EAPI:-0} in 0|1|2|3|4) die "flag-o-matic.eclass: EAPI ${EAPI} is too old." ;; - 5|6|7) ;; + 5|6|7|8) ;; *) die "EAPI ${EAPI} is not supported by flag-o-matic.eclass." ;; esac diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass index 9c4f2c9d778e..398170000498 100644 --- a/eclass/git-r3.eclass +++ b/eclass/git-r3.eclass @@ -4,21 +4,15 @@ # @ECLASS: git-r3.eclass # @MAINTAINER: # Michał Górny <mgorny@gentoo.org> -# @SUPPORTED_EAPIS: 4 5 6 7 +# @SUPPORTED_EAPIS: 5 6 7 8 # @BLURB: Eclass for fetching and unpacking git repositories. # @DESCRIPTION: # Third generation eclass for easing maintenance of live ebuilds using # git as remote repository. -case "${EAPI:-0}" in - 0|1|2|3) - die "Unsupported EAPI=${EAPI} (obsolete) for ${ECLASS}" - ;; - 4|5|6|7) - ;; - *) - die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" - ;; +case ${EAPI:-0} in + 5|6|7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac EXPORT_FUNCTIONS src_unpack @@ -27,12 +21,10 @@ if [[ ! ${_GIT_R3} ]]; then PROPERTIES+=" live" -if [[ ! ${_INHERITED_BY_GIT_2} ]]; then - if [[ ${EAPI:-0} != [0123456] ]]; then - BDEPEND=">=dev-vcs/git-1.8.2.1[curl]" - else - DEPEND=">=dev-vcs/git-1.8.2.1[curl]" - fi +if [[ ${EAPI} != [56] ]]; then + BDEPEND=">=dev-vcs/git-1.8.2.1[curl]" +else + DEPEND=">=dev-vcs/git-1.8.2.1[curl]" fi # @ECLASS-VARIABLE: EGIT_CLONE_TYPE @@ -284,50 +276,6 @@ _git-r3_env_setup() { if [[ ${EGIT_COMMIT} && ${EGIT_COMMIT_DATE} ]]; then die "EGIT_COMMIT and EGIT_COMMIT_DATE can not be specified simultaneously" fi - - # Migration helpers. Remove them when git-2 is removed. - - if [[ ${EGIT_SOURCEDIR} ]]; then - eerror "EGIT_SOURCEDIR has been replaced by EGIT_CHECKOUT_DIR. While updating" - eerror "your ebuild, please check whether the variable is necessary at all" - eerror "since the default has been changed from \${S} to \${WORKDIR}/\${P}." - eerror "Therefore, proper setting of S may be sufficient." - die "EGIT_SOURCEDIR has been replaced by EGIT_CHECKOUT_DIR." - fi - - if [[ ${EGIT_MASTER} ]]; then - eerror "EGIT_MASTER has been removed. Instead, the upstream default (HEAD)" - eerror "is used by the eclass. Please remove the assignment or use EGIT_BRANCH" - eerror "as necessary." - die "EGIT_MASTER has been removed." - fi - - if [[ ${EGIT_HAS_SUBMODULES} ]]; then - eerror "EGIT_HAS_SUBMODULES has been removed. The eclass no longer needs" - eerror "to switch the clone type in order to support submodules and therefore" - eerror "submodules are detected and fetched automatically. If you need to" - eerror "disable or filter submodules, see EGIT_SUBMODULES." - die "EGIT_HAS_SUBMODULES is no longer necessary." - fi - - if [[ ${EGIT_PROJECT} ]]; then - eerror "EGIT_PROJECT has been removed. Instead, the eclass determines" - eerror "the local clone path using path in canonical EGIT_REPO_URI." - eerror "If the current algorithm causes issues for you, please report a bug." - die "EGIT_PROJECT is no longer necessary." - fi - - if [[ ${EGIT_BOOTSTRAP} ]]; then - eerror "EGIT_BOOTSTRAP has been removed. Please create proper src_prepare()" - eerror "instead." - die "EGIT_BOOTSTRAP has been removed." - fi - - if [[ ${EGIT_NOUNPACK} ]]; then - eerror "EGIT_NOUNPACK has been removed. The eclass no longer calls default" - eerror "unpack function. If necessary, please declare proper src_unpack()." - die "EGIT_NOUNPACK has been removed." - fi } # @FUNCTION: _git-r3_set_gitdir @@ -612,7 +560,7 @@ git-r3_fetch() { local commit_date=${4:-${EGIT_COMMIT_DATE}} # support new override API for EAPI 6+ - if ! has "${EAPI:-0}" 0 1 2 3 4 5; then + if [[ ${EAPI} != 5 ]]; then # get the name and do some more processing: # 1) kill .git suffix, # 2) underscore (remaining) non-variable characters, diff --git a/eclass/gnuconfig.eclass b/eclass/gnuconfig.eclass index 173df6fd25e9..58bdcfd660a6 100644 --- a/eclass/gnuconfig.eclass +++ b/eclass/gnuconfig.eclass @@ -6,7 +6,7 @@ # Sam James <sam@gentoo.org> # @AUTHOR: # Will Woods <wwoods@gentoo.org> -# @SUPPORTED_EAPIS: 5 6 7 +# @SUPPORTED_EAPIS: 5 6 7 8 # @BLURB: Refresh bundled gnuconfig files (config.guess, config.sub) # @DESCRIPTION: # This eclass is used to automatically update files that typically come with @@ -17,11 +17,8 @@ # case ${EAPI:-0} in - 5|6|7) - ;; - *) - die "EAPI ${EAPI} is unsupported!" - ;; + 5|6|7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac if [[ -z ${_GNUCONFIG_ECLASS} ]] ; then diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass index 93488902a617..28fed910fff8 100644 --- a/eclass/kernel-build.eclass +++ b/eclass/kernel-build.eclass @@ -38,6 +38,7 @@ inherit python-any-r1 savedconfig toolchain-funcs kernel-install BDEPEND=" ${PYTHON_DEPS} + app-arch/cpio sys-devel/bc sys-devel/flex virtual/libelf diff --git a/eclass/libtool.eclass b/eclass/libtool.eclass index 4565c8a8f6f8..a38f41588289 100644 --- a/eclass/libtool.eclass +++ b/eclass/libtool.eclass @@ -1,10 +1,10 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: libtool.eclass # @MAINTAINER: # base-system@gentoo.org -# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7 +# @SUPPORTED_EAPIS: 5 6 7 8 # @BLURB: quickly update bundled libtool code # @DESCRIPTION: # This eclass patches ltmain.sh distributed with libtoolized packages with the @@ -18,8 +18,8 @@ if [[ -z ${_LIBTOOL_ECLASS} ]]; then _LIBTOOL_ECLASS=1 case ${EAPI:-0} in - 0|1|2|3|4|5|6) DEPEND=">=app-portage/elt-patches-20170815" ;; - 7) BDEPEND=">=app-portage/elt-patches-20170815" ;; + 5|6) DEPEND=">=app-portage/elt-patches-20170815" ;; + 7|8) BDEPEND=">=app-portage/elt-patches-20170815" ;; *) die "${ECLASS}: EAPI ${EAPI} not supported" ;; esac @@ -43,7 +43,4 @@ elibtoolize() { eltpatch "${@}" || die "eltpatch failed" } -uclibctoolize() { die "Use elibtoolize"; } -darwintoolize() { die "Use elibtoolize"; } - fi diff --git a/eclass/multibuild.eclass b/eclass/multibuild.eclass index 8f9612bc747e..37568ebf87cc 100644 --- a/eclass/multibuild.eclass +++ b/eclass/multibuild.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: multibuild.eclass @@ -6,7 +6,7 @@ # Michał Górny <mgorny@gentoo.org> # @AUTHOR: # Author: Michał Górny <mgorny@gentoo.org> -# @SUPPORTED_EAPIS: 4 5 6 7 +# @SUPPORTED_EAPIS: 4 5 6 7 8 # @BLURB: A generic eclass for building multiple variants of packages. # @DESCRIPTION: # The multibuild eclass aims to provide a generic framework for building @@ -14,10 +14,10 @@ # implementations). case "${EAPI:-0}" in - 0|1|2|3) + [0-3]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;; - 4|5|6|7) + [4-8]) ;; *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" diff --git a/eclass/multilib.eclass b/eclass/multilib.eclass index 6ba820229de3..67cad9875a12 100644 --- a/eclass/multilib.eclass +++ b/eclass/multilib.eclass @@ -4,14 +4,14 @@ # @ECLASS: multilib.eclass # @MAINTAINER: # toolchain@gentoo.org -# @SUPPORTED_EAPIS: 5 6 7 +# @SUPPORTED_EAPIS: 5 6 7 8 # @BLURB: This eclass is for all functions pertaining to handling multilib configurations. # @DESCRIPTION: # This eclass is for all functions pertaining to handling multilib configurations. case ${EAPI:-0} in # EAPI=0 is still used by crossdev, bug #797367 - [0567]) ;; + 0|5|6|7|8) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac @@ -519,7 +519,7 @@ multilib_toolchain_setup() { fi if [[ ${ABI} != ${DEFAULT_ABI} ]] ; then - # Back that multilib-ass up so we can restore it later + # Backup multilib state so we can restore it later for v in "${save_restore_variables[@]}" ; do vv="_abi_saved_${v}" [[ ${!v+set} == "set" ]] && export ${vv}="${!v}" || unset ${vv} diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass index 49f639d5fac6..eaae5379b732 100644 --- a/eclass/python-any-r1.eclass +++ b/eclass/python-any-r1.eclass @@ -7,7 +7,7 @@ # @AUTHOR: # Author: Michał Górny <mgorny@gentoo.org> # Based on work of: Krzysztof Pawlik <nelchael@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 +# @SUPPORTED_EAPIS: 6 7 8 # @BLURB: An eclass for packages having build-time dependency on Python. # @DESCRIPTION: # A minimal eclass for packages which need any Python interpreter @@ -39,7 +39,7 @@ case "${EAPI:-0}" in [0-5]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;; - [6-7]) ;; + [6-8]) ;; *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;; esac @@ -144,7 +144,7 @@ EXPORT_FUNCTIONS pkg_setup # # Example value: # @CODE -# python_targets_python3_7(-),-python_single_target_python3_7(-) +# python_targets_python3_7(-) # @CODE # @ECLASS-VARIABLE: PYTHON_SINGLE_USEDEP @@ -239,14 +239,14 @@ if [[ ! ${_PYTHON_ANY_R1} ]]; then # ( # dev-lang/python:3.7 # dev-python/foo[python_single_target_python3_7(-)] -# || ( dev-python/bar[python_targets_python3_7(-),-python_single_target_python3_7(-)] -# dev-python/baz[python_targets_python3_7(-),-python_single_target_python3_7(-)] ) +# || ( dev-python/bar[python_targets_python3_7(-) +# dev-python/baz[python_targets_python3_7(-) ) # ) # ( # dev-lang/python:3.8 # dev-python/foo[python_single_target_python3_8(-)] -# || ( dev-python/bar[python_targets_python3_8(-),-python_single_target_python3_8(-)] -# dev-python/baz[python_targets_python3_8(-),-python_single_target_python3_8(-)] ) +# || ( dev-python/bar[python_targets_python3_8(-)] +# dev-python/baz[python_targets_python3_8(-)] ) # ) # ) # @CODE @@ -258,7 +258,7 @@ python_gen_any_dep() { local i PYTHON_PKG_DEP out= for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do - local PYTHON_USEDEP="python_targets_${i}(-),-python_single_target_${i}(-)" + local PYTHON_USEDEP="python_targets_${i}(-)" local PYTHON_SINGLE_USEDEP="python_single_target_${i}(-)" _python_export "${i}" PYTHON_PKG_DEP @@ -294,7 +294,7 @@ _python_EPYTHON_supported() { 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}(-),-python_single_target_${i}(-)" + local PYTHON_USEDEP="python_targets_${i}(-)" local PYTHON_SINGLE_USEDEP="python_single_target_${i}(-)" python_check_deps return ${?} @@ -345,22 +345,6 @@ python_setup() { fi fi - # then, try eselect-python - local variant i - for variant in '' '--python2' '--python3'; do - i=$(eselect python --show ${variant} 2>/dev/null) - - if [[ ! ${i} ]]; then - # no eselect-python? - break - elif _python_EPYTHON_supported "${i}"; then - _python_export "${i}" EPYTHON PYTHON - _python_wrapper_setup - einfo "Using ${EPYTHON} to build" - return - fi - done - # fallback to best installed impl. # (reverse iteration over _PYTHON_SUPPORTED_IMPLS) for (( i = ${#_PYTHON_SUPPORTED_IMPLS[@]} - 1; i >= 0; i-- )); do diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass index 1eb68270a0b3..3a4d257036c8 100644 --- a/eclass/python-r1.eclass +++ b/eclass/python-r1.eclass @@ -7,7 +7,7 @@ # @AUTHOR: # Author: Michał Górny <mgorny@gentoo.org> # Based on work of: Krzysztof Pawlik <nelchael@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 +# @SUPPORTED_EAPIS: 6 7 8 # @BLURB: A common, simple eclass for Python packages. # @DESCRIPTION: # A common eclass providing helper functions to build and install @@ -33,7 +33,7 @@ case "${EAPI:-0}" in [0-5]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;; - [6-7]) + [6-8]) ;; *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" @@ -203,15 +203,6 @@ _python_set_globals() { local flags=( "${_PYTHON_SUPPORTED_IMPLS[@]/#/python_targets_}" ) local optflags=${flags[@]/%/(-)?} - - # A nice QA trick here. Since a python-single-r1 package has to have - # at least one PYTHON_SINGLE_TARGET enabled (REQUIRED_USE), - # the following check will always fail on those packages. Therefore, - # it should prevent developers from mistakenly depending on packages - # not supporting multiple Python implementations. - - local flags_st=( "${_PYTHON_SUPPORTED_IMPLS[@]/#/-python_single_target_}" ) - optflags+=,${flags_st[@]/%/(-)} local requse="|| ( ${flags[*]} )" local usedep=${optflags// /,} @@ -304,11 +295,10 @@ _python_validate_useflags() { # are both in PYTHON_COMPAT and match any of the patterns passed # as parameters to the function. # -# 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. +# 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. @@ -322,7 +312,6 @@ _python_gen_usedep() { if _python_impl_matches "${impl}" "${@}"; then matches+=( "python_targets_${impl}(-)?" - "-python_single_target_${impl}(-)" ) fi done @@ -342,11 +331,10 @@ _python_gen_usedep() { # are both in PYTHON_COMPAT and match any of the patterns passed # as parameters to the function. # -# 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. +# 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 @@ -370,6 +358,7 @@ python_gen_usedep() { 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 "${@}" } @@ -380,11 +369,10 @@ python_gen_usedep() { # are both in PYTHON_COMPAT and match any of the patterns passed # as parameters to the function. # -# 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. +# 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. # # Example: # @CODE @@ -418,11 +406,10 @@ 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 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. +# 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. # # In order to enforce USE constraints on the packages, verbatim # '${PYTHON_USEDEP}' (quoted!) may be placed in the dependency @@ -477,11 +464,10 @@ python_gen_cond_dep() { # patterns are passed, the output dependencies will be generated only # for the implementations matching them. # -# 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. +# 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. # # Use this function when you need to request different USE flags # on the Python interpreter depending on package's USE flags. If you @@ -534,11 +520,10 @@ 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 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. +# 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 should be used along with an appropriate python_check_deps() # that checks which of the any-of blocks were matched, and python_setup @@ -578,8 +563,8 @@ python_gen_impl_dep() { # ( # dev-lang/python:3.8 # dev-python/foo[python_single_target_python3_8(-)] -# || ( dev-python/bar[python_targets_python3_8(-),-python_single_target_python3_8(-)] -# dev-python/baz[python_targets_python3_8(-),-python_single_target_python3_8(-)] ) +# || ( dev-python/bar[python_targets_python3_8(-)] +# dev-python/baz[python_targets_python3_8(-)] ) # ) # ) # @CODE @@ -593,7 +578,7 @@ python_gen_any_dep() { _python_verify_patterns "${@}" for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do if _python_impl_matches "${i}" "${@}"; then - local PYTHON_USEDEP="python_targets_${i}(-),-python_single_target_${i}(-)" + local PYTHON_USEDEP="python_targets_${i}(-)" local PYTHON_SINGLE_USEDEP="python_single_target_${i}(-)" _python_export "${i}" PYTHON_PKG_DEP @@ -725,11 +710,10 @@ python_foreach_impl() { # The python_check_deps() function in the any-of mode needs to be # accompanied by appropriate any-of dependencies. # -# 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. +# 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 function needs to be used when Python is being called outside # of python_foreach_impl calls (e.g. for shared processes like doc @@ -806,7 +790,7 @@ python_setup() { # first check if the interpreter is installed python_is_installed "${impl}" || continue # then run python_check_deps - local PYTHON_USEDEP="python_targets_${impl}(-),-python_single_target_${impl}(-)" + local PYTHON_USEDEP="python_targets_${impl}(-)" local PYTHON_SINGLE_USEDEP="python_single_target_${impl}(-)" python_check_deps || continue fi @@ -862,7 +846,9 @@ python_replicate_script() { # install the wrappers local f for f; do - _python_ln_rel "${ED%/}/usr/lib/python-exec/python-exec2" "${f}" || die + local dosym=dosym + [[ ${EAPI} == [67] ]] && dosym=dosym8 + "${dosym}" -r /usr/lib/python-exec/python-exec2 "${f#${ED}}" done } diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass index 07db2d762ded..da0113b6d57b 100644 --- a/eclass/python-single-r1.eclass +++ b/eclass/python-single-r1.eclass @@ -7,7 +7,7 @@ # @AUTHOR: # Author: Michał Górny <mgorny@gentoo.org> # Based on work of: Krzysztof Pawlik <nelchael@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 +# @SUPPORTED_EAPIS: 6 7 8 # @BLURB: An eclass for Python packages not installed for multiple implementations. # @DESCRIPTION: # An extension of the python-r1 eclass suite for packages which @@ -40,7 +40,7 @@ case "${EAPI:-0}" in [0-5]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;; - [6-7]) + [6-8]) ;; *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" @@ -179,12 +179,6 @@ EXPORT_FUNCTIONS pkg_setup # python_targets_python3_4(-) # @CODE -# @ECLASS-VARIABLE: PYTHON_MULTI_USEDEP -# @OUTPUT_VARIABLE -# @DESCRIPTION: -# This is a backwards-compatibility placeholder. Use PYTHON_USEDEP -# instead. - # @ECLASS-VARIABLE: PYTHON_REQUIRED_USE # @OUTPUT_VARIABLE # @DESCRIPTION: @@ -278,11 +272,10 @@ if [[ ! ${_PYTHON_SINGLE_R1} ]]; then # are both in PYTHON_COMPAT and match any of the patterns passed # as parameters to the function. # -# 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. +# 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() { @@ -312,11 +305,10 @@ _python_gen_usedep() { # are both in PYTHON_COMPAT and match any of the patterns passed # as parameters to the function. # -# 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. +# 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. # # Example: # @CODE @@ -350,11 +342,10 @@ 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 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. +# 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. # # In order to enforce USE constraints on the packages, verbatim # '${PYTHON_SINGLE_USEDEP}' and '${PYTHON_USEDEP}' (quoted!) may @@ -395,6 +386,12 @@ python_gen_cond_dep() { fi 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}} matches+=( "python_single_target_${impl}? ( ${subdep//\$\{PYTHON_USEDEP\}/${multi_usedep}} )" ) @@ -413,11 +410,10 @@ python_gen_cond_dep() { # patterns are passed, the output dependencies will be generated only # for the implementations matching them. # -# 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. +# 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. # # 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 3dbf221eac5d..7488802332f6 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -7,7 +7,7 @@ # @AUTHOR: # Author: Michał Górny <mgorny@gentoo.org> # Based on work of: Krzysztof Pawlik <nelchael@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 +# @SUPPORTED_EAPIS: 6 7 8 # @BLURB: Utility functions for packages with Python parts. # @DESCRIPTION: # A utility eclass providing functions to query Python implementations, @@ -24,7 +24,7 @@ # See bug #704286, bug #781878 case "${EAPI:-0}" in [0-5]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;; - [6-7]) ;; + [6-8]) ;; *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;; esac @@ -34,6 +34,7 @@ fi if [[ ! ${_PYTHON_UTILS_R1} ]]; then +[[ ${EAPI} == [67] ]] && inherit eapi8-dosym inherit toolchain-funcs # @ECLASS-VARIABLE: _PYTHON_ALL_IMPLS @@ -188,11 +189,8 @@ _python_set_impls() { # of the patterns following it. Return 0 if it does, 1 otherwise. # Matches if no patterns are provided. # -# <impl> can be in PYTHON_COMPAT or EPYTHON form. The patterns can be -# either: -# a) fnmatch-style patterns, e.g. 'python2*', 'pypy'... -# b) '-2' to indicate all Python 2 variants (= !python_is_python3) -# c) '-3' to indicate all Python 3 variants (= python_is_python3) +# <impl> can be in PYTHON_COMPAT or EPYTHON form. The patterns +# are fnmatch-style. _python_impl_matches() { [[ ${#} -ge 1 ]] || die "${FUNCNAME}: takes at least 1 parameter" [[ ${#} -eq 1 ]] && return 0 @@ -201,15 +199,30 @@ _python_impl_matches() { shift for pattern; do - if [[ ${pattern} == -2 ]]; then - python_is_python3 "${impl}" || return 0 - elif [[ ${pattern} == -3 ]]; then - python_is_python3 "${impl}" && return 0 - return - # unify value style to allow lax matching - elif [[ ${impl/./_} == ${pattern/./_} ]]; then - return 0 - fi + case ${pattern} in + -2|python2*|pypy) + if [[ ${EAPI} != [67] ]]; then + eerror + eerror "Python 2 is no longer supported in Gentoo, please remove Python 2" + eerror "${FUNCNAME[1]} calls." + die "Passing ${pattern} to ${FUNCNAME[1]} is banned in EAPI ${EAPI}" + fi + ;; + -3) + # NB: "python3*" is fine, as "not pypy3" + if [[ ${EAPI} != [67] ]]; then + eerror + eerror "Python 2 is no longer supported in Gentoo, please remove Python 2" + eerror "${FUNCNAME[1]} calls." + die "Passing ${pattern} to ${FUNCNAME[1]} is banned in EAPI ${EAPI}" + fi + return 0 + ;; + *) + # unify value style to allow lax matching + [[ ${impl/./_} == ${pattern/./_} ]] && return 0 + ;; + esac done return 1 @@ -265,6 +278,8 @@ python_export() { eqawarn "python_export() is part of private eclass API." eqawarn "Please call python_get*() instead." + [[ ${EAPI} == [67] ]] || die "${FUNCNAME} banned in EAPI ${EAPI}" + _python_export "${@}" } @@ -534,46 +549,6 @@ python_get_scriptdir() { echo "${PYTHON_SCRIPTDIR}" } -# @FUNCTION: _python_ln_rel -# @USAGE: <from> <to> -# @INTERNAL -# @DESCRIPTION: -# Create a relative symlink. -_python_ln_rel() { - debug-print-function ${FUNCNAME} "${@}" - - local target=${1} - local symname=${2} - - local tgpath=${target%/*}/ - local sympath=${symname%/*}/ - local rel_target= - - while [[ ${sympath} ]]; do - local tgseg= symseg= - - while [[ ! ${tgseg} && ${tgpath} ]]; do - tgseg=${tgpath%%/*} - tgpath=${tgpath#${tgseg}/} - done - - while [[ ! ${symseg} && ${sympath} ]]; do - symseg=${sympath%%/*} - sympath=${sympath#${symseg}/} - done - - if [[ ${tgseg} != ${symseg} ]]; then - rel_target=../${rel_target}${tgseg:+${tgseg}/} - fi - done - rel_target+=${tgpath}${target##*/} - - debug-print "${FUNCNAME}: ${symname} -> ${target}" - debug-print "${FUNCNAME}: rel_target = ${rel_target}" - - ln -fs "${rel_target}" "${symname}" -} - # @FUNCTION: python_optimize # @USAGE: [<directory>...] # @DESCRIPTION: @@ -659,7 +634,7 @@ python_optimize() { python_scriptinto() { debug-print-function ${FUNCNAME} "${@}" - python_scriptroot=${1} + _PYTHON_SCRIPTROOT=${1} } # @FUNCTION: python_doexe @@ -694,7 +669,7 @@ python_newexe() { [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).' [[ ${#} -eq 2 ]] || die "Usage: ${FUNCNAME} <path> <new-name>" - local wrapd=${python_scriptroot:-/usr/bin} + local wrapd=${_PYTHON_SCRIPTROOT:-/usr/bin} local f=${1} local newfn=${2} @@ -710,8 +685,9 @@ python_newexe() { ) # install the wrapper - _python_ln_rel "${ED%/}"/usr/lib/python-exec/python-exec2 \ - "${ED%/}/${wrapd}/${newfn}" || die + local dosym=dosym + [[ ${EAPI} == [67] ]] && dosym=dosym8 + "${dosym}" -r /usr/lib/python-exec/python-exec2 "${wrapd}/${newfn}" # don't use this at home, just call python_doscript() instead if [[ ${_PYTHON_REWRITE_SHEBANG} ]]; then @@ -797,7 +773,7 @@ python_newscript() { python_moduleinto() { debug-print-function ${FUNCNAME} "${@}" - python_moduleroot=${1} + _PYTHON_MODULEROOT=${1} } # @FUNCTION: python_domodule @@ -821,13 +797,13 @@ python_domodule() { [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).' local d - if [[ ${python_moduleroot} == /* ]]; then + if [[ ${_PYTHON_MODULEROOT} == /* ]]; then # absolute path - d=${python_moduleroot} + d=${_PYTHON_MODULEROOT} else # relative to site-packages local sitedir=$(python_get_sitedir) - d=${sitedir#${EPREFIX}}/${python_moduleroot//.//} + d=${sitedir#${EPREFIX}}/${_PYTHON_MODULEROOT//.//} fi ( @@ -878,6 +854,8 @@ python_wrapper_setup() { eqawarn "python_wrapper_setup() is part of private eclass API." eqawarn "Please call python_setup() instead." + [[ ${EAPI} == [67] ]] || die "${FUNCNAME} banned in EAPI ${EAPI}" + _python_wrapper_setup "${@}" } @@ -917,7 +895,7 @@ _python_wrapper_setup() { _python_export "${impl}" EPYTHON PYTHON local pyver pyother - if python_is_python3; then + if [[ ${EPYTHON} != python2* ]]; then pyver=3 pyother=2 else @@ -996,6 +974,9 @@ _python_wrapper_setup() { # # Returns 0 (true) if it is, 1 (false) otherwise. python_is_python3() { + eqawarn "${FUNCNAME} is deprecated, as Python 2 is not supported anymore" + [[ ${EAPI} == [67] ]] || die "${FUNCNAME} banned in EAPI ${EAPI}" + local impl=${1:-${EPYTHON}} [[ ${impl} ]] || die "python_is_python3: no impl nor EPYTHON" @@ -1094,32 +1075,31 @@ python_fix_shebang() { if [[ ${i} == *python2 ]]; then from=python2 if [[ ! ${force} ]]; then - python_is_python3 "${EPYTHON}" && error=1 + error=1 fi elif [[ ${i} == *python3 ]]; then from=python3 - if [[ ! ${force} ]]; then - python_is_python3 "${EPYTHON}" || error=1 - fi else from=python fi break ;; - *python[23].[0123456789]|*pypy|*pypy3|*jython[23].[0123456789]) + *python[23].[0-9]|*python3.[1-9][0-9]|*pypy|*pypy3|*jython[23].[0-9]) # Explicit mismatch. if [[ ! ${force} ]]; then error=1 else case "${i}" in - *python[23].[0123456789]) - from="python[23].[0123456789]";; + *python[23].[0-9]) + from="python[23].[0-9]";; + *python3.[1-9][0-9]) + from="python3.[1-9][0-9]";; *pypy) from="pypy";; *pypy3) from="pypy3";; - *jython[23].[0123456789]) - from="jython[23].[0123456789]";; + *jython[23].[0-9]) + from="jython[23].[0-9]";; *) die "${FUNCNAME}: internal error in 2nd pattern match";; esac diff --git a/eclass/tests/linux-info_get_running_version.sh b/eclass/tests/linux-info_get_running_version.sh index fbb5c827a452..ce65ae51fee9 100755 --- a/eclass/tests/linux-info_get_running_version.sh +++ b/eclass/tests/linux-info_get_running_version.sh @@ -1,7 +1,8 @@ #!/bin/bash -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +EAPI=6 source tests-common.sh inherit linux-info diff --git a/eclass/tests/multilib.sh b/eclass/tests/multilib.sh index a483d4bef360..ce2b4c2a5833 100755 --- a/eclass/tests/multilib.sh +++ b/eclass/tests/multilib.sh @@ -1,7 +1,8 @@ #!/bin/bash -# Copyright 2020 Gentoo Authors +# Copyright 2020-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +EAPI=7 source tests-common.sh inherit multilib diff --git a/eclass/tests/multiprocessing_makeopts_jobs.sh b/eclass/tests/multiprocessing_makeopts_jobs.sh index 689313a397ba..b045121cfa17 100755 --- a/eclass/tests/multiprocessing_makeopts_jobs.sh +++ b/eclass/tests/multiprocessing_makeopts_jobs.sh @@ -1,7 +1,8 @@ #!/bin/bash -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +EAPI=7 source tests-common.sh inherit multiprocessing diff --git a/eclass/tests/multiprocessing_makeopts_loadavg.sh b/eclass/tests/multiprocessing_makeopts_loadavg.sh index d17d7734b9f2..28e5e557601a 100755 --- a/eclass/tests/multiprocessing_makeopts_loadavg.sh +++ b/eclass/tests/multiprocessing_makeopts_loadavg.sh @@ -1,7 +1,8 @@ #!/bin/bash -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +EAPI=7 source tests-common.sh inherit multiprocessing diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh index 85a6a53654d3..63a94c90b715 100755 --- a/eclass/tests/python-utils-r1.sh +++ b/eclass/tests/python-utils-r1.sh @@ -5,6 +5,10 @@ EAPI=7 source tests-common.sh +eqawarn() { + : # stub +} + test_var() { local var=${1} local impl=${2} diff --git a/eclass/tests/scons-utils.sh b/eclass/tests/scons-utils.sh index 873312f67d07..c329cf1bcbd1 100755 --- a/eclass/tests/scons-utils.sh +++ b/eclass/tests/scons-utils.sh @@ -1,7 +1,8 @@ #!/bin/bash -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +EAPI=7 source tests-common.sh inherit scons-utils diff --git a/eclass/tests/toolchain-funcs.sh b/eclass/tests/toolchain-funcs.sh index 23ac568c4a50..f78ecc4ebaab 100755 --- a/eclass/tests/toolchain-funcs.sh +++ b/eclass/tests/toolchain-funcs.sh @@ -1,7 +1,8 @@ #!/bin/bash -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +EAPI=7 source tests-common.sh inherit toolchain-funcs diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index 1643f64cab76..563d9deef40b 100644 --- a/eclass/toolchain-funcs.eclass +++ b/eclass/toolchain-funcs.eclass @@ -4,7 +4,7 @@ # @ECLASS: toolchain-funcs.eclass # @MAINTAINER: # Toolchain Ninjas <toolchain@gentoo.org> -# @SUPPORTED_EAPIS: 5 6 7 +# @SUPPORTED_EAPIS: 5 6 7 8 # @BLURB: functions to query common info about the toolchain # @DESCRIPTION: # The toolchain-funcs aims to provide a complete suite of functions @@ -15,7 +15,7 @@ case ${EAPI:-0} in # EAPI=0 is still used by crossdev, bug #797367 - [0567]) ;; + 0|5|6|7|8) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac diff --git a/eclass/vdr-plugin-2.eclass b/eclass/vdr-plugin-2.eclass index e2aee26c423a..3f3acc412089 100644 --- a/eclass/vdr-plugin-2.eclass +++ b/eclass/vdr-plugin-2.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: vdr-plugin-2.eclass @@ -14,6 +14,12 @@ # @DESCRIPTION: # Eclass for easing maintenance of vdr plugin ebuilds +# @ECLASS-VARIABLE: VDRPLUGIN +# @INTERNAL +# @DESCRIPTION: +# The name of the vdr plugin, plain name without "vdr-" or "plugin" prefix or suffix. +# This variable is derived from ${PN} + # @ECLASS-VARIABLE: VDR_CONFD_FILE # @DEFAULT_UNSET # @DESCRIPTION: @@ -54,28 +60,6 @@ # PO_SUBDIR="bla foo/bla" # @CODE -# @FUNCTION: fix_vdr_libsi_include -# @DESCRIPTION: -# Plugins failed on compile with wrong path of libsi includes, -# this can be fixed by 'function + space separated list of files' -# -# Example: -# @CODE -# fix_vdr_libsi_include bla.c foo.c -# @CODE - -# @FUNCTION: vdr_remove_i18n_include -# @DESCRIPTION: -# Compile will fail if plugin still use the old i18n language handling, -# most parts are fixed by vdr-plugin-2.eclass internal functions itself. -# Remove unneeded i18.n includes from files, if they are still wrong there, -# this can be fixed by 'function + space separated list of files" -# -# Example: -# @CODE -# vdr_remove_i18n_include bla.n foo.n -# @CODE - # Applying your own local/user patches: # This is done by using the # (EAPI = 5) epatch_user() function of the eutils.eclass, @@ -112,12 +96,10 @@ DESCRIPTION="vdr Plugin: ${VDRPLUGIN} (based on vdr-plugin-2.eclass)" # Works in most cases S="${WORKDIR}/${VDRPLUGIN}-${PV}" -# depend on headers for DVB-driver -COMMON_DEPEND=">=media-tv/gentoo-vdr-scripts-0.4.2" - -DEPEND="${COMMON_DEPEND} +# depend on headers for DVB-driver and vdr-scripts +DEPEND=">=media-tv/gentoo-vdr-scripts-0.4.2 virtual/linuxtv-dvb-headers" -RDEPEND="${COMMON_DEPEND} +RDEPEND=">=media-tv/gentoo-vdr-scripts-0.4.2 >=app-eselect/eselect-vdr-0.0.2" if [[ "${GENTOO_VDR_CONDITIONAL:-no}" = "yes" ]]; then @@ -126,9 +108,13 @@ if [[ "${GENTOO_VDR_CONDITIONAL:-no}" = "yes" ]]; then RDEPEND="vdr? ( ${RDEPEND} )" fi +# @FUNCTION: vdr_create_plugindb_file +# @INTERNAL +# @USAGE: <plugin name> [more plugin names] +# @DESCRIPTION: # New method of storing plugindb -# Called from src_install -# file maintained by normal portage-methods +# Called from src_install +# file maintained by normal portage-methods vdr_create_plugindb_file() { local NEW_VDRPLUGINDB_DIR=/usr/share/vdr/vdrplugin-rebuild/ local DB_FILE="${NEW_VDRPLUGINDB_DIR}/${CATEGORY}-${PF}" @@ -151,6 +137,13 @@ vdr_create_plugindb_file() { } > "${D%/}/${DB_FILE}" } +# @FUNCTION: vdr_create_header_checksum_file +# @USAGE: +# @INTERNAL +# @DESCRIPTION: +# Create a file with md5 checksums of .h header files of the plugin being compiled. +# The checksum files are used to detect if a plugin is compiled against the current +# vdr binary. vdr_create_header_checksum_file() { # Danger: Not using $ROOT here, as compile will also not use it !!! # If vdr in $ROOT and / differ, plugins will not run anyway @@ -175,6 +168,11 @@ vdr_create_header_checksum_file() { done } +# @FUNCTION: fix_vdr_libsi_include +# @USAGE: <filename> [more filenames] +# @DESCRIPTION: +# 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" local f @@ -185,6 +183,12 @@ fix_vdr_libsi_include() { done } +# @FUNCTION: vdr_patchmakefile +# @USAGE: +# @INTERNAL +# @DESCRIPTION: +# fix Makefile of the plugin for common mistakes often made by the authors or fix +# missing things introduced with new vdr versions vdr_patchmakefile() { einfo "Patching Makefile" [[ -e Makefile ]] || die "Makefile of plugin can not be found!" @@ -240,6 +244,11 @@ vdr_patchmakefile() { touch "${WORKDIR}"/.vdr-plugin_makefile_patched } +# @FUNCTION: vdr_gettext_missing +# @USAGE: +# @INTERNAL +# @DESCRIPTION: +# emit a warning when a plugin is using the old localization methods vdr_gettext_missing() { # plugins without converting to gettext @@ -249,10 +258,13 @@ vdr_gettext_missing() { fi } +# @FUNCTION: vdr_detect_po_dir +# @INTERNAL +# @USAGE: +# @DESCRIPTION: +# helper function to find the +# DIR ${S}/po or DIR ${S]/_subdir_/po vdr_detect_po_dir() { -# helper function to find the -# DIR ${S}/po or DIR ${S]/_subdir_/po - [[ -f po ]] && local po_dir="${S}" local po_subdir=( ${S}/${PO_SUBDIR} ) local f @@ -260,10 +272,14 @@ vdr_detect_po_dir() { pofile_dir=( ${po_dir} ${po_subdir[*]} ) } +# @FUNCTION: vdr_linguas_support +# @INTERNAL +# @USAGE: +# @DESCRIPTION: +# Patching Makefile for linguas support. +# Only locales, enabled through the LINGUAS (make.conf) variable will be +# compiled and installed. vdr_linguas_support() { -# Patching Makefile for linguas support. -# Only locales, enabled through the LINGUAS (make.conf) variable will be -# compiled and installed. einfo "Patching for Linguas support" einfo "available Languages for ${P} are:" @@ -284,13 +300,16 @@ vdr_linguas_support() { strip-linguas ${PLUGIN_LINGUAS} en } +# @FUNCTION: vdr_i18n +# @INTERNAL +# @USAGE: +# @DESCRIPTION: +# i18n handling was deprecated since >=media-video/vdr-1.5.9, +# finally with >=media-video/vdr-1.7.27 it has been dropped entirely and some +# plugins will fail to compile because they're still using the old variant. +# Simply remove the i18n.o object from Makefile (OBJECT) and +# remove "static const tI18nPhrase*" from i18n.h. vdr_i18n() { -# i18n handling was deprecated since >=media-video/vdr-1.5.9, -# finally with >=media-video/vdr-1.7.27 it has been dropped entirely and some -# plugins will fail to compile because they're still using the old variant. -# Simply remove the i18n.o object from Makefile (OBJECT) and -# remove "static const tI18nPhrase*" from i18n.h. - vdr_gettext_missing local I18N_OBJECT=$( grep i18n.o Makefile ) @@ -311,9 +330,14 @@ vdr_i18n() { fi } +# @FUNCTION: vdr_remove_i18n_include +# @USAGE: <filename> [more filenames] +# @DESCRIPTION: +# Compile will fail if plugin still use the old i18n language handling, +# most parts are fixed by vdr-plugin-2.eclass internal functions itself. +# Remove unneeded i18n.h includes from files, if they are still wrong there, +# this can be fixed by this function with a space separated list of files vdr_remove_i18n_include() { - # remove uneeded i18.n includes - local f for f; do sed -i "${f}" \ @@ -323,6 +347,11 @@ vdr_remove_i18n_include() { eqawarn "removed i18n.h include in ${@}" } +# @FUNCTION: vdr-plugin-2_print_enable_command +# @INTERNAL +# @USAGE: +# @DESCRIPTION: +# print out a hint how to enable this plugin vdr-plugin-2_print_enable_command() { local p_name c=0 l="" for p_name in ${vdr_plugin_list}; do @@ -340,6 +369,12 @@ vdr-plugin-2_print_enable_command() { elog } +# @FUNCTION: has_vdr +# @INTERNAL +# @USAGE: +# @RETURN: 0=header file found 1=header file not found +# @DESCRIPTION: +# safety check if vdr header file exists has_vdr() { [[ -f "${VDR_INCLUDE_DIR}"/config.h ]] } @@ -401,6 +436,10 @@ vdr-plugin-2_pkg_setup() { fi } +# @FUNCTION: vdr-plugin-2_src_util +# @USAGE: [ list of wanted eclass helper functions to call ] +# @DESCRIPTION: +# wrapper function to call other functions in this eclass vdr-plugin-2_src_util() { while [ "$1" ]; do case "$1" in |