diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-07-18 00:58:25 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-07-18 00:58:25 +0100 |
commit | 5e0a5ca921524f8859808527a57655eec16efa52 (patch) | |
tree | 7c58411b1e81478df4e20082a6adec2553c24c5c /eclass | |
parent | 4c16e0a214824f15f09396e359db4f1f5c086fec (diff) |
gentoo auto-resync : 18:07:2023 - 00:58:24
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/Manifest.gz | bin | 37982 -> 38145 bytes | |||
-rw-r--r-- | eclass/distutils-r1.eclass | 16 | ||||
-rw-r--r-- | eclass/docs.eclass | 59 | ||||
-rw-r--r-- | eclass/elisp-common.eclass | 2 | ||||
-rw-r--r-- | eclass/elisp.eclass | 6 | ||||
-rw-r--r-- | eclass/llvm.org.eclass | 3 | ||||
-rw-r--r-- | eclass/multibuild.eclass | 6 | ||||
-rw-r--r-- | eclass/pypi.eclass | 1 | ||||
-rw-r--r-- | eclass/python-any-r1.eclass | 6 | ||||
-rw-r--r-- | eclass/python-r1.eclass | 2 | ||||
-rw-r--r-- | eclass/python-utils-r1.eclass | 17 | ||||
-rw-r--r-- | eclass/ruby-utils.eclass | 52 | ||||
-rw-r--r-- | eclass/shell-completion.eclass | 115 |
13 files changed, 182 insertions, 103 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz Binary files differindex 346faf76aa24..059fea11c41e 100644 --- a/eclass/Manifest.gz +++ b/eclass/Manifest.gz diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index fd9bf47aa963..658d26f2a440 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -191,6 +191,7 @@ esac if [[ -z ${_DISTUTILS_R1_ECLASS} ]]; then _DISTUTILS_R1_ECLASS=1 +inherit flag-o-matic inherit multibuild multilib multiprocessing ninja-utils toolchain-funcs if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then @@ -271,8 +272,7 @@ _distutils_set_globals() { ;; setuptools) bdep+=' - >=dev-python/setuptools-67.7.2[${PYTHON_USEDEP}] - >=dev-python/wheel-0.40.0[${PYTHON_USEDEP}] + >=dev-python/setuptools-67.8.0-r1[${PYTHON_USEDEP}] ' ;; sip) @@ -292,7 +292,7 @@ _distutils_set_globals() { eqawarn "is enabled." fi else - local setuptools_dep='>=dev-python/setuptools-67.7.2[${PYTHON_USEDEP}]' + local setuptools_dep='>=dev-python/setuptools-67.8.0-r1[${PYTHON_USEDEP}]' case ${DISTUTILS_USE_SETUPTOOLS:-bdepend} in no|manual) @@ -1718,7 +1718,7 @@ distutils-r1_python_install() { # python likes to compile any module it sees, which triggers sandbox # failures if some packages haven't compiled their modules yet. addpredict "${EPREFIX}/usr/lib/${EPYTHON}" - addpredict "${EPREFIX}/usr/lib/pypy3.9" + addpredict "${EPREFIX}/usr/lib/pypy3.10" addpredict "${EPREFIX}/usr/local" # bug 498232 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then @@ -1836,6 +1836,12 @@ distutils-r1_run_phase() { local -x CYTHON_FORCE_REGEN=1 fi + # Rust extensions are incompatible with C/C++ LTO compiler + # see e.g. https://bugs.gentoo.org/910220 + if has cargo ${INHERITED}; then + filter-lto + fi + # How to build Python modules in different worlds... local ldopts case "${CHOST}" in @@ -1974,7 +1980,7 @@ _distutils-r1_post_python_compile() { die "${rscriptdir} should not exist!" if [[ -d ${bindir} ]]; then mkdir -p "${rscriptdir}" || die - cp -a --reflink=auto "${bindir}"/. "${rscriptdir}"/ || die + cp -a "${bindir}"/. "${rscriptdir}"/ || die fi # enable venv magic inside the install tree diff --git a/eclass/docs.eclass b/eclass/docs.eclass index da598226bfc0..1aa4937a6363 100644 --- a/eclass/docs.eclass +++ b/eclass/docs.eclass @@ -186,21 +186,36 @@ initialize_git_repo() { fi } -# @FUNCTION: python_append_deps +# @FUNCTION: _docs_set_python_deps # @INTERNAL # @DESCRIPTION: -# Appends [\${PYTHON_USEDEP}] to all dependencies -# for python based DOCS_BUILDERs such as mkdocs or -# sphinx. -python_append_deps() { +# Add python_gen_any_dep or python_gen_cond_dep +# to DOCS_DEPEND and define python_check_deps +_docs_set_python_deps() { debug-print-function ${FUNCNAME} - local temp + local deps=${@} + python_check_deps() { + use doc || return 0 + + local dep + for dep in ${deps[@]}; do + python_has_version "${dep}[${PYTHON_USEDEP}]" || + return 1 + done + } + + local deps_appended local dep - for dep in ${DOCS_DEPEND[@]}; do - temp+=" ${dep}[\${PYTHON_USEDEP}]" + for dep in ${deps[@]}; do + deps_appended+=" ${dep}[\${PYTHON_USEDEP}]" done - DOCS_DEPEND=${temp} + + if [[ ${_PYTHON_SINGLE_R1_ECLASS} ]]; then + DOCS_DEPEND=$(python_gen_cond_dep "${deps_appended}") + else + DOCS_DEPEND=$(python_gen_any_dep "${deps_appended}") + fi } # @FUNCTION: sphinx_deps @@ -212,8 +227,8 @@ sphinx_deps() { : "${DOCS_AUTODOC:=1}" - deps="dev-python/sphinx[\${PYTHON_USEDEP}] - ${DOCS_DEPEND}" + deps="dev-python/sphinx + ${DOCS_DEPEND}" if [[ ${DOCS_AUTODOC} == 0 ]]; then if [[ -n "${DOCS_DEPEND}" ]]; then die "${FUNCNAME}: do not set DOCS_AUTODOC to 0 if external plugins are used" @@ -221,11 +236,8 @@ sphinx_deps() { elif [[ ${DOCS_AUTODOC} != 0 && ${DOCS_AUTODOC} != 1 ]]; then die "${FUNCNAME}: DOCS_AUTODOC should be set to 0 or 1" fi - if [[ ${_PYTHON_SINGLE_R1_ECLASS} ]]; then - DOCS_DEPEND="$(python_gen_cond_dep "${deps}")" - else - DOCS_DEPEND="$(python_gen_any_dep "${deps}")" - fi + + _docs_set_python_deps ${deps} } # @FUNCTION: sphinx_compile @@ -276,19 +288,16 @@ mkdocs_deps() { : "${DOCS_AUTODOC:=0}" - deps="dev-python/mkdocs[\${PYTHON_USEDEP}] - ${DOCS_DEPEND}" + deps="dev-python/mkdocs + ${DOCS_DEPEND}" if [[ ${DOCS_AUTODOC} == 1 ]]; then - deps="dev-python/mkautodoc[\${PYTHON_USEDEP}] + deps="dev-python/mkautodoc ${deps}" elif [[ ${DOCS_AUTODOC} != 0 && ${DOCS_AUTODOC} != 1 ]]; then die "${FUNCNAME}: DOCS_AUTODOC should be set to 0 or 1" fi - if [[ ${_PYTHON_SINGLE_R1_ECLASS} ]]; then - DOCS_DEPEND="$(python_gen_cond_dep "${deps}")" - else - DOCS_DEPEND="$(python_gen_any_dep "${deps}")" - fi + + _docs_set_python_deps ${deps} } # @FUNCTION: mkdocs_compile @@ -404,11 +413,9 @@ IUSE+=" doc" # Call the correct setup function case ${DOCS_BUILDER} in "sphinx") - python_append_deps sphinx_deps ;; "mkdocs") - python_append_deps mkdocs_deps ;; "doxygen") diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass index ff1b2d0da0f3..1958b4a07e18 100644 --- a/eclass/elisp-common.eclass +++ b/eclass/elisp-common.eclass @@ -25,7 +25,7 @@ # When relying on the emacs USE flag, you need to add # # @CODE -# emacs? ( >=app-editors/emacs-23.1:* ) +# emacs? ( >=app-editors/emacs-25.3:* ) # @CODE # # to your DEPEND/RDEPEND line and use the functions provided here to diff --git a/eclass/elisp.eclass b/eclass/elisp.eclass index 72e623a12179..20139491c976 100644 --- a/eclass/elisp.eclass +++ b/eclass/elisp.eclass @@ -32,9 +32,9 @@ # @PRE_INHERIT # @DEFAULT_UNSET # @DESCRIPTION: -# If you need anything different from Emacs 23, use the NEED_EMACS -# variable before inheriting elisp.eclass. Set it to the version your -# package uses and the dependency will be adjusted. +# If you need anything different from Emacs 25.3 (or newer), use the +# NEED_EMACS variable before inheriting elisp.eclass. Set it to the +# version your package uses and the dependency will be adjusted. # @ECLASS_VARIABLE: ELISP_PATCHES # @DEFAULT_UNSET diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass index ffc5ad4405ee..4691b3c9666d 100644 --- a/eclass/llvm.org.eclass +++ b/eclass/llvm.org.eclass @@ -72,6 +72,9 @@ if [[ -z ${_LLVM_SOURCE_TYPE+1} ]]; then _LLVM_SOURCE_TYPE=snapshot case ${PV} in + 17.0.0_pre20230717) + EGIT_COMMIT=3cd3f11c174baa001b337b88c7a6507eb5705cf2 + ;; 17.0.0_pre20230705) EGIT_COMMIT=5ae7fde004cbc640c2f60207791ac36574e5f5c6 ;; diff --git a/eclass/multibuild.eclass b/eclass/multibuild.eclass index 33edb9312a86..d8a5862731bf 100644 --- a/eclass/multibuild.eclass +++ b/eclass/multibuild.eclass @@ -170,8 +170,7 @@ multibuild_copy_sources() { _multibuild_create_source_copy() { einfo "${MULTIBUILD_VARIANT}: copying to ${BUILD_DIR}" - # enable reflinking if possible to make this faster - cp -p -R --reflink=auto \ + cp -p -R \ "${_MULTIBUILD_INITIAL_BUILD_DIR}" "${BUILD_DIR}" || die } @@ -190,8 +189,7 @@ multibuild_merge_root() { local src=${1} local dest=${2} - # enable reflinking if possible to make this faster - cp -a --reflink=auto "${src}"/. "${dest}"/ || die "${MULTIBUILD_VARIANT:-(unknown)}: merging image failed" + cp -a "${src}"/. "${dest}"/ || die "${MULTIBUILD_VARIANT:-(unknown)}: merging image failed" rm -rf "${src}" || die } diff --git a/eclass/pypi.eclass b/eclass/pypi.eclass index 594216a7fd96..b80ff9c95d36 100644 --- a/eclass/pypi.eclass +++ b/eclass/pypi.eclass @@ -105,6 +105,7 @@ _pypi_translate_version() { local version=${1} version=${version/_alpha/a} version=${version/_beta/b} + version=${version/_pre/.dev} version=${version/_rc/rc} _PYPI_TRANSLATED_VERSION=${version/_p/.post} } diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass index d7d44a87f516..4e2e12e228ad 100644 --- a/eclass/python-any-r1.eclass +++ b/eclass/python-any-r1.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: python-any-r1.eclass @@ -176,7 +176,7 @@ _python_any_set_globals() { _python_export "${i}" PYTHON_PKG_DEP # note: need to strip '=' slot operator for || deps - deps="${PYTHON_PKG_DEP/:0=/:0} ${deps}" + deps="${PYTHON_PKG_DEP/:=} ${deps}" done deps="|| ( ${deps})" @@ -259,7 +259,7 @@ python_gen_any_dep() { local i_depstr=${depstr//\$\{PYTHON_USEDEP\}/${PYTHON_USEDEP}} i_depstr=${i_depstr//\$\{PYTHON_SINGLE_USEDEP\}/${PYTHON_SINGLE_USEDEP}} # note: need to strip '=' slot operator for || deps - out="( ${PYTHON_PKG_DEP%=} ${i_depstr} ) ${out}" + out="( ${PYTHON_PKG_DEP%:=} ${i_depstr} ) ${out}" done echo "|| ( ${out})" } diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass index 4758defe6493..b816e3b6f855 100644 --- a/eclass/python-r1.eclass +++ b/eclass/python-r1.eclass @@ -522,7 +522,7 @@ python_gen_any_dep() { local i_depstr=${depstr//\$\{PYTHON_USEDEP\}/${PYTHON_USEDEP}} i_depstr=${i_depstr//\$\{PYTHON_SINGLE_USEDEP\}/${PYTHON_SINGLE_USEDEP}} # note: need to strip '=' slot operator for || deps - out="( ${PYTHON_PKG_DEP/:0=/:0} ${i_depstr} ) ${out}" + out="( ${PYTHON_PKG_DEP/:=} ${i_depstr} ) ${out}" fi done echo "|| ( ${out})" diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index 40c15b65d7a5..a883135eaa41 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -238,12 +238,11 @@ _python_impl_matches() { fi return 0 ;; - 3.9|3.10) - # <pypy3-7.3.12 is 3.9, >=7.3.12 is 3.10 + 3.10) [[ ${impl} == python${pattern/./_} || ${impl} == pypy3 ]] && return 0 ;; - 3.8|3.1[1-2]) + 3.8|3.9|3.1[1-2]) [[ ${impl} == python${pattern/./_} ]] && return 0 ;; *) @@ -447,14 +446,12 @@ _python_export() { PYTHON_PKG_DEP) local d case ${impl} in - python3.10) - PYTHON_PKG_DEP=">=dev-lang/python-3.10.12:3.10";; - python3.11) - PYTHON_PKG_DEP=">=dev-lang/python-3.11.4:3.11";; - python3.12) - PYTHON_PKG_DEP=">=dev-lang/python-3.12.0_beta3:3.12";; + python*) + PYTHON_PKG_DEP="dev-lang/python:${impl#python}" + ;; pypy3) - PYTHON_PKG_DEP='>=dev-python/pypy3-7.3.11_p1:0=';; + PYTHON_PKG_DEP="dev-python/${impl}:=" + ;; *) die "Invalid implementation: ${impl}" esac diff --git a/eclass/ruby-utils.eclass b/eclass/ruby-utils.eclass index c4b6f1502f8a..8a2b7720c951 100644 --- a/eclass/ruby-utils.eclass +++ b/eclass/ruby-utils.eclass @@ -44,57 +44,9 @@ _ruby_implementation_depend() { local rubyslot= case $1 in - ruby18) + ruby1[89]|ruby2[0-7]|ruby3[0-2]) rubypn="dev-lang/ruby" - rubyslot=":1.8" - ;; - ruby19) - rubypn="dev-lang/ruby" - rubyslot=":1.9" - ;; - ruby20) - rubypn="dev-lang/ruby" - rubyslot=":2.0" - ;; - ruby21) - rubypn="dev-lang/ruby" - rubyslot=":2.1" - ;; - ruby22) - rubypn="dev-lang/ruby" - rubyslot=":2.2" - ;; - ruby23) - rubypn="dev-lang/ruby" - rubyslot=":2.3" - ;; - ruby24) - rubypn="dev-lang/ruby" - rubyslot=":2.4" - ;; - ruby25) - rubypn="dev-lang/ruby" - rubyslot=":2.5" - ;; - ruby26) - rubypn="dev-lang/ruby" - rubyslot=":2.6" - ;; - ruby27) - rubypn="dev-lang/ruby" - rubyslot=":2.7" - ;; - ruby30) - rubypn="dev-lang/ruby" - rubyslot=":3.0" - ;; - ruby31) - rubypn="dev-lang/ruby" - rubyslot=":3.1" - ;; - ruby32) - rubypn="dev-lang/ruby" - rubyslot=":3.2" + rubyslot=":${1:4:1}.${1:5}" ;; ree18) rubypn="dev-lang/ruby-enterprise" diff --git a/eclass/shell-completion.eclass b/eclass/shell-completion.eclass new file mode 100644 index 000000000000..debfb8ecd26f --- /dev/null +++ b/eclass/shell-completion.eclass @@ -0,0 +1,115 @@ +# Copyright 2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: shell-completion.eclass +# @SUPPORTED_EAPIS: 8 +# @PROVIDES: bash-completion-r1 +# @AUTHOR: +# Alfred Wingate <parona@protonmail.com> +# @MAINTAINER: +# Jonas Frei <freijon@pm.me> +# Florian Schmaus <flow@gentoo.org> +# @BLURB: a few quick functions to install various shell completion files +# @DESCRIPTION: +# This eclass provides a standardised way to install shell completions +# for popular shells. It inherits the already widely adopted +# 'bash-completion-r1', thus extending on its functionality. + +case ${EAPI} in + 8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" +esac + +if [[ ! ${_SHELL_COMPLETION_ECLASS} ]]; then +_SHELL_COMPLETION_ECLASS=1 + +# Extend bash-completion-r1 +inherit bash-completion-r1 + +# @FUNCTION: _shell-completion_get_fishcompdir +# @INTERNAL +# @RETURN: unprefixed fish completions directory +_shell-completion_get_fishcompdir() { + echo "/usr/share/fish/vendor_completions.d" +} + +# @FUNCTION: _shell-completion_get_zshcompdir +# @INTERNAL +# @RETURN: unprefixed zsh completions directory +_shell-completion_get_zshcompdir() { + echo "/usr/share/zsh/site-functions" +} + +# @FUNCTION: get_fishcompdir +# @RETURN: the fish completions directory (with EPREFIX) +get_fishcompdir() { + debug-print-function ${FUNCNAME} "${@}" + + echo "${EPREFIX}$(_shell-completion_get_fishcompdir)" +} + +# @FUNCTION: get_zshcompdir +# @RETURN: the zsh completions directory (with EPREFIX) +get_zshcompdir() { + debug-print-function ${FUNCNAME} "${@}" + + echo "${EPREFIX}$(_shell-completion_get_zshcompdir)" +} + +# @FUNCTION: dofishcomp +# @USAGE: <file...> +# @DESCRIPTION: +# Install fish completion files passed as args. +dofishcomp() { + debug-print-function ${FUNCNAME} "${@}" + + ( + insopts -m 0644 + insinto "$(_shell-completion_get_fishcompdir)" + doins "${@}" + ) +} + +# @FUNCTION: dozshcomp +# @USAGE: <file...> +# @DESCRIPTION: +# Install zsh completion files passed as args. +dozshcomp() { + debug-print-function ${FUNCNAME} "${@}" + + ( + insopts -m 0644 + insinto "$(_shell-completion_get_zshcompdir)" + doins "${@}" + ) +} + +# @FUNCTION: newfishcomp +# @USAGE: <file> <newname> +# @DESCRIPTION: +# Install fish file under a new name. +newfishcomp() { + debug-print-function ${FUNCNAME} "${@}" + + ( + insopts -m 0644 + insinto "$(_shell-completion_get_fishcompdir)" + newins "${@}" + ) +} + +# @FUNCTION: newzshcomp +# @USAGE: <file> <newname> +# @DESCRIPTION: +# Install zsh file under a new name. +newzshcomp() { + debug-print-function ${FUNCNAME} "${@}" + + ( + insopts -m 0644 + insinto "$(_shell-completion_get_zshcompdir)" + newins "${@}" + ) +} + +fi |