diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-12-15 18:09:03 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-12-15 18:09:03 +0000 |
commit | 7bc9c63c9da678a7e6fceb095d56c634afd22c56 (patch) | |
tree | 4a67d50a439e9af63947e5f8b6ba3719af98b6c9 /eclass | |
parent | b284a3168fa91a038925d2ecf5e4791011ea5e7d (diff) |
gentoo resync : 15.12.2019
Diffstat (limited to 'eclass')
47 files changed, 958 insertions, 575 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz Binary files differindex 0ee9e0051352..257db67d544b 100644 --- a/eclass/Manifest.gz +++ b/eclass/Manifest.gz diff --git a/eclass/bsdmk.eclass b/eclass/bsdmk.eclass index ab91b0e4a977..2f9c3f3609d4 100644 --- a/eclass/bsdmk.eclass +++ b/eclass/bsdmk.eclass @@ -1,6 +1,9 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 +# @DEAD +# All consumers are gone. Removal in 14 days + # @ECLASS: bsdmk.eclass # @MAINTAINER: # maintainer-needed@gentoo.org diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass index 44d11cdb8380..13dd5c355fb3 100644 --- a/eclass/cargo.eclass +++ b/eclass/cargo.eclass @@ -146,7 +146,7 @@ cargo_src_compile() { export CARGO_HOME="${ECARGO_HOME}" - cargo build -j $(makeopts_jobs) $(usex debug "" --release) "$@" \ + cargo build -vv -j $(makeopts_jobs) $(usex debug "" --release) "$@" \ || die "cargo build failed" } @@ -156,9 +156,9 @@ cargo_src_compile() { cargo_src_install() { debug-print-function ${FUNCNAME} "$@" - cargo install -j $(makeopts_jobs) --root="${D}/usr" $(usex debug --debug "") "$@" \ + cargo install -vv -j $(makeopts_jobs) --root="${ED}/usr" $(usex debug --debug "") "$@" \ || die "cargo install failed" - rm -f "${D}/usr/.crates.toml" + rm -f "${ED}/usr/.crates.toml" [ -d "${S}/man" ] && doman "${S}/man" || return 0 } @@ -169,7 +169,7 @@ cargo_src_install() { cargo_src_test() { debug-print-function ${FUNCNAME} "$@" - cargo test -j $(makeopts_jobs) $(usex debug "" --release) "$@" \ + cargo test -vv -j $(makeopts_jobs) $(usex debug "" --release) "$@" \ || die "cargo test failed" } diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass index e7a48116da7d..b0225992322c 100644 --- a/eclass/cmake-utils.eclass +++ b/eclass/cmake-utils.eclass @@ -338,6 +338,18 @@ cmake-utils_use_find_package() { _cmake_use_me_now_inverted CMAKE_DISABLE_FIND_PACKAGE_ "$@" ; } +# @FUNCTION: cmake_use_find_package +# @USAGE: <USE flag> <package name> +# @DESCRIPTION: +# Alias for cmake-utils_use_find_package. +cmake_use_find_package() { + if [[ "$#" != 2 ]] ; then + die "Usage: cmake_use_find_package <USE flag> <package name>" + fi + + cmake-utils_use_find_package "$@" ; +} + # @FUNCTION: cmake-utils_use_disable # @USAGE: <USE flag> [flag name] # @DESCRIPTION: diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index e2cd076d4148..fae25ea8a5ec 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -77,9 +77,23 @@ esac # to be exported. It must be run in order for the eclass functions # to function properly. +# @ECLASS-VARIABLE: DISTUTILS_USE_SETUPTOOLS +# @PRE_INHERIT +# @DESCRIPTION: +# Controls adding dev-python/setuptools dependency. The allowed values +# are: +# +# - no -- do not add the dependency (pure distutils package) +# - bdepend -- add it to BDEPEND (the default) +# - rdepend -- add it to BDEPEND+RDEPEND (when using entry_points) +# +# This variable is effective only if DISTUTILS_OPTIONAL is disabled. +# It needs to be set before the inherit line. +: ${DISTUTILS_USE_SETUPTOOLS:=bdepend} + if [[ ! ${_DISTUTILS_R1} ]]; then -[[ ${EAPI} == [45] ]] && inherit eutils +[[ ${EAPI} == [456] ]] && inherit eutils [[ ${EAPI} == [56] ]] && inherit xdg-utils inherit multiprocessing toolchain-funcs @@ -97,15 +111,35 @@ fi if [[ ! ${_DISTUTILS_R1} ]]; then -if [[ ! ${DISTUTILS_OPTIONAL} ]]; then - RDEPEND=${PYTHON_DEPS} +_distutils_set_globals() { + local rdep=${PYTHON_DEPS} + local bdep=${rdep} + + case ${DISTUTILS_USE_SETUPTOOLS} in + no) + ;; + bdepend) + bdep+=" dev-python/setuptools[${PYTHON_USEDEP}]" + ;; + rdepend) + bdep+=" dev-python/setuptools[${PYTHON_USEDEP}]" + rdep+=" dev-python/setuptools[${PYTHON_USEDEP}]" + ;; + *) + die "Invalid DISTUTILS_USE_SETUPTOOLS=${DISTUTILS_USE_SETUPTOOLS}" + ;; + esac + + RDEPEND=${rdep} if [[ ${EAPI} != [56] ]]; then - BDEPEND=${PYTHON_DEPS} + BDEPEND=${bdep} else - DEPEND=${PYTHON_DEPS} + DEPEND=${bdep} fi REQUIRED_USE=${PYTHON_REQUIRED_USE} -fi +} +[[ ! ${DISTUTILS_OPTIONAL} ]] && _distutils_set_globals +unset -f _distutils_set_globals # @ECLASS-VARIABLE: PATCHES # @DEFAULT_UNSET @@ -232,6 +266,102 @@ fi # } # @CODE +# @FUNCTION: distutils_enable_sphinx +# @USAGE: <subdir> [--no-autodoc | <plugin-pkgs>...] +# @DESCRIPTION: +# Set up IUSE, BDEPEND, python_check_deps() and python_compile_all() for +# building HTML docs via dev-python/sphinx. python_compile_all() will +# append to HTML_DOCS if docs are enabled. +# +# This helper is meant for the most common case, that is a single Sphinx +# subdirectory with standard layout, building and installing HTML docs +# behind USE=doc. It assumes it's the only consumer of the three +# aforementioned functions. If you need to use a custom implemention, +# you can't use it. +# +# If your package uses additional Sphinx plugins, they should be passed +# (without PYTHON_USEDEP) as <plugin-pkgs>. The function will take care +# of setting appropriate any-of dep and python_check_deps(). +# +# If no plugin packages are specified, the eclass will still utilize +# any-r1 API to support autodoc (documenting source code). +# If the package uses neither autodoc nor additional plugins, you should +# pass --no-autodoc to disable this API and simplify the resulting code. +# +# This function must be called in global scope. Take care not to +# overwrite the variables set by it. If you need to extend +# python_compile_all(), you can call the original implementation +# as sphinx_compile_all. +distutils_enable_sphinx() { + debug-print-function ${FUNCNAME} "${@}" + [[ ${#} -ge 1 ]] || die "${FUNCNAME} takes at least one arg: <subdir>" + + _DISTUTILS_SPHINX_SUBDIR=${1} + shift + _DISTUTILS_SPHINX_PLUGINS=( "${@}" ) + + local deps autodoc=1 d + for d; do + if [[ ${d} == --no-autodoc ]]; then + autodoc= + else + deps+=" + ${d}[\${PYTHON_USEDEP}]" + fi + done + + if [[ ! ${autodoc} && -n ${deps} ]]; then + die "${FUNCNAME}: do not pass --no-autodoc if external plugins are used" + fi + if [[ ${autodoc} ]]; then + deps="$(python_gen_any_dep " + dev-python/sphinx[\${PYTHON_USEDEP}] + ${deps}")" + + 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 + done + } + else + deps="dev-python/sphinx" + fi + + sphinx_compile_all() { + use doc || return + + local confpy=${_DISTUTILS_SPHINX_SUBDIR}/conf.py + [[ -f ${confpy} ]] || + die "${confpy} not found, distutils_enable_sphinx call wrong" + + if [[ ${_DISTUTILS_SPHINX_PLUGINS[0]} == --no-autodoc ]]; then + if grep -F -q 'sphinx.ext.autodoc' "${confpy}"; then + die "distutils_enable_sphinx: --no-autodoc passed but sphinx.ext.autodoc found in ${confpy}" + fi + else + if ! grep -F -q 'sphinx.ext.autodoc' "${confpy}"; then + die "distutils_enable_sphinx: sphinx.ext.autodoc not found in ${confpy}, pass --no-autodoc" + fi + fi + + build_sphinx "${_DISTUTILS_SPHINX_SUBDIR}" + } + python_compile_all() { sphinx_compile_all; } + + IUSE+=" doc" + if [[ ${EAPI} == [56] ]]; then + DEPEND+=" doc? ( ${deps} )" + else + BDEPEND+=" doc? ( ${deps} )" + fi + + # we need to ensure successful return in case we're called last, + # otherwise Portage may wrongly assume sourcing failed + return 0 +} + # @FUNCTION: distutils_enable_tests # @USAGE: <test-runner> # @DESCRIPTION: @@ -241,6 +371,7 @@ fi # # - nose: nosetests (dev-python/nose) # - pytest: dev-python/pytest +# - setup.py: setup.py test (no deps included) # - unittest: for built-in Python unittest module # # This function is meant as a helper for common use cases, and it only @@ -268,6 +399,11 @@ distutils_enable_tests() { pytest -vv || die "Tests fail with ${EPYTHON}" } ;; + setup.py) + python_test() { + esetup.py test --verbose + } + ;; unittest) python_test() { "${EPYTHON}" -m unittest discover -v || @@ -293,6 +429,41 @@ distutils_enable_tests() { return 0 } +# @FUNCTION: _distutils-r1_verify_use_setuptools +# @INTERNAL +# @DESCRIPTION: +# Check setup.py for signs that DISTUTILS_USE_SETUPTOOLS have been set +# incorrectly. +_distutils_verify_use_setuptools() { + [[ ${DISTUTILS_OPTIONAL} ]] && return + + # ok, those are cheap greps. we can try toimprove them if we hit + # false positives. + local expected=no + if [[ ${CATEGORY}/${PN} == dev-python/setuptools ]]; then + # as a special case, setuptools provides itself ;-) + : + elif grep -E -q -s '(from|import)\s+setuptools' setup.py; then + if grep -E -q -s 'entry_points\s+=' setup.py; then + expected=rdepend + else + expected=bdepend + fi + fi + + if [[ ${DISTUTILS_USE_SETUPTOOLS} != ${expected} ]]; then + if [[ ! ${_DISTUTILS_SETUPTOOLS_WARNED} ]]; then + _DISTUTILS_SETUPTOOLS_WARNED=1 + local def= + [[ ${DISTUTILS_USE_SETUPTOOLS} == bdepend ]] && def=' (default?)' + + eqawarn "DISTUTILS_USE_SETUPTOOLS value is probably incorrect" + eqawarn " value: DISTUTILS_USE_SETUPTOOLS=${DISTUTILS_USE_SETUPTOOLS}${def}" + eqawarn " expected: DISTUTILS_USE_SETUPTOOLS=${expected}" + fi + fi +} + # @FUNCTION: esetup.py # @USAGE: [<args>...] # @DESCRIPTION: @@ -315,6 +486,7 @@ esetup.py() { [[ ${EAPI} != [45] ]] && die_args+=( -n ) [[ ${BUILD_DIR} ]] && _distutils-r1_create_setup_cfg + _distutils_verify_use_setuptools set -- "${EPYTHON:-python}" setup.py "${mydistutilsargs[@]}" "${@}" @@ -719,7 +891,11 @@ distutils-r1_run_phase() { debug-print-function ${FUNCNAME} "${@}" if [[ ${DISTUTILS_IN_SOURCE_BUILD} ]]; then - if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then + # only force BUILD_DIR if implementation is explicitly enabled + # for building; any-r1 API may select one that is not + # https://bugs.gentoo.org/701506 + if [[ ! ${DISTUTILS_SINGLE_IMPL} ]] && + has "${EPYTHON/./_}" ${PYTHON_TARGETS}; then cd "${BUILD_DIR}" || die fi local BUILD_DIR=${BUILD_DIR}/build diff --git a/eclass/ecm.eclass b/eclass/ecm.eclass index 06c2e9f83ea9..1616df9aab57 100644 --- a/eclass/ecm.eclass +++ b/eclass/ecm.eclass @@ -27,8 +27,8 @@ # - Rename vars and function names as needed, see kde5.eclass PORTING comments # - Instead of FRAMEWORKS_MINIMAL, define KFMIN in ebuilds and use it for deps -if [[ -z ${_ECM_UTILS_ECLASS} ]]; then -_ECM_UTILS_ECLASS=1 +if [[ -z ${_ECM_ECLASS} ]]; then +_ECM_ECLASS=1 # @ECLASS-VARIABLE: VIRTUALX_REQUIRED # @DESCRIPTION: @@ -152,10 +152,15 @@ fi : ${ECM_TEST:=false} # @ECLASS-VARIABLE: KFMIN +# @DEFAULT_UNSET # @DESCRIPTION: -# Minimum version of Frameworks to require. The default value is not going to -# be changed unless we also bump EAPI, which usually implies (rev-)bumping. +# Minimum version of Frameworks to require. Default value for kde-frameworks +# is ${PV} and 5.64.0 baseline for everything else. This is not going to be +# changed unless we also bump EAPI, which usually implies (rev-)bumping. # Version will later be used to differentiate between KF5/Qt5 and KF6/Qt6. +if [[ ${CATEGORY} = kde-frameworks ]]; then + : ${KFMIN:=$(ver_cut 1-2)} +fi : ${KFMIN:=5.64.0} # @ECLASS-VARIABLE: KFSLOT @@ -524,7 +529,7 @@ ecm_src_configure() { # TODO: drop after KDE Applications 19.08.3 removal if in_iuse designer && [[ ${KDE_DESIGNERPLUGIN} != false ]] ; then - cmakeargs+=( $(cmake-utils_use_find_package designer KF5DesignerPlugin) ) + cmakeargs+=( $(cmake_use_find_package designer KF5DesignerPlugin) ) fi if [[ ${ECM_QTHELP} = true ]]; then diff --git a/eclass/estack.eclass b/eclass/estack.eclass index f548abf8c283..3f444ee3b70b 100644 --- a/eclass/estack.eclass +++ b/eclass/estack.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: estack.eclass @@ -115,7 +115,8 @@ evar_pop() { local cnt=${1:-bad} case $# in 0) cnt=1 ;; - 1) isdigit "${cnt}" || die "${FUNCNAME}: first arg must be a number: $*" ;; + 1) [[ -z ${cnt//[0-9]} ]] \ + || die "${FUNCNAME}: first arg must be a number: $*" ;; *) die "${FUNCNAME}: only accepts one arg: $*" ;; esac @@ -153,12 +154,13 @@ evar_pop() { # eshopts_pop # @CODE eshopts_push() { + # Save both "shopt" and "set -o" option sets, because otherwise + # restoring posix would disable expand_aliases by side effect. #662586 + estack_push eshopts "$(shopt -p -o) $(shopt -p)" if [[ $1 == -[su] ]] ; then - estack_push eshopts "$(shopt -p)" - [[ $# -eq 0 ]] && return 0 + [[ $# -le 1 ]] && return 0 shopt "$@" || die "${FUNCNAME}: bad options to shopt: $*" else - estack_push eshopts "$(shopt -p -o)" [[ $# -eq 0 ]] && return 0 set "$@" || die "${FUNCNAME}: bad options to set: $*" fi @@ -196,17 +198,5 @@ eumask_pop() { umask ${s} || die "${FUNCNAME}: sanity: could not restore umask: ${s}" } -# @FUNCTION: isdigit -# @USAGE: <number> [more numbers] -# @DESCRIPTION: -# Return true if all arguments are numbers. -isdigit() { - local d - for d ; do - [[ ${d:-bad} == *[!0-9]* ]] && return 1 - done - return 0 -} - _ESTACK_ECLASS=1 fi #_ESTACK_ECLASS diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 7b6336e2aee1..20dec774f2f5 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: eutils.eclass @@ -232,53 +232,6 @@ optfeature() { } case ${EAPI:-0} in -0|1|2) - -# @FUNCTION: epause -# @USAGE: [seconds] -# @DESCRIPTION: -# Sleep for the specified number of seconds (default of 5 seconds). Useful when -# printing a message the user should probably be reading and often used in -# conjunction with the ebeep function. If the EPAUSE_IGNORE env var is set, -# don't wait at all. Defined in EAPIs 0 1 and 2. -epause() { - [[ -z ${EPAUSE_IGNORE} ]] && sleep ${1:-5} -} - -# @FUNCTION: ebeep -# @USAGE: [number of beeps] -# @DESCRIPTION: -# Issue the specified number of beeps (default of 5 beeps). Useful when -# printing a message the user should probably be reading and often used in -# conjunction with the epause function. If the EBEEP_IGNORE env var is set, -# don't beep at all. Defined in EAPIs 0 1 and 2. -ebeep() { - local n - if [[ -z ${EBEEP_IGNORE} ]] ; then - for ((n=1 ; n <= ${1:-5} ; n++)) ; do - echo -ne "\a" - sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null - echo -ne "\a" - sleep 1 - done - fi -} - -;; -*) - -ebeep() { - ewarn "QA Notice: ebeep is not defined in EAPI=${EAPI}, please file a bug at https://bugs.gentoo.org" -} - -epause() { - ewarn "QA Notice: epause is not defined in EAPI=${EAPI}, please file a bug at https://bugs.gentoo.org" -} - -;; -esac - -case ${EAPI:-0} in 0|1|2|3|4) # @FUNCTION: usex diff --git a/eclass/findlib.eclass b/eclass/findlib.eclass index d515dce340ab..3a165cfb4b41 100644 --- a/eclass/findlib.eclass +++ b/eclass/findlib.eclass @@ -1,9 +1,9 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: findlib.eclass # @MAINTAINER: -# ml@gentoo.org +# maintainer-needed@gentoo.org # @AUTHOR: # Original author: Matthieu Sozeau <mattam@gentoo.org> (retired) # @BLURB: ocamlfind (a.k.a. findlib) eclass diff --git a/eclass/font.eclass b/eclass/font.eclass index 76c20549ea64..1287f2273454 100644 --- a/eclass/font.eclass +++ b/eclass/font.eclass @@ -4,15 +4,17 @@ # @ECLASS: font.eclass # @MAINTAINER: # fonts@gentoo.org -# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7 +# @SUPPORTED_EAPIS: 5 6 7 # @BLURB: Eclass to make font installation uniform case ${EAPI:-0} in - 0|1|2|3|4|5|6) inherit eutils ;; + [56]) inherit eutils ;; 7) ;; *) die "EAPI ${EAPI} is not supported by font.eclass." ;; esac +if [[ ! ${_FONT_ECLASS} ]]; then + EXPORT_FUNCTIONS pkg_setup src_install pkg_postinst pkg_postrm # @ECLASS-VARIABLE: FONT_SUFFIX @@ -76,9 +78,7 @@ font_xfont_config() { -e ${EPREFIX}/usr/share/fonts/encodings \ -e ${EPREFIX}/usr/share/fonts/encodings/large \ "${ED%/}/${FONTDIR}/${1//${S}/}" || eerror "failed to create fonts.dir" - if [[ -e fonts.alias ]]; then - doins fonts.alias || die "failed to install fonts.alias" # TODO old EAPI cleanup - fi + [[ -e fonts.alias ]] && doins fonts.alias fi } @@ -90,9 +90,7 @@ font_fontconfig() { if [[ -n ${FONT_CONF[@]} ]]; then insinto /etc/fonts/conf.avail/ for conffile in "${FONT_CONF[@]}"; do - if [[ -e ${conffile} ]]; then - doins ${conffile} || die "failed to install conf file" # TODO old EAPI cleanup - fi + [[ -e ${conffile} ]] && doins "${conffile}" done fi } @@ -146,20 +144,8 @@ font_cleanup_dirs() { # @FUNCTION: font_pkg_setup # @DESCRIPTION: # The font pkg_setup function. -# Collision protection and Prefix compat for eapi < 3. +# Collision protection font_pkg_setup() { - # Prefix compat - case ${EAPI:-0} in - 0|1|2) - if ! use prefix; then - EPREFIX= - ED=${D} - EROOT=${ROOT} - [[ ${EROOT} = */ ]] || EROOT+="/" - fi - ;; - esac - # make sure we get no collisions # setup is not the nicest place, but preinst doesn't cut it if [[ -e "${EROOT%/}/${FONTDIR}/fonts.cache-1" ]] ; then @@ -181,7 +167,7 @@ font_src_install() { pushd "${dir}" > /dev/null insinto "${FONTDIR}/${dir//${S}/}" for suffix in ${FONT_SUFFIX}; do - doins *.${suffix} || die "font installation failed" # TODO old EAPI cleanup + doins *.${suffix} done font_xfont_config "${dir}" popd > /dev/null @@ -190,7 +176,7 @@ font_src_install() { pushd "${FONT_S}" > /dev/null insinto "${FONTDIR}" for suffix in ${FONT_SUFFIX}; do - doins *.${suffix} || die "font installation failed" # TODO old EAPI cleanup + doins *.${suffix} done font_xfont_config popd > /dev/null @@ -198,10 +184,10 @@ font_src_install() { font_fontconfig - [[ -n ${DOCS} ]] && { dodoc ${DOCS} || die "docs installation failed" ; } # TODO old EAPI cleanup + einstalldocs # install common docs - for commondoc in COPYRIGHT README{,.md,.txt} NEWS AUTHORS BUGS ChangeLog FONTLOG.txt; do + for commondoc in COPYRIGHT FONTLOG.txt; do [[ -s ${commondoc} ]] && dodoc ${commondoc} done } @@ -238,9 +224,8 @@ font_pkg_postinst() { elog "The following fontconfig configuration files have been installed:" elog for conffile in "${FONT_CONF[@]}"; do - if [[ -e "${EROOT%/}"/etc/fonts/conf.avail/${conffile##*/} ]]; then + [[ -e "${EROOT%/}"/etc/fonts/conf.avail/${conffile##*/} ]] && elog " ${conffile##*/}" - fi done elog elog "Use \`eselect fontconfig\` to enable/disable them." @@ -256,3 +241,6 @@ font_pkg_postrm() { font_cleanup_dirs _update_fontcache } + +_FONT_ECLASS=1 +fi diff --git a/eclass/games-mods.eclass b/eclass/games-mods.eclass index bbc9423154dd..d0d72eb83ebb 100644 --- a/eclass/games-mods.eclass +++ b/eclass/games-mods.eclass @@ -1,6 +1,10 @@ # Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +# @DEAD +# All consumers are gone. +# Bug #156882, #574642, #637740. Removal in 14 days. + # Variables to specify in an ebuild which uses this eclass: # GAME - (doom3, quake4 or ut2004, etc), unless ${PN} starts with e.g. "doom3-" # MOD_DESC - Description for the mod diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass index b1c7f7f43abc..e0d2bbb5edc0 100644 --- a/eclass/git-r3.eclass +++ b/eclass/git-r3.eclass @@ -556,6 +556,9 @@ _git-r3_is_local_repo() { git-r3_fetch() { debug-print-function ${FUNCNAME} "$@" + # disable password prompts, https://bugs.gentoo.org/701276 + local -x GIT_TERMINAL_PROMPT=0 + # process repos first since we create repo_name from it local repos if [[ ${1} ]]; then diff --git a/eclass/gnustep-2.eclass b/eclass/gnustep-2.eclass index b1f9525c1b9b..ddb1c29660d4 100644 --- a/eclass/gnustep-2.eclass +++ b/eclass/gnustep-2.eclass @@ -14,8 +14,7 @@ inherit gnustep-base DEPEND=">=gnustep-base/gnustep-make-2.0 virtual/gnustep-back" -RDEPEND="${DEPEND} - debug? ( !<sys-devel/gdb-6.0 )" +RDEPEND="${DEPEND}" # The following gnustep-based EXPORT_FUNCTIONS are available: # * gnustep-base_pkg_setup diff --git a/eclass/haskell-cabal.eclass b/eclass/haskell-cabal.eclass index edfdfae5cda3..2fc797e764cb 100644 --- a/eclass/haskell-cabal.eclass +++ b/eclass/haskell-cabal.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Authors +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: haskell-cabal.eclass @@ -66,6 +66,14 @@ inherit eutils ghc-package multilib toolchain-funcs # Needs working 'diff'. : ${CABAL_DEBUG_LOOSENING:=} +# @ECLASS-VARIABLE: CABAL_REPORT_OTHER_BROKEN_PACKAGES +# @DESCRIPTION: +# Show other broken packages if 'cabal configure' fails. +# It should be normally enabled unless you know you are about +# to try to compile a lot of broken packages. Default value: 'yes' +# Set to anything else to disable. +: ${CABAL_REPORT_OTHER_BROKEN_PACKAGES:=yes} + HASKELL_CABAL_EXPF="pkg_setup src_compile src_test src_install pkg_postinst pkg_postrm" # 'dev-haskell/cabal' passes those options with ./configure-based @@ -129,6 +137,7 @@ fi if [[ -n "${CABAL_TEST_SUITE}" ]]; then IUSE="${IUSE} test" + RESTRICT+=" !test? ( test )" fi # returns the version of cabal currently in use. @@ -271,6 +280,8 @@ cabal-die-if-nonempty() { } cabal-show-brokens() { + [[ ${CABAL_REPORT_OTHER_BROKEN_PACKAGES} != yes ]] && return 0 + elog "ghc-pkg check: 'checking for other broken packages:'" # pretty-printer $(ghc-getghcpkg) check 2>&1 \ @@ -283,6 +294,8 @@ cabal-show-brokens() { } cabal-show-old() { + [[ ${CABAL_REPORT_OTHER_BROKEN_PACKAGES} != yes ]] && return 0 + cabal-die-if-nonempty 'outdated' \ $("${EPREFIX}"/usr/sbin/haskell-updater --quiet --upgrade --list-only) } @@ -395,14 +408,14 @@ cabal-configure() { --datasubdir=${P}/ghc-$(ghc-version) \ "${cabalconf[@]}" \ ${CABAL_CONFIGURE_FLAGS} \ - ${CABAL_EXTRA_CONFIGURE_FLAGS} \ - "$@" + "$@" \ + ${CABAL_EXTRA_CONFIGURE_FLAGS} echo ./setup "$@" ./setup "$@" || cabal-show-brokens-and-die "setup configure failed" } cabal-build() { - set -- build ${CABAL_EXTRA_BUILD_FLAGS} "$@" + set -- build "$@" ${CABAL_EXTRA_BUILD_FLAGS} echo ./setup "$@" ./setup "$@" \ || die "setup build failed" @@ -570,8 +583,8 @@ haskell-cabal_src_test() { set -- test \ "${cabaltest[@]}" \ ${CABAL_TEST_FLAGS} \ - ${CABAL_EXTRA_TEST_FLAGS} \ - "$@" + "$@" \ + ${CABAL_EXTRA_TEST_FLAGS} echo ./setup "$@" ./setup "$@" || die "cabal test failed" fi diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass index e32cb572f147..1e46e9b55780 100644 --- a/eclass/java-utils-2.eclass +++ b/eclass/java-utils-2.eclass @@ -28,6 +28,8 @@ export WANT_JAVA_CONFIG="2" # Prefix variables are only available for EAPI>=3 has "${EAPI:-0}" 0 1 2 && ED="${D}" EPREFIX= EROOT="${ROOT}" +has test ${JAVA_PKG_IUSE} && RESTRICT+=" !test? ( test )" + # @VARIABLE: JAVA_PKG_E_DEPEND # @INTERNAL # @DESCRIPTION: diff --git a/eclass/kde.org.eclass b/eclass/kde.org.eclass index 8e13232bb9d1..b943ebabb3da 100644 --- a/eclass/kde.org.eclass +++ b/eclass/kde.org.eclass @@ -40,6 +40,12 @@ EXPORT_FUNCTIONS pkg_nofetch src_unpack # Name of the package as hosted on kde.org mirrors. : ${KDE_ORG_NAME:=$PN} +# @ECLASS-VARIABLE: KDE_RELEASE_SERVICE +# @DESCRIPTION: +# If set to "false", do nothing. +# If set to "true", set SRC_URI accordingly and apply KDE_UNRELEASED. +: ${KDE_RELEASE_SERVICE:=false} + # @ECLASS-VARIABLE: KDE_SELINUX_MODULE # @DESCRIPTION: # If set to "none", do nothing. @@ -66,6 +72,9 @@ KDE_UNRELEASED=( ) HOMEPAGE="https://kde.org/" case ${CATEGORY} in + kde-apps) + KDE_RELEASE_SERVICE=true + ;; kde-plasma) HOMEPAGE="https://kde.org/plasma-desktop" ;; @@ -77,11 +86,15 @@ case ${CATEGORY} in *) ;; esac -_kde_is_unreleased() { +_kde.org_is_unreleased() { local pair for pair in "${KDE_UNRELEASED[@]}" ; do if [[ "${pair}" = "${CATEGORY}-${PV}" ]]; then return 0 + elif [[ ${KDE_RELEASE_SERVICE} = true ]]; then + if [[ "${pair/kde-apps/${CATEGORY}}" = "${CATEGORY}-${PV}" ]]; then + return 0 + fi fi done @@ -89,25 +102,28 @@ _kde_is_unreleased() { } # Determine fetch location for released tarballs -_calculate_src_uri() { +_kde.org_calculate_src_uri() { debug-print-function ${FUNCNAME} "$@" local _src_uri="mirror://kde/" + if [[ ${KDE_RELEASE_SERVICE} = true ]]; then + case ${PV} in + ??.??.[6-9]? ) + _src_uri+="unstable/applications/${PV}/src/" + RESTRICT+=" mirror" + ;; + 19.08.3? ) _src_uri+="stable/applications/${PV}/src/" ;; + *) _src_uri+="stable/release-service/${PV}/src/" ;; + esac + fi + case ${CATEGORY} in - kde-apps) - case ${PV} in - ??.??.[6-9]? ) - _src_uri+="unstable/applications/${PV}/src/" - RESTRICT+=" mirror" - ;; - *) _src_uri+="stable/applications/${PV}/src/" ;; - esac - ;; kde-frameworks) _src_uri+="stable/frameworks/$(ver_cut 1-2)/" case ${PN} in kdelibs4support | \ + kdesignerplugin | \ kdewebkit | \ khtml | \ kjs | \ @@ -116,9 +132,6 @@ _calculate_src_uri() { kross) _src_uri+="portingAids/" ;; - kdesignerplugin) - [[ ${PV} = 5.60.* ]] || _src_uri+="portingAids/" - ;; esac ;; kde-plasma) @@ -144,13 +157,13 @@ _calculate_src_uri() { SRC_URI="${_src_uri}${KDE_ORG_NAME}-${PV}.tar.xz" - if _kde_is_unreleased ; then + if _kde.org_is_unreleased ; then RESTRICT+=" fetch" fi } # Determine fetch location for live sources -_calculate_live_repo() { +_kde.org_calculate_live_repo() { debug-print-function ${FUNCNAME} "$@" SRC_URI="" @@ -161,7 +174,7 @@ _calculate_live_repo() { # (anongit) with anything else you might want to use. EGIT_MIRROR=${EGIT_MIRROR:=https://anongit.kde.org} - if [[ ${PV} == ??.??.49.9999 && ${CATEGORY} = kde-apps ]]; then + if [[ ${PV} == ??.??.49.9999 && ${KDE_RELEASE_SERVICE} = true ]]; then EGIT_BRANCH="release/$(ver_cut 1-2)" fi @@ -181,9 +194,9 @@ _calculate_live_repo() { } case ${KDE_BUILD_TYPE} in - live) _calculate_live_repo ;; + live) _kde.org_calculate_live_repo ;; *) - _calculate_src_uri + _kde.org_calculate_src_uri debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}" ;; esac @@ -199,7 +212,7 @@ fi # KDE_UNRELEASED, display a giant warning that the package has not yet been # released upstream and should not be used. kde.org_pkg_nofetch() { - if ! _kde_is_unreleased ; then + if ! _kde.org_is_unreleased ; then return fi diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index 62e6c23e15cf..6a6a268b264a 100644 --- a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@ -211,7 +211,7 @@ if [[ ${CTARGET} == ${CHOST} && ${CATEGORY/cross-} != ${CATEGORY} ]]; then export CTARGET=${CATEGORY/cross-} fi -HOMEPAGE="https://www.kernel.org/ https://www.gentoo.org/ ${HOMEPAGE}" +HOMEPAGE="https://www.kernel.org/ https://wiki.gentoo.org/wiki/Kernel ${HOMEPAGE}" : ${LICENSE:="GPL-2"} # This is the latest KV_PATCH of the deblob tool available from the @@ -295,7 +295,7 @@ handle_genpatches() { UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}" debug-print "genpatches tarball: $tarball" fi - GENPATCHES_URI+=" ${use_cond_start}$(echo https://dev.gentoo.org/~{mpagano,whissi}/dist/genpatches/${tarball})${use_cond_end}" + GENPATCHES_URI+=" ${use_cond_start}$(echo https://dev.gentoo.org/~{alicef,mpagano,whissi}/dist/genpatches/${tarball})${use_cond_end}" done } diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass index 5a704c1d9805..f07441e863c3 100644 --- a/eclass/llvm.org.eclass +++ b/eclass/llvm.org.eclass @@ -124,12 +124,18 @@ llvm.org_set_globals() { [[ ${PV} != ${_LLVM_MASTER_MAJOR}.* ]] && EGIT_BRANCH="release/${PV%%.*}.x" elif [[ ${_LLVM_SOURCE_TYPE} == tar ]]; then - local a archives=() - _llvm.org_get_archives "${LLVM_COMPONENTS[@]}" - for a in "${archives[@]}"; do - SRC_URI+=" - https://releases.llvm.org/${PV}/${a}" - done + if ver_test -ge 9.0.1_rc1; then + # 9.0.1 RCs as GitHub archive + SRC_URI=" + https://github.com/llvm/llvm-project/archive/llvmorg-${PV/_/-}.tar.gz" + else + local a archives=() + _llvm.org_get_archives "${LLVM_COMPONENTS[@]}" + for a in "${archives[@]}"; do + SRC_URI+=" + https://releases.llvm.org/${PV}/${a}" + done + fi else die "Invalid _LLVM_SOURCE_TYPE: ${LLVM_SOURCE_TYPE}" fi @@ -141,17 +147,23 @@ llvm.org_set_globals() { RESTRICT+=" !test? ( test )" if [[ ${_LLVM_SOURCE_TYPE} == tar ]]; then - SRC_URI+=" - test? (" - - _llvm.org_get_archives "${LLVM_TEST_COMPONENTS[@]}" - for a in "${archives[@]}"; do + if ver_test -ge 9.0.1_rc1; then + # everything already fetched + : + else + # split 9.0.0 release and older SRC_URI+=" - https://releases.llvm.org/${PV}/${a}" - done + test? (" + + _llvm.org_get_archives "${LLVM_TEST_COMPONENTS[@]}" + for a in "${archives[@]}"; do + SRC_URI+=" + https://releases.llvm.org/${PV}/${a}" + done - SRC_URI+=" - )" + SRC_URI+=" + )" + fi fi fi @@ -180,19 +192,28 @@ llvm.org_src_unpack() { git-r3_fetch git-r3_checkout '' . '' "${components[@]}" else - local c archives - # TODO: optimize this - for c in "${components[@]}"; do - local top_dir=${c%%/*} - _llvm.org_get_archives "${c}" - local sub_path=${archives[0]%.tar.xz} - [[ ${c} == */* ]] && sub_path+=/${c#*/} - - ebegin "Unpacking ${sub_path} from ${archives[0]}" - mkdir -p "${top_dir}" || die - tar -C "${top_dir}" -x -J -o --strip-components 1 \ - -f "${DISTDIR}/${archives[0]}" "${sub_path}" || die + if ver_test -ge 9.0.1_rc1; then + local archive=llvmorg-${PV/_/-}.tar.gz + ebegin "Unpacking from ${archive}" + tar -x -z -o --strip-components 1 \ + -f "${DISTDIR}/${archive}" \ + "${components[@]/#/llvm-project-${archive%.tar*}/}" || die eend - done + else + local c archives + # TODO: optimize this + for c in "${components[@]}"; do + local top_dir=${c%%/*} + _llvm.org_get_archives "${c}" + local sub_path=${archives[0]%.tar.xz} + [[ ${c} == */* ]] && sub_path+=/${c#*/} + + ebegin "Unpacking ${sub_path} from ${archives[0]}" + mkdir -p "${top_dir}" || die + tar -C "${top_dir}" -x -J -o --strip-components 1 \ + -f "${DISTDIR}/${archives[0]}" "${sub_path}" || die + eend + done + fi fi } diff --git a/eclass/mount-boot.eclass b/eclass/mount-boot.eclass index 938df6732f43..c5c6b69b063e 100644 --- a/eclass/mount-boot.eclass +++ b/eclass/mount-boot.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: mount-boot.eclass @@ -10,23 +10,28 @@ # # If the live system has a separate /boot partition configured, then this # function tries to ensure that it's mounted in rw mode, exiting with an -# error if it can't. It does nothing if /boot isn't a separate partition. +# error if it can't. It does nothing if /boot isn't a separate partition. + +case ${EAPI:-0} in + 4|5|6|7) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac EXPORT_FUNCTIONS pkg_pretend pkg_preinst pkg_postinst pkg_prerm pkg_postrm -# @FUNCTION: mount-boot_disabled +# @FUNCTION: mount-boot_is_disabled # @INTERNAL # @DESCRIPTION: # Detect whether the current environment/build settings are such that we do not # want to mess with any mounts. mount-boot_is_disabled() { - # Since this eclass only deals with /boot, skip things when ROOT is active. - if [[ "${ROOT:-/}" != "/" ]] ; then + # Since this eclass only deals with /boot, skip things when EROOT is active. + if [[ ${EROOT:-/} != / ]] ; then return 0 fi # If we're only building a package, then there's no need to check things. - if [[ "${MERGE_TYPE}" == "buildonly" ]] ; then + if [[ ${MERGE_TYPE} == buildonly ]] ; then return 0 fi @@ -42,115 +47,62 @@ mount-boot_is_disabled() { # @FUNCTION: mount-boot_check_status # @INTERNAL # @DESCRIPTION: -# Figure out what kind of work we need to do in order to have /boot be sane. -# Return values are: -# 0 - Do nothing at all! -# 1 - It's mounted, but is currently ro, so need to remount rw. -# 2 - It's not mounted, so need to mount it rw. +# Check if /boot is sane, i.e., mounted as read-write if on a separate +# partition. Die if conditions are not fulfilled. mount-boot_check_status() { # Get out fast if possible. - mount-boot_is_disabled && return 0 + mount-boot_is_disabled && return # note that /dev/BOOT is in the Gentoo default /etc/fstab file - local fstabstate=$(awk '!/^#|^[[:blank:]]+#|^\/dev\/BOOT/ {print $2}' /etc/fstab | egrep "^/boot$" ) - local procstate=$(awk '$2 ~ /^\/boot$/ {print $2}' /proc/mounts) - local proc_ro=$(awk '{ print $2 " ," $4 "," }' /proc/mounts | sed -n '/^\/boot .*,ro,/p') - - if [ -n "${fstabstate}" ] && [ -n "${procstate}" ] ; then - if [ -n "${proc_ro}" ] ; then - echo - einfo "Your boot partition, detected as being mounted at /boot, is read-only." - einfo "It will be remounted in read-write mode temporarily." - return 1 - else - echo - einfo "Your boot partition was detected as being mounted at /boot." - einfo "Files will be installed there for ${PN} to function correctly." - return 0 - fi - elif [ -n "${fstabstate}" ] && [ -z "${procstate}" ] ; then - echo - einfo "Your boot partition was not mounted at /boot, so it will be automounted for you." - einfo "Files will be installed there for ${PN} to function correctly." - return 2 - else - echo + local fstabstate=$(awk '!/^[[:blank:]]*#|^\/dev\/BOOT/ && $2 == "/boot" \ + { print 1; exit }' /etc/fstab || die "awk failed") + + if [[ -z ${fstabstate} ]] ; then einfo "Assuming you do not have a separate /boot partition." - return 0 + return fi -} -mount-boot_pkg_pretend() { - # Get out fast if possible. - mount-boot_is_disabled && return 0 + local procstate=$(awk '$2 == "/boot" \ + { print gensub(/^(.*,)?(ro|rw)(,.*)?$/, "\\2", 1, $4); exit }' \ + /proc/mounts || die "awk failed") - elog "To avoid automounting and auto(un)installing with /boot," - elog "just export the DONT_MOUNT_BOOT variable." - mount-boot_check_status + if [[ -z ${procstate} ]] ; then + eerror "Your boot partition is not mounted at /boot." + eerror "Please mount it and retry." + die "/boot not mounted" + fi + + if [[ ${procstate} == ro ]] ; then + eerror "Your boot partition, detected as being mounted at /boot," \ + "is read-only." + eerror "Please remount it as read-write and retry." + die "/boot mounted read-only" + fi + + einfo "Your boot partition was detected as being mounted at /boot." + einfo "Files will be installed there for ${PN} to function correctly." } -mount-boot_mount_boot_partition() { +mount-boot_pkg_pretend() { mount-boot_check_status - case $? in - 0) # Nothing to do. - ;; - 1) # Remount it rw. - mount -o remount,rw /boot - if [ $? -ne 0 ] ; then - echo - eerror "Unable to remount in rw mode. Please do it manually!" - die "Can't remount in rw mode. Please do it manually!" - fi - touch /boot/.e.remount - ;; - 2) # Mount it rw. - mount /boot -o rw - if [ $? -ne 0 ] ; then - echo - eerror "Cannot automatically mount your /boot partition." - eerror "Your boot partition has to be mounted rw before the installation" - eerror "can continue. ${PN} needs to install important files there." - die "Please mount your /boot partition manually!" - fi - touch /boot/.e.mount - ;; - esac } mount-boot_pkg_preinst() { - # Handle older EAPIs. - case ${EAPI:-0} in - [0-3]) mount-boot_pkg_pretend ;; - esac - - mount-boot_mount_boot_partition + mount-boot_check_status } mount-boot_pkg_prerm() { - touch "${ROOT}"/boot/.keep 2>/dev/null - mount-boot_mount_boot_partition - touch "${ROOT}"/boot/.keep 2>/dev/null -} + mount-boot_check_status -mount-boot_umount_boot_partition() { - # Get out fast if possible. - mount-boot_is_disabled && return 0 - - if [ -e /boot/.e.remount ] ; then - einfo "Automatically remounting /boot as ro as it was previously." - rm -f /boot/.e.remount - mount -o remount,ro /boot - elif [ -e /boot/.e.mount ] ; then - einfo "Automatically unmounting /boot as it was previously." - rm -f /boot/.e.mount - umount /boot + if [[ -z ${EPREFIX} ]] \ + && ! ( shopt -s failglob; : "${EROOT}"/boot/.keep* ) 2>/dev/null + then + # Create a .keep file, in case it is shadowed at the mount point + touch "${EROOT}"/boot/.keep 2>/dev/null fi } -mount-boot_pkg_postinst() { - mount-boot_umount_boot_partition -} +# No-op phases for backwards compatibility +mount-boot_pkg_postinst() { :; } -mount-boot_pkg_postrm() { - mount-boot_umount_boot_partition -} +mount-boot_pkg_postrm() { :; } diff --git a/eclass/mozconfig-v6.60.eclass b/eclass/mozconfig-v6.60.eclass index 4cbf6fe9618b..6572fae3f7bb 100644 --- a/eclass/mozconfig-v6.60.eclass +++ b/eclass/mozconfig-v6.60.eclass @@ -1,6 +1,9 @@ # Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # +# @DEAD +# All consumers are gone. Removal in 14 days +# # @ECLASS: mozconfig-v6.60.eclass # @MAINTAINER: # mozilla team <mozilla@gentoo.org> diff --git a/eclass/nvidia-driver.eclass b/eclass/nvidia-driver.eclass index a8631947748a..8c108a9c338e 100644 --- a/eclass/nvidia-driver.eclass +++ b/eclass/nvidia-driver.eclass @@ -6,12 +6,12 @@ # Jeroen Roovers <jer@gentoo.org> # @AUTHOR: # Original author: Doug Goldstein <cardoe@gentoo.org> -# @BLURB: Provide useful messages for nvidia-drivers based on currently installed Nvidia card +# @BLURB: Provide useful messages for nvidia-drivers # @DESCRIPTION: -# Provide useful messages for nvidia-drivers based on currently installed Nvidia -# card. It inherits versionator. +# Provide useful messages for nvidia-drivers based on currently installed +# Nvidia GPU and Linux kernel. -inherit readme.gentoo-r1 versionator +inherit readme.gentoo-r1 DEPEND="sys-apps/pciutils" RESTRICT="bindist mirror test" @@ -105,10 +105,10 @@ mask_304x=">=x11-drivers/nvidia-drivers-305.0.0" mask_340x=">=x11-drivers/nvidia-drivers-341.0.0" mask_390x=">=x11-drivers/nvidia-drivers-391.0.0" -# @FUNCTION: nvidia-driver-get-card +# @FUNCTION: nvidia-driver_get_gpu # @DESCRIPTION: -# Retrieve the PCI device ID for each Nvidia video card you have -nvidia-driver-get-card() { +# Retrieve the PCI device ID for each Nvidia GPU you have +nvidia-driver_get_gpu() { local NVIDIA_CARD=$( [ -x /usr/sbin/lspci ] && /usr/sbin/lspci -d 10de: -n \ | awk -F'[: ]' '/ 03[0-9][0-9]: /{print $6}' @@ -121,48 +121,48 @@ nvidia-driver-get-card() { fi } -nvidia-driver-get-mask() { - local NVIDIA_CARDS="$(nvidia-driver-get-card)" - local card drv +nvidia-driver_get_mask() { + local nvidia_gpus="$(nvidia-driver_get_gpu)" + local nvidia_gpu drv - for card in ${NVIDIA_CARDS}; do + for nvidia_gpu in ${nvidia_gpus}; do for drv in ${drv_71xx}; do - if [ "x${card}" = "x${drv}" ]; then + if [ "x${nvidia_gpu}" = "x${drv}" ]; then echo "${mask_71xx}" return 0 fi done for drv in ${drv_96xx}; do - if [ "x${card}" = "x${drv}" ]; then + if [ "x${nvidia_gpu}" = "x${drv}" ]; then echo "${mask_96xx}" return 0 fi done for drv in ${drv_173x}; do - if [ "x${card}" = "x${drv}" ]; then + if [ "x${nvidia_gpu}" = "x${drv}" ]; then echo "${mask_173x}" return 0 fi done for drv in ${drv_304x}; do - if [ "x${card}" = "x${drv}" ]; then + if [ "x${nvidia_gpu}" = "x${drv}" ]; then echo "${mask_304x}" return 0 fi done for drv in ${drv_340x}; do - if [ "x${card}" = "x${drv}" ]; then + if [ "x${nvidia_gpu}" = "x${drv}" ]; then echo "${mask_340x}" return 0 fi done for drv in ${drv_390x}; do - if [ "x${card}" = "x${drv}" ]; then + if [ "x${nvidia_gpu}" = "x${drv}" ]; then echo "${mask_390x}" return 0 fi @@ -173,27 +173,26 @@ nvidia-driver-get-mask() { return 1 } -# @FUNCTION: nvidia-driver-check-warning +# @FUNCTION: nvidia-driver_check_gpu # @DESCRIPTION: -# Prints out a warning if the driver does not work w/ the installed video card -nvidia-driver-check-warning() { - local NVIDIA_MASK="$(nvidia-driver-get-mask)" +# Prints out a warning if the driver does not work with the installed GPU +nvidia-driver_check_gpu() { + local nvidia_mask="$(nvidia-driver_get_mask)" - if [ -n "${NVIDIA_MASK}" ]; then - version_compare "${NVIDIA_MASK##*-}" "${PV}" - if [ x"${?}" = x1 ]; then + if [ -n "${nvidia_mask}" ]; then + if ver_test "${nvidia_mask##*-}" -lt "${PV}" ; then ewarn "***** WARNING *****" ewarn ewarn "You are currently installing a version of nvidia-drivers that is" - ewarn "known not to work with a video card you have installed on your" - ewarn "system. If this is intentional, please ignore this. If it is not" - ewarn "please perform the following steps:" + ewarn "known not to work with a GPU you have installed on your system." + ewarn "If this is intentional, please ignore this. If it is not please" + ewarn "perform the following steps:" ewarn - ewarn "Add the following mask entry to /etc/portage/package.mask by" + ewarn "Add the following mask entry to the local package.mask file:" if [ -d "${ROOT}/etc/portage/package.mask" ]; then - ewarn "echo \"${NVIDIA_MASK}\" > /etc/portage/package.mask/nvidia-drivers" + ewarn "echo \"${nvidia_mask}\" > /etc/portage/package.mask/nvidia-drivers" else - ewarn "echo \"${NVIDIA_MASK}\" >> /etc/portage/package.mask" + ewarn "echo \"${nvidia_mask}\" >> /etc/portage/package.mask" fi ewarn ewarn "Failure to perform the steps above could result in a non-working" @@ -204,3 +203,37 @@ nvidia-driver-check-warning() { fi fi } + +nvidia-driver_check_kernel() { + if kernel_is ge $(ver_cut 1 ${NV_KV_MAX_PLUS}) $(ver_cut 2 ${NV_KV_MAX_PLUS}); then + ewarn "Gentoo supports kernels which are supported by NVIDIA" + ewarn "which are limited to the following kernels:" + ewarn "<sys-kernel/gentoo-sources-${NV_KV_MAX_PLUS}" + ewarn "<sys-kernel/vanilla-sources-${NV_KV_MAX_PLUS}" + ewarn "" + ewarn "You are free to utilize eapply_user to provide whatever" + ewarn "support you feel is appropriate, but will not receive" + ewarn "support as a result of those changes." + ewarn "" + ewarn "Do not file a bug report about this." + ewarn "" + fi + + check_extra_config +} + +nvidia-driver_check() { + if use amd64 && has_multilib_profile && \ + [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default ABI" + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + # Since Nvidia ships many different series of drivers, we need to give the user + # some kind of guidance as to what version they should install. This tries + # to point the user in the right direction but can't be perfect. check + # nvidia-driver.eclass + nvidia-driver_check_gpu + + use kernel_linux && nvidia-driver_check_kernel +} diff --git a/eclass/oasis.eclass b/eclass/oasis.eclass index 53db4b777271..3071243265b2 100644 --- a/eclass/oasis.eclass +++ b/eclass/oasis.eclass @@ -1,9 +1,9 @@ -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: oasis.eclass # @MAINTAINER: -# ml@gentoo.org +# maintainer-needed@gentoo.org # @AUTHOR: # Original Author: Alexis Ballier <aballier@gentoo.org> # @SUPPORTED_EAPIS: 3 4 5 6 7 @@ -60,7 +60,10 @@ esac IUSE="+ocamlopt" [ -n "${OASIS_NO_DEBUG}" ] || IUSE="${IUSE} debug" [ -n "${OASIS_BUILD_DOCS}" ] && IUSE="${IUSE} doc" -[ -n "${OASIS_BUILD_TESTS}" ] && IUSE="${IUSE} test" +if [[ -n ${OASIS_BUILD_TESTS} ]]; then + IUSE+=" test" + RESTRICT+=" !test? ( test )" +fi DEPEND="${RDEPEND} dev-ml/ocamlbuild" diff --git a/eclass/opam.eclass b/eclass/opam.eclass index 5cd6748929cf..382dc00e511b 100644 --- a/eclass/opam.eclass +++ b/eclass/opam.eclass @@ -1,9 +1,9 @@ -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: opam.eclass # @MAINTAINER: -# Gentoo ML Project <ml@gentoo.org> +# maintainer-needed@gentoo.org # @AUTHOR: # Alexis Ballier <aballier@gentoo.org> # @SUPPORTED_EAPIS: 5 6 7 diff --git a/eclass/pam.eclass b/eclass/pam.eclass index be6e7f83b27a..271751131b59 100644 --- a/eclass/pam.eclass +++ b/eclass/pam.eclass @@ -94,7 +94,7 @@ newpamsecurity() { # @DESCRIPTION: # Returns the pam modules' directory for current implementation getpam_mod_dir() { - if has_version sys-libs/pam || has_version sys-libs/openpam; then + if has_version sys-libs/pam; then PAM_MOD_DIR=/$(get_libdir)/security else # Unable to find PAM implementation... defaulting diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass index db8f23647cd1..3863ef6fa849 100644 --- a/eclass/python-any-r1.eclass +++ b/eclass/python-any-r1.eclass @@ -156,7 +156,7 @@ _python_any_set_globals() { python_export "${i}" PYTHON_PKG_DEP # note: need to strip '=' slot operator for || deps - deps="${PYTHON_PKG_DEP%=} ${deps}" + deps="${PYTHON_PKG_DEP/:0=/:0} ${deps}" done deps="|| ( ${deps})" diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass index b06413170ae5..e87b59967cde 100644 --- a/eclass/python-r1.eclass +++ b/eclass/python-r1.eclass @@ -195,11 +195,7 @@ _python_set_globals() { # but no point in making this overcomplex, BDEP doesn't hurt anyone # 2) python-exec should be built with all targets forced anyway # but if new targets were added, we may need to force a rebuild - if [[ ${_PYTHON_WANT_PYTHON_EXEC2} == 0 ]]; then - die "python-exec:0 is no longer supported, please fix your ebuild to work with python-exec:2" - else - deps+=">=dev-lang/python-exec-2:=[${usedep}]" - fi + deps+=">=dev-lang/python-exec-2:=[${usedep}]" if [[ ${PYTHON_DEPS+1} ]]; then # IUSE is magical, so we can't really check it @@ -276,9 +272,47 @@ _python_validate_useflags() { die "No supported Python implementation in PYTHON_TARGETS." } +# @FUNCTION: _python_gen_usedep +# @INTERNAL +# @USAGE: [<pattern>...] +# @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 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. +# +# This is an internal function used to implement python_gen_cond_dep +# and deprecated python_gen_usedep. +_python_gen_usedep() { + debug-print-function ${FUNCNAME} "${@}" + + local impl matches=() + + for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do + if _python_impl_matches "${impl}" "${@}"; then + matches+=( + "python_targets_${impl}(-)?" + "-python_single_target_${impl}(-)" + ) + fi + done + + [[ ${matches[@]} ]] || die "No supported implementations match python_gen_usedep patterns: ${@}" + + local out=${matches[@]} + 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. @@ -306,25 +340,16 @@ _python_validate_useflags() { python_gen_usedep() { debug-print-function ${FUNCNAME} "${@}" - local impl matches=() - - for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do - if _python_impl_matches "${impl}" "${@}"; then - matches+=( - "python_targets_${impl}(-)?" - "-python_single_target_${impl}(-)" - ) - fi - done - - [[ ${matches[@]} ]] || die "No supported implementations match python_gen_usedep patterns: ${@}" - - local out=${matches[@]} - echo "${out// /,}" + # 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 + _python_gen_usedep "${@}" } # @FUNCTION: python_gen_useflags -# @USAGE: <pattern> [...] +# @USAGE: [<pattern>...] # @DESCRIPTION: # Output a list of USE flags for Python implementations which # are both in PYTHON_COMPAT and match any of the patterns passed @@ -361,7 +386,7 @@ python_gen_useflags() { } # @FUNCTION: python_gen_cond_dep -# @USAGE: <dependency> <pattern> [...] +# @USAGE: <dependency> [<pattern>...] # @DESCRIPTION: # Output a list of <dependency>-ies made conditional to USE flags # of Python implementations which are both in PYTHON_COMPAT and match @@ -405,7 +430,7 @@ python_gen_cond_dep() { # (since python_gen_usedep() will not return ${PYTHON_USEDEP} # the code is run at most once) if [[ ${dep} == *'${PYTHON_USEDEP}'* ]]; then - local usedep=$(python_gen_usedep "${@}") + local usedep=$(_python_gen_usedep "${@}") dep=${dep//\$\{PYTHON_USEDEP\}/${usedep}} fi @@ -457,9 +482,8 @@ python_gen_impl_dep() { local PYTHON_REQ_USE=${1} shift - local patterns=( "${@-*}" ) for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do - if _python_impl_matches "${impl}" "${patterns[@]}"; then + if _python_impl_matches "${impl}" "${@}"; then local PYTHON_PKG_DEP python_export "${impl}" PYTHON_PKG_DEP matches+=( "python_targets_${impl}? ( ${PYTHON_PKG_DEP} )" ) @@ -537,13 +561,13 @@ python_gen_any_dep() { local i PYTHON_PKG_DEP out= for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do - if _python_impl_matches "${i}" "${@-*}"; then + if _python_impl_matches "${i}" "${@}"; then local PYTHON_USEDEP="python_targets_${i}(-),python_single_target_${i}(+)" python_export "${i}" PYTHON_PKG_DEP local i_depstr=${depstr//\$\{PYTHON_USEDEP\}/${PYTHON_USEDEP}} # note: need to strip '=' slot operator for || deps - out="( ${PYTHON_PKG_DEP%=} ${i_depstr} ) ${out}" + out="( ${PYTHON_PKG_DEP/:0=/:0} ${i_depstr} ) ${out}" fi done echo "|| ( ${out})" @@ -734,7 +758,7 @@ python_setup() { fi # check patterns - _python_impl_matches "${impl}" "${@-*}" || continue + _python_impl_matches "${impl}" "${@}" || continue python_export "${impl}" EPYTHON PYTHON @@ -763,36 +787,6 @@ python_setup() { python_wrapper_setup } -# @FUNCTION: python_export_best -# @USAGE: [<variable>...] -# @DESCRIPTION: -# Find the best (most preferred) Python implementation enabled -# and export given variables for it. If no variables are provided, -# EPYTHON & PYTHON will be exported. -python_export_best() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${EAPI} == [45] ]] || die "${FUNCNAME} is banned in EAPI ${EAPI}" - - eqawarn "python_export_best() is deprecated. Please use python_setup instead," - eqawarn "combined with python_export if necessary." - - [[ ${#} -gt 0 ]] || set -- EPYTHON PYTHON - - local best MULTIBUILD_VARIANTS - _python_obtain_impls - - _python_set_best() { - best=${MULTIBUILD_VARIANT} - } - multibuild_for_best_variant _python_set_best - unset -f _python_set_best - - debug-print "${FUNCNAME}: Best implementation is: ${best}" - python_export "${best}" "${@}" - python_wrapper_setup -} - # @FUNCTION: python_replicate_script # @USAGE: <path>... # @DESCRIPTION: diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass index 8ac17b7815e2..f042bf4e1167 100644 --- a/eclass/python-single-r1.eclass +++ b/eclass/python-single-r1.eclass @@ -12,12 +12,17 @@ # @DESCRIPTION: # An extension of the python-r1 eclass suite for packages which # don't support being installed for multiple Python implementations. -# This mostly includes tools embedding Python. +# This mostly includes tools embedding Python and packages using foreign +# build systems. # -# This eclass extends the IUSE and REQUIRED_USE set by python-r1 -# to request the PYTHON_SINGLE_TARGET when the inheriting ebuild -# can be supported by more than one Python implementation. It also -# replaces PYTHON_USEDEP and PYTHON_DEPS with a more suitable form. +# This eclass sets correct IUSE. It also provides PYTHON_DEPS +# and PYTHON_REQUIRED_USE that need to be added to appropriate ebuild +# metadata variables. +# +# The eclass exports PYTHON_SINGLE_USEDEP that is suitable for depending +# on other packages using the eclass. Dependencies on packages using +# python-r1 should be created via python_gen_cond_dep() function, +# using PYTHON_MULTI_USEDEP placeholder. # # Please note that packages support multiple Python implementations # (using python-r1 eclass) can not depend on packages not supporting @@ -136,6 +141,9 @@ EXPORT_FUNCTIONS pkg_setup # @ECLASS-VARIABLE: PYTHON_USEDEP # @DESCRIPTION: +# DEPRECATED. Use PYTHON_SINGLE_USEDEP or python_gen_cond_dep with +# PYTHON_MULTI_USEDEP placeholder instead. +# # This is an eclass-generated USE-dependency string which can be used to # depend on another Python package being built for the same Python # implementations. @@ -154,6 +162,43 @@ EXPORT_FUNCTIONS pkg_setup # python_targets_python2_7(-)?,python_single_target_python3_4(+)? # @CODE +# @ECLASS-VARIABLE: PYTHON_SINGLE_USEDEP +# @DESCRIPTION: +# This is an eclass-generated USE-dependency string which can be used to +# depend on another python-single-r1 package being built for the same +# Python implementations. +# +# If you need to depend on a multi-impl (python-r1) package, use +# python_gen_cond_dep with PYTHON_MULTI_USEDEP placeholder instead. +# +# Example use: +# @CODE +# RDEPEND="dev-python/foo[${PYTHON_SINGLE_USEDEP}]" +# @CODE +# +# Example value: +# @CODE +# python_single_target_python3_4(-)? +# @CODE + +# @ECLASS-VARIABLE: PYTHON_MULTI_USEDEP +# @DESCRIPTION: +# This is a placeholder variable supported by python_gen_cond_dep, +# in order to depend on python-r1 packages built for the same Python +# implementations. +# +# Example use: +# @CODE +# RDEPEND="$(python_gen_cond_dep ' +# dev-python/foo[${PYTHON_MULTI_USEDEP}] +# ')" +# @CODE +# +# Example value: +# @CODE +# python_targets_python3_4(-) +# @CODE + # @ECLASS-VARIABLE: PYTHON_REQUIRED_USE # @DESCRIPTION: # This is an eclass-generated required-use expression which ensures the following @@ -179,58 +224,42 @@ EXPORT_FUNCTIONS pkg_setup _python_single_set_globals() { _python_set_impls - local i PYTHON_PKG_DEP - local flags_mt=( "${_PYTHON_SUPPORTED_IMPLS[@]/#/python_targets_}" ) local flags=( "${_PYTHON_SUPPORTED_IMPLS[@]/#/python_single_target_}" ) local unflags=( "${_PYTHON_UNSUPPORTED_IMPLS[@]/#/-python_single_target_}" ) - local optflags=${flags_mt[@]/%/(-)?},${unflags[@]/%/(-)} - - IUSE="${flags_mt[*]}" - - local deps requse usedep if [[ ${#_PYTHON_SUPPORTED_IMPLS[@]} -eq 1 ]]; then - # There is only one supported implementation; set IUSE and other - # variables without PYTHON_SINGLE_TARGET. - requse=${flags_mt[*]} - python_export "${_PYTHON_SUPPORTED_IMPLS[0]}" PYTHON_PKG_DEP - deps="${flags_mt[*]}? ( ${PYTHON_PKG_DEP} ) " - # Force on the python_single_target_* flag for this impl, so - # that any dependencies that inherit python-single-r1 and - # happen to have multiple implementations will still need - # to bound by the implementation used by this package. - optflags+=,${flags[0]/%/(+)} - else - # Multiple supported implementations; honor PYTHON_SINGLE_TARGET. - IUSE+=" ${flags[*]}" - requse="^^ ( ${flags[*]} )" - # Ensure deps honor the same python_single_target_* flag as is set - # on this package. - optflags+=,${flags[@]/%/(+)?} - - for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do - # The chosen targets need to be in PYTHON_TARGETS as well. - # This is in order to enforce correct dependencies on packages - # supporting multiple implementations. - requse+=" python_single_target_${i}? ( python_targets_${i} )" - - python_export "${i}" PYTHON_PKG_DEP - deps+="python_single_target_${i}? ( ${PYTHON_PKG_DEP} ) " - done - fi - usedep=${optflags// /,} - - # 1) well, python-exec would suffice as an RDEP - # but no point in making this overcomplex, BDEP doesn't hurt anyone - # 2) python-exec should be built with all targets forced anyway - # but if new targets were added, we may need to force a rebuild - if [[ ${_PYTHON_WANT_PYTHON_EXEC2} == 0 ]]; then - die "python-exec:0 is no longer supported, please fix your ebuild to work with python-exec:2" + # if only one implementation is supported, use IUSE defaults + # to avoid requesting the user to enable it + IUSE="+${flags_mt[0]} +${flags[0]}" else - deps+=">=dev-lang/python-exec-2:=[${usedep}]" + IUSE="${flags_mt[*]} ${flags[*]}" fi + local requse="^^ ( ${flags[*]} )" + local optflags="${flags_mt[@]/%/(-)?},${unflags[@]/%/(-)},${flags[@]/%/(+)?}" + local usedep="${optflags// /,}" + local single_flags="${flags[@]/%/(-)?}" + local single_usedep=${single_flags// /,} + + local deps= i PYTHON_PKG_DEP + for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do + # The chosen targets need to be in PYTHON_TARGETS as well. + # This is in order to enforce correct dependencies on packages + # supporting multiple implementations. + requse+=" python_single_target_${i}? ( python_targets_${i} )" + + python_export "${i}" PYTHON_PKG_DEP + # 1) well, python-exec would suffice as an RDEP + # but no point in making this overcomplex, BDEP doesn't hurt anyone + # 2) python-exec should be built with all targets forced anyway + # but if new targets were added, we may need to force a rebuild + deps+="python_single_target_${i}? ( + ${PYTHON_PKG_DEP} + >=dev-lang/python-exec-2:=[python_targets_${i}] + ) " + done + if [[ ${PYTHON_DEPS+1} ]]; then if [[ ${PYTHON_DEPS} != "${deps}" ]]; then eerror "PYTHON_DEPS have changed between inherits (PYTHON_REQ_USE?)!" @@ -253,11 +282,20 @@ _python_single_set_globals() { eerror "Now : ${usedep}" die "PYTHON_USEDEP integrity check failed" fi + + if [[ ${PYTHON_SINGLE_USEDEP} != "${single_usedep}" ]]; then + eerror "PYTHON_SINGLE_USEDEP have changed between inherits!" + eerror "Before: ${PYTHON_SINGLE_USEDEP}" + eerror "Now : ${single_usedep}" + die "PYTHON_SINGLE_USEDEP integrity check failed" + fi else PYTHON_DEPS=${deps} PYTHON_REQUIRED_USE=${requse} PYTHON_USEDEP=${usedep} - readonly PYTHON_DEPS PYTHON_REQUIRED_USE PYTHON_USEDEP + PYTHON_SINGLE_USEDEP=${single_usedep} + readonly PYTHON_DEPS PYTHON_REQUIRED_USE PYTHON_USEDEP \ + PYTHON_SINGLE_USEDEP fi } _python_single_set_globals @@ -265,9 +303,61 @@ unset -f _python_single_set_globals if [[ ! ${_PYTHON_SINGLE_R1} ]]; then +# @FUNCTION: _python_gen_usedep +# @INTERNAL +# @USAGE: <-s|-u> [<pattern>...] +# @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 first argument specifies USE-dependency type: '-s' for new-style +# PYTHON_SINGLE_USEDEP, '-u' for backwards-compatible PYTHON_USEDEP. +# +# 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. +# +# This is an internal function used to implement python_gen_cond_dep +# and deprecated python_gen_usedep. +_python_gen_usedep() { + debug-print-function ${FUNCNAME} "${@}" + + local mode=${1} + shift + local impl matches=() + + for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do + if _python_impl_matches "${impl}" "${@}"; then + case ${mode} in + -s) + matches+=( + "python_single_target_${impl}(-)?" + ) + ;; + -u) + matches+=( + "python_targets_${impl}(-)?" + "python_single_target_${impl}(+)?" + ) + ;; + esac + fi + done + + [[ ${matches[@]} ]] || die "No supported implementations match python_gen_usedep patterns: ${@}" + + local out=${matches[@]} + 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. @@ -295,25 +385,16 @@ if [[ ! ${_PYTHON_SINGLE_R1} ]]; then python_gen_usedep() { debug-print-function ${FUNCNAME} "${@}" - local impl matches=() - - for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do - if _python_impl_matches "${impl}" "${@}"; then - matches+=( - "python_targets_${impl}(-)?" - "python_single_target_${impl}(+)?" - ) - fi - done - - [[ ${matches[@]} ]] || die "No supported implementations match python_gen_usedep patterns: ${@}" - - local out=${matches[@]} - echo "${out// /,}" + # 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 + _python_gen_usedep -u "${@}" } # @FUNCTION: python_gen_useflags -# @USAGE: <pattern> [...] +# @USAGE: [<pattern>...] # @DESCRIPTION: # Output a list of USE flags for Python implementations which # are both in PYTHON_COMPAT and match any of the patterns passed @@ -338,17 +419,11 @@ python_gen_usedep() { python_gen_useflags() { debug-print-function ${FUNCNAME} "${@}" - local flag_prefix impl matches=() - - if [[ ${#_PYTHON_SUPPORTED_IMPLS[@]} -eq 1 ]]; then - flag_prefix=python_targets - else - flag_prefix=python_single_target - fi + local impl matches=() for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do if _python_impl_matches "${impl}" "${@}"; then - matches+=( "${flag_prefix}_${impl}" ) + matches+=( "python_single_target_${impl}" ) fi done @@ -356,7 +431,7 @@ python_gen_useflags() { } # @FUNCTION: python_gen_cond_dep -# @USAGE: <dependency> <pattern> [...] +# @USAGE: <dependency> [<pattern>...] # @DESCRIPTION: # Output a list of <dependency>-ies made conditional to USE flags # of Python implementations which are both in PYTHON_COMPAT and match @@ -369,7 +444,8 @@ python_gen_useflags() { # 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 +# '${PYTHON_USEDEP}', '${PYTHON_SINGLE_USEDEP}' +# and '${PYTHON_MULTI_USEDEP}' (quoted!) may be placed in the dependency # specification. It will get expanded within the function into a proper # USE dependency string. # @@ -377,7 +453,7 @@ python_gen_useflags() { # @CODE # PYTHON_COMPAT=( python{2_7,3_{3,4}} pypy ) # RDEPEND="$(python_gen_cond_dep \ -# 'dev-python/unittest2[${PYTHON_USEDEP}]' python2_7 pypy )" +# 'dev-python/unittest2[${PYTHON_MULTI_USEDEP}]' python2_7 pypy )" # @CODE # # It will cause the variable to look like: @@ -390,13 +466,7 @@ python_gen_useflags() { python_gen_cond_dep() { debug-print-function ${FUNCNAME} "${@}" - local flag_prefix impl matches=() - - if [[ ${#_PYTHON_SUPPORTED_IMPLS[@]} -eq 1 ]]; then - flag_prefix=python_targets - else - flag_prefix=python_single_target - fi + local impl matches=() local dep=${1} shift @@ -407,11 +477,17 @@ python_gen_cond_dep() { # (since python_gen_usedep() will not return ${PYTHON_USEDEP} # the code is run at most once) if [[ ${dep} == *'${PYTHON_USEDEP}'* ]]; then - local usedep=$(python_gen_usedep "${@}") + local usedep=$(_python_gen_usedep -u "${@}") dep=${dep//\$\{PYTHON_USEDEP\}/${usedep}} fi + if [[ ${dep} == *'${PYTHON_SINGLE_USEDEP}'* ]]; then + local usedep=$(_python_gen_usedep -s "${@}") + dep=${dep//\$\{PYTHON_SINGLE_USEDEP\}/${usedep}} + fi + local multi_usedep="python_targets_${impl}(-)" - matches+=( "${flag_prefix}_${impl}? ( ${dep} )" ) + matches+=( "python_single_target_${impl}? ( + ${dep//\$\{PYTHON_MULTI_USEDEP\}/${multi_usedep}} )" ) fi done @@ -455,24 +531,17 @@ python_gen_cond_dep() { python_gen_impl_dep() { debug-print-function ${FUNCNAME} "${@}" - local impl pattern + local impl local matches=() - if [[ ${#_PYTHON_SUPPORTED_IMPLS[@]} -eq 1 ]]; then - flag_prefix=python_targets - else - flag_prefix=python_single_target - fi - local PYTHON_REQ_USE=${1} shift - local patterns=( "${@-*}" ) for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do - if _python_impl_matches "${impl}" "${patterns[@]}"; then + if _python_impl_matches "${impl}" "${@}"; then local PYTHON_PKG_DEP python_export "${impl}" PYTHON_PKG_DEP - matches+=( "${flag_prefix}_${impl}? ( ${PYTHON_PKG_DEP} )" ) + matches+=( "python_single_target_${impl}? ( ${PYTHON_PKG_DEP} )" ) fi done @@ -505,47 +574,35 @@ python_setup() { return fi - if [[ ${#_PYTHON_SUPPORTED_IMPLS[@]} -eq 1 ]]; then - if use "python_targets_${_PYTHON_SUPPORTED_IMPLS[0]}"; then - # Only one supported implementation, enable it explicitly - python_export "${_PYTHON_SUPPORTED_IMPLS[0]}" EPYTHON PYTHON + local impl + for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do + if use "python_single_target_${impl}"; then + if [[ ${EPYTHON} ]]; then + eerror "Your PYTHON_SINGLE_TARGET setting lists more than a single Python" + eerror "implementation. Please set it to just one value. If you need" + eerror "to override the value for a single package, please use package.env" + eerror "or an equivalent solution (man 5 portage)." + echo + die "More than one implementation in PYTHON_SINGLE_TARGET." + fi + + if ! use "python_targets_${impl}"; then + eerror "The implementation chosen as PYTHON_SINGLE_TARGET must be added" + eerror "to PYTHON_TARGETS as well. This is in order to ensure that" + eerror "dependencies are satisfied correctly. We're sorry" + eerror "for the inconvenience." + echo + die "Build target (${impl}) not in PYTHON_TARGETS." + fi + + python_export "${impl}" EPYTHON PYTHON python_wrapper_setup fi - else - local impl - for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do - if use "python_single_target_${impl}"; then - if [[ ${EPYTHON} ]]; then - eerror "Your PYTHON_SINGLE_TARGET setting lists more than a single Python" - eerror "implementation. Please set it to just one value. If you need" - eerror "to override the value for a single package, please use package.env" - eerror "or an equivalent solution (man 5 portage)." - echo - die "More than one implementation in PYTHON_SINGLE_TARGET." - fi - - if ! use "python_targets_${impl}"; then - eerror "The implementation chosen as PYTHON_SINGLE_TARGET must be added" - eerror "to PYTHON_TARGETS as well. This is in order to ensure that" - eerror "dependencies are satisfied correctly. We're sorry" - eerror "for the inconvenience." - echo - die "Build target (${impl}) not in PYTHON_TARGETS." - fi - - python_export "${impl}" EPYTHON PYTHON - python_wrapper_setup - fi - done - fi + done if [[ ! ${EPYTHON} ]]; then eerror "No Python implementation selected for the build. Please set" - if [[ ${#_PYTHON_SUPPORTED_IMPLS[@]} -eq 1 ]]; then - eerror "the PYTHON_TARGETS variable in your make.conf to include one" - else - eerror "the PYTHON_SINGLE_TARGET variable in your make.conf to one" - fi + eerror "the PYTHON_SINGLE_TARGET variable in your make.conf to one" eerror "of the following values:" eerror eerror "${_PYTHON_SUPPORTED_IMPLS[@]}" diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index 647eb04344d2..3eadc50f93e6 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -164,11 +164,12 @@ _python_set_impls() { } # @FUNCTION: _python_impl_matches -# @USAGE: <impl> <pattern>... +# @USAGE: <impl> [<pattern>...] # @INTERNAL # @DESCRIPTION: # Check whether the specified <impl> matches at least one # 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: @@ -176,17 +177,17 @@ _python_set_impls() { # b) '-2' to indicate all Python 2 variants (= !python_is_python3) # c) '-3' to indicate all Python 3 variants (= python_is_python3) _python_impl_matches() { - [[ ${#} -ge 2 ]] || die "${FUNCNAME}: takes at least 2 parameters" + [[ ${#} -ge 1 ]] || die "${FUNCNAME}: takes at least 1 parameter" + [[ ${#} -eq 1 ]] && return 0 local impl=${1} pattern shift for pattern; do if [[ ${pattern} == -2 ]]; then - ! python_is_python3 "${impl}" - return + python_is_python3 "${impl}" || return 0 elif [[ ${pattern} == -3 ]]; then - python_is_python3 "${impl}" + python_is_python3 "${impl}" && return 0 return # unify value style to allow lax matching elif [[ ${impl/./_} == ${pattern/./_} ]]; then @@ -1344,6 +1345,31 @@ python_export_utf8_locale() { return 0 } +# @FUNCTION: build_sphinx +# @USAGE: <directory> +# @DESCRIPTION: +# Build HTML documentation using dev-python/sphinx in the specified +# <directory>. Takes care of disabling Intersphinx and appending +# to HTML_DOCS. +# +# If <directory> is relative to the current directory, care needs +# to be taken to run einstalldocs from the same directory +# (usually ${S}). +build_sphinx() { + debug-print-function ${FUNCNAME} "${@}" + [[ ${#} -eq 1 ]] || die "${FUNCNAME} takes 1 arg: <directory>" + + local dir=${1} + + sed -i -e 's:^intersphinx_mapping:disabled_&:' \ + "${dir}"/conf.py || die + # not all packages include the Makefile in pypi tarball + sphinx-build -b html -d "${dir}"/_build/doctrees "${dir}" \ + "${dir}"/_build/html || die + + HTML_DOCS+=( "${dir}/_build/html/." ) +} + # -- python.eclass functions -- _python_check_dead_variables() { diff --git a/eclass/qmake-utils.eclass b/eclass/qmake-utils.eclass index 67e13d7006b4..cf287ee8d7ed 100644 --- a/eclass/qmake-utils.eclass +++ b/eclass/qmake-utils.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: qmake-utils.eclass @@ -6,6 +6,7 @@ # qt@gentoo.org # @AUTHOR: # Davide Pesavento <pesa@gentoo.org> +# @SUPPORTED_EAPIS: 6 7 # @BLURB: Common functions for qmake-based packages. # @DESCRIPTION: # Utility eclass providing wrapper functions for Qt4 and Qt5 qmake. @@ -16,7 +17,8 @@ if [[ -z ${_QMAKE_UTILS_ECLASS} ]]; then _QMAKE_UTILS_ECLASS=1 -[[ ${EAPI:-0} == [012345] ]] && inherit eutils multilib +[[ ${EAPI:-0} == [012345] ]] && die "qmake-utils.eclass: unsupported EAPI=${EAPI:-0}" + inherit estack toolchain-funcs # @FUNCTION: qt4_get_bindir @@ -25,7 +27,6 @@ inherit estack toolchain-funcs # EPREFIX is already prepended to the returned path. qt4_get_bindir() { [[ ${EAPI:-0} == [0123456] ]] || die "${FUNCNAME[1]} is banned in EAPI 7 and later" - has "${EAPI:-0}" 0 1 2 && use !prefix && EPREFIX= local qtbindir=${EPREFIX}$(qt4_get_libdir)/bin if [[ -d ${qtbindir} ]]; then @@ -72,8 +73,6 @@ qt4_get_plugindir() { # Echoes the directory where Qt5 binaries are installed. # EPREFIX is already prepended to the returned path. qt5_get_bindir() { - has "${EAPI:-0}" 0 1 2 && use !prefix && EPREFIX= - echo ${EPREFIX}$(qt5_get_libdir)/qt5/bin } @@ -167,7 +166,6 @@ eqmake4() { debug-print-function ${FUNCNAME} "$@" [[ ${EAPI:-0} == [0123456] ]] || die "${FUNCNAME[1]} is banned in EAPI 7 and later" - has "${EAPI:-0}" 0 1 2 && use !prefix && EPREFIX= ebegin "Running qmake" diff --git a/eclass/ros-catkin.eclass b/eclass/ros-catkin.eclass index 667ecd4583f7..d560f804e65d 100644 --- a/eclass/ros-catkin.eclass +++ b/eclass/ros-catkin.eclass @@ -49,13 +49,14 @@ fi # we'd have ros_distro_gentoo_python_2_7 & co plus the OSRF ones (lunar, etc.). # Note that this uncondtionally pulls python but in the ROS world there will # most certainly be something pulling python anyway. -PYTHON_COMPAT=( python2_7 ) +PYTHON_COMPAT=( python3_6 ) inherit ${SCM} python-r1 cmake-utils flag-o-matic REQUIRED_USE="${PYTHON_REQUIRED_USE}" IUSE="test" +RESTRICT="!test? ( test )" RDEPEND="${PYTHON_DEPS}" DEPEND="${RDEPEND} dev-util/catkin[${PYTHON_USEDEP}] diff --git a/eclass/savedconfig.eclass b/eclass/savedconfig.eclass index dab2283fe0f4..8f64c5b8edd0 100644 --- a/eclass/savedconfig.eclass +++ b/eclass/savedconfig.eclass @@ -14,20 +14,20 @@ # so users can modify these config files and the ebuild will take it # into account as needed. # -# @ROFF .nr step 1 1 +# @ROFF .nr R 1 1 # Typically you can create your own configuration files quickly by # doing: -# @ROFF .IP \n[step] 3 +# @ROFF .IP \nR 3 # Build the package with FEATURES=noclean USE=savedconfig. -# @ROFF .IP \n+[step] +# @ROFF .IP \n+R # Go into the build dir and edit the relevant configuration system # (e.g. `make menuconfig` or `nano config-header.h`). You can look # at the files in /etc/portage/savedconfig/ to see what files get # loaded/restored. -# @ROFF .IP \n+[step] +# @ROFF .IP \n+R # Copy the modified configuration files out of the workdir and to # the paths in /etc/portage/savedconfig/. -# @ROFF .IP \n+[step] +# @ROFF .IP \n+R # Emerge the package with just USE=savedconfig to get the custom build. inherit portability diff --git a/eclass/sgml-catalog-r1.eclass b/eclass/sgml-catalog-r1.eclass index f466f97fdcce..1e1f17815ac4 100644 --- a/eclass/sgml-catalog-r1.eclass +++ b/eclass/sgml-catalog-r1.eclass @@ -22,7 +22,9 @@ EXPORT_FUNCTIONS pkg_postinst pkg_postrm if [[ ! ${_SGML_CATALOG_R1} ]]; then -RDEPEND=">=app-text/sgml-common-0.6.3-r7" +if [[ ${CATEGORY}/${PN} != app-text/sgml-common ]]; then + RDEPEND=">=app-text/sgml-common-0.6.3-r7" +fi # @FUNCTION: sgml-catalog-r1_update_catalog # @DESCRIPTION: diff --git a/eclass/sgml-catalog.eclass b/eclass/sgml-catalog.eclass index 5486533c2ea7..e3c228efac29 100644 --- a/eclass/sgml-catalog.eclass +++ b/eclass/sgml-catalog.eclass @@ -1,6 +1,9 @@ # Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 +# @DEAD +# All consumers are gone. Removal in 14 days + # @ECLASS: sgml-catalog.eclass # @MAINTAINER: # No maintainer <maintainer-needed@gentoo.org> diff --git a/eclass/tests/distutils-r1.sh b/eclass/tests/distutils-r1.sh index d557f6cad534..d251f85a5eb1 100755 --- a/eclass/tests/distutils-r1.sh +++ b/eclass/tests/distutils-r1.sh @@ -17,6 +17,37 @@ test-phase_name_free() { fi } +test-distutils_enable_tests() { + local runner=${1} + local exp_IUSE=${2} + local exp_RESTRICT=${3} + local exp_DEPEND=${4} + + local IUSE=${IUSE} + local RESTRICT=${RESTRICT} + local DEPEND=${DEPEND} + + tbegin "${runner}" + + distutils_enable_tests "${runner}" + + local ret var + for var in IUSE RESTRICT DEPEND; do + local exp_var=exp_${var} + if [[ ${!var} != "${!exp_var}" ]]; then + eindent + eerror "${var} expected: ${!exp_var}" + eerror "${var} actual: ${!var}" + eoutdent + ret=1 + tret=1 + fi + done + + tend ${ret} +} + +DISTUTILS_USE_SETUPTOOLS=no inherit distutils-r1 tbegin "sane function names" @@ -27,6 +58,41 @@ test-phase_name_free python_compile test-phase_name_free python_test test-phase_name_free python_install -tend ${failed} +tend + +einfo distutils_enable_tests +eindent +BASE_IUSE="python_targets_python2_7" +BASE_DEPS="python_targets_python2_7? ( >=dev-lang/python-2.7.5-r2:2.7 ) >=dev-lang/python-exec-2:=[python_targets_python2_7(-)?,-python_single_target_python2_7(-)]" +TEST_RESTRICT=" !test? ( test )" + +einfo "empty RDEPEND" +eindent +RDEPEND="" +test-distutils_enable_tests pytest \ + "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/pytest[${PYTHON_USEDEP}] )" +test-distutils_enable_tests nose \ + "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/nose[${PYTHON_USEDEP}] )" +test-distutils_enable_tests unittest \ + "${BASE_IUSE}" "" "${BASE_DEPS}" +test-distutils_enable_tests setup.py \ + "${BASE_IUSE}" "" "${BASE_DEPS}" +eoutdent + +einfo "non-empty RDEPEND" +eindent +BASE_RDEPEND="dev-python/foo[${PYTHON_USEDEP}]" +RDEPEND=${BASE_RDEPEND} +test-distutils_enable_tests pytest \ + "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/pytest[${PYTHON_USEDEP}] ${BASE_RDEPEND} )" +test-distutils_enable_tests nose \ + "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/nose[${PYTHON_USEDEP}] ${BASE_RDEPEND} )" +test-distutils_enable_tests unittest \ + "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} )" +test-distutils_enable_tests setup.py \ + "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} )" +eoutdent + +eoutdent texit diff --git a/eclass/tests/flag-o-matic.sh b/eclass/tests/flag-o-matic.sh index 691b052c3d43..b0b97ea0bc1e 100755 --- a/eclass/tests/flag-o-matic.sh +++ b/eclass/tests/flag-o-matic.sh @@ -63,7 +63,7 @@ CXXFLAGS="-O2 -B/foo -O1" LDFLAGS="-O2 -B/foo -O1" tbegin "strip-unsupported-flags for '-B/foo'" strip-unsupported-flags -[[ ${CFLAGS} == "-O2 -O1" ]] && [[ ${CXXFLAGS} == "-O2 -O1" ]] && [[ ${LDFLAGS} == "" ]] +[[ ${CFLAGS} == "-O2 -B/foo -O1" ]] && [[ ${CXXFLAGS} == "-O2 -B/foo -O1" ]] && [[ ${LDFLAGS} == "-O2 -B/foo -O1" ]] ftend CFLAGS="-O2 -B /foo -O1" @@ -71,7 +71,7 @@ CXXFLAGS="-O2 -B /foo -O1" LDFLAGS="-O2 -B /foo -O1" tbegin "strip-unsupported-flags for '-B /foo'" strip-unsupported-flags -[[ ${CFLAGS} == "-O2 -O1" ]] && [[ ${CXXFLAGS} == "-O2 -O1" ]] && [[ ${LDFLAGS} == "" ]] +[[ ${CFLAGS} == "-O2 -B /foo -O1" ]] && [[ ${CXXFLAGS} == "-O2 -B /foo -O1" ]] && [[ ${LDFLAGS} == "-O2 -B /foo -O1" ]] ftend for var in $(all-flag-vars) ; do diff --git a/eclass/tests/git-r3.sh b/eclass/tests/git-r3.sh index 6ff6226c0aa6..2f452bfd68a8 100755 --- a/eclass/tests/git-r3.sh +++ b/eclass/tests/git-r3.sh @@ -1,7 +1,12 @@ #!/bin/bash -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +# git no longer allows ext: protocol, meh +exit 0 + +EAPI=7 + source tests-common.sh inherit git-r3 diff --git a/eclass/tests/git-r3_GIT_DIR.sh b/eclass/tests/git-r3_GIT_DIR.sh index 06c4094ceb9e..c17ae7bb43c0 100755 --- a/eclass/tests/git-r3_GIT_DIR.sh +++ b/eclass/tests/git-r3_GIT_DIR.sh @@ -1,7 +1,9 @@ #!/bin/bash -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +EAPI=7 + source tests-common.sh inherit git-r3 @@ -13,6 +15,8 @@ cd "${testdir}" || die "unable to cd to testdir" EGIT3_STORE_DIR=store mkdir "${EGIT3_STORE_DIR}" || die "unable to mkdir store" +git() { :; } + # Test cleaning up canonical repo URI test_repouri() { local uri=${1} diff --git a/eclass/tests/git-r3_subrepos.sh b/eclass/tests/git-r3_subrepos.sh index 5b814328a49e..0fcf1cd08081 100755 --- a/eclass/tests/git-r3_subrepos.sh +++ b/eclass/tests/git-r3_subrepos.sh @@ -1,7 +1,9 @@ #!/bin/bash -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +EAPI=7 + source tests-common.sh inherit git-r3 diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh index 414ad5c53d6b..e883da38cead 100755 --- a/eclass/tests/python-utils-r1.sh +++ b/eclass/tests/python-utils-r1.sh @@ -1,8 +1,8 @@ #!/bin/bash -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=5 +EAPI=7 source tests-common.sh test_var() { @@ -71,17 +71,29 @@ fi test_var PYTHON_PKG_DEP python2_7 '*dev-lang/python*:2.7' test_var PYTHON_SCRIPTDIR python2_7 /usr/lib/python-exec/python2.7 -test_var EPYTHON python3_4 python3.4 -test_var PYTHON python3_4 /usr/bin/python3.4 -if [[ -x /usr/bin/python3.4 ]]; then - abiflags=$(/usr/bin/python3.4 -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS"))') - test_var PYTHON_SITEDIR python3_4 "/usr/lib*/python3.4/site-packages" - test_var PYTHON_INCLUDEDIR python3_4 "/usr/include/python3.4${abiflags}" - test_var PYTHON_LIBPATH python3_4 "/usr/lib*/libpython3.4${abiflags}$(get_libname)" - test_var PYTHON_CONFIG python3_4 "/usr/bin/python3.4${abiflags}-config" +test_var EPYTHON python3_6 python3.6 +test_var PYTHON python3_6 /usr/bin/python3.6 +if [[ -x /usr/bin/python3.6 ]]; then + abiflags=$(/usr/bin/python3.6 -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS"))') + test_var PYTHON_SITEDIR python3_6 "/usr/lib*/python3.6/site-packages" + test_var PYTHON_INCLUDEDIR python3_6 "/usr/include/python3.6${abiflags}" + test_var PYTHON_LIBPATH python3_6 "/usr/lib*/libpython3.6${abiflags}$(get_libname)" + test_var PYTHON_CONFIG python3_6 "/usr/bin/python3.6${abiflags}-config" fi -test_var PYTHON_PKG_DEP python3_4 '*dev-lang/python*:3.4' -test_var PYTHON_SCRIPTDIR python3_4 /usr/lib/python-exec/python3.4 +test_var PYTHON_PKG_DEP python3_6 '*dev-lang/python*:3.6' +test_var PYTHON_SCRIPTDIR python3_6 /usr/lib/python-exec/python3.6 + +test_var EPYTHON python3_7 python3.7 +test_var PYTHON python3_7 /usr/bin/python3.7 +if [[ -x /usr/bin/python3.7 ]]; then + abiflags=$(/usr/bin/python3.7 -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS"))') + test_var PYTHON_SITEDIR python3_7 "/usr/lib/python3.7/site-packages" + test_var PYTHON_INCLUDEDIR python3_7 "/usr/include/python3.7${abiflags}" + test_var PYTHON_LIBPATH python3_7 "/usr/lib*/libpython3.7${abiflags}$(get_libname)" + test_var PYTHON_CONFIG python3_7 "/usr/bin/python3.7${abiflags}-config" +fi +test_var PYTHON_PKG_DEP python3_7 '*dev-lang/python*:3.7' +test_var PYTHON_SCRIPTDIR python3_7 /usr/lib/python-exec/python3.7 test_var EPYTHON jython2_7 jython2.7 test_var PYTHON jython2_7 /usr/bin/jython2.7 @@ -94,8 +106,8 @@ test_var PYTHON_SCRIPTDIR jython2_7 /usr/lib/python-exec/jython2.7 test_var EPYTHON pypy pypy test_var PYTHON pypy /usr/bin/pypy if [[ -x /usr/bin/pypy ]]; then - test_var PYTHON_SITEDIR pypy "/usr/lib*/pypy/site-packages" - test_var PYTHON_INCLUDEDIR pypy "/usr/lib*/pypy/include" + test_var PYTHON_SITEDIR pypy "/usr/lib*/pypy2.7/site-packages" + test_var PYTHON_INCLUDEDIR pypy "/usr/lib*/pypy2.7/include" fi test_var PYTHON_PKG_DEP pypy '*virtual/pypy*:0=' test_var PYTHON_SCRIPTDIR pypy /usr/lib/python-exec/pypy @@ -103,8 +115,8 @@ test_var PYTHON_SCRIPTDIR pypy /usr/lib/python-exec/pypy test_var EPYTHON pypy3 pypy3 test_var PYTHON pypy3 /usr/bin/pypy3 if [[ -x /usr/bin/pypy3 ]]; then - test_var PYTHON_SITEDIR pypy3 "/usr/lib*/pypy3/site-packages" - test_var PYTHON_INCLUDEDIR pypy3 "/usr/lib*/pypy3/include" + test_var PYTHON_SITEDIR pypy3 "/usr/lib*/pypy3.?/site-packages" + test_var PYTHON_INCLUDEDIR pypy3 "/usr/lib*/pypy3.?/include" fi test_var PYTHON_PKG_DEP pypy3 '*virtual/pypy3*:0=' test_var PYTHON_SCRIPTDIR pypy3 /usr/lib/python-exec/pypy3 @@ -117,7 +129,7 @@ test_is "python_is_python3 pypy3" 0 # generic shebangs test_fix_shebang '#!/usr/bin/python' python2.7 '#!/usr/bin/python2.7' -test_fix_shebang '#!/usr/bin/python' python3.4 '#!/usr/bin/python3.4' +test_fix_shebang '#!/usr/bin/python' python3.6 '#!/usr/bin/python3.6' test_fix_shebang '#!/usr/bin/python' pypy '#!/usr/bin/pypy' test_fix_shebang '#!/usr/bin/python' pypy3 '#!/usr/bin/pypy3' test_fix_shebang '#!/usr/bin/python' jython2.7 '#!/usr/bin/jython2.7' @@ -126,9 +138,9 @@ test_fix_shebang '#!/usr/bin/python' jython2.7 '#!/usr/bin/jython2.7' test_fix_shebang '#!/usr/bin/python2' python2.7 '#!/usr/bin/python2.7' test_fix_shebang '#!/usr/bin/python3' python2.7 FAIL test_fix_shebang '#!/usr/bin/python3' python2.7 '#!/usr/bin/python2.7' --force -test_fix_shebang '#!/usr/bin/python3' python3.4 '#!/usr/bin/python3.4' -test_fix_shebang '#!/usr/bin/python2' python3.4 FAIL -test_fix_shebang '#!/usr/bin/python2' python3.4 '#!/usr/bin/python3.4' --force +test_fix_shebang '#!/usr/bin/python3' python3.6 '#!/usr/bin/python3.6' +test_fix_shebang '#!/usr/bin/python2' python3.6 FAIL +test_fix_shebang '#!/usr/bin/python2' python3.6 '#!/usr/bin/python3.6' --force # pythonX.Y matching (those mostly test the patterns) test_fix_shebang '#!/usr/bin/python2.7' python2.7 '#!/usr/bin/python2.7' @@ -145,8 +157,8 @@ test_fix_shebang '#!/usr/bin/jython2.7' jython3.2 FAIL test_fix_shebang '#!/usr/bin/jython2.7' jython3.2 '#!/usr/bin/jython3.2' --force # fancy path handling -test_fix_shebang '#!/mnt/python2/usr/bin/python' python3.4 \ - '#!/mnt/python2/usr/bin/python3.4' +test_fix_shebang '#!/mnt/python2/usr/bin/python' python3.6 \ + '#!/mnt/python2/usr/bin/python3.6' test_fix_shebang '#!/mnt/python2/usr/bin/python2' python2.7 \ '#!/mnt/python2/usr/bin/python2.7' test_fix_shebang '#!/mnt/python2/usr/bin/env python' python2.7 \ @@ -168,9 +180,11 @@ test_is "_python_impl_supported python2_7" 0 test_is "_python_impl_supported python3_1" 1 test_is "_python_impl_supported python3_2" 1 test_is "_python_impl_supported python3_3" 1 -test_is "_python_impl_supported python3_4" 0 +test_is "_python_impl_supported python3_4" 1 test_is "_python_impl_supported python3_5" 0 test_is "_python_impl_supported python3_6" 0 +test_is "_python_impl_supported python3_7" 0 +test_is "_python_impl_supported python3_8" 0 test_is "_python_impl_supported pypy1_8" 1 test_is "_python_impl_supported pypy1_9" 1 test_is "_python_impl_supported pypy2_0" 1 @@ -178,6 +192,40 @@ test_is "_python_impl_supported pypy" 0 test_is "_python_impl_supported pypy3" 0 test_is "_python_impl_supported jython2_7" 0 +# check _python_impl_matches behavior +test_is "_python_impl_matches python2_7 -2" 0 +test_is "_python_impl_matches python3_6 -2" 1 +test_is "_python_impl_matches python3_7 -2" 1 +test_is "_python_impl_matches pypy -2" 0 +test_is "_python_impl_matches pypy3 -2" 1 +test_is "_python_impl_matches python2_7 -3" 1 +test_is "_python_impl_matches python3_6 -3" 0 +test_is "_python_impl_matches python3_7 -3" 0 +test_is "_python_impl_matches pypy -3" 1 +test_is "_python_impl_matches pypy3 -3" 0 +test_is "_python_impl_matches python2_7 -2 python3_6" 0 +test_is "_python_impl_matches python3_6 -2 python3_6" 0 +test_is "_python_impl_matches python3_7 -2 python3_6" 1 +test_is "_python_impl_matches pypy -2 python3_6" 0 +test_is "_python_impl_matches pypy3 -2 python3_6" 1 +test_is "_python_impl_matches python2_7 pypy3 -2 python3_6" 0 +test_is "_python_impl_matches python3_6 pypy3 -2 python3_6" 0 +test_is "_python_impl_matches python3_7 pypy3 -2 python3_6" 1 +test_is "_python_impl_matches pypy pypy3 -2 python3_6" 0 +test_is "_python_impl_matches pypy3 pypy3 -2 python3_6" 0 +set -f +test_is "_python_impl_matches python2_7 pypy*" 1 +test_is "_python_impl_matches python3_6 pypy*" 1 +test_is "_python_impl_matches python3_7 pypy*" 1 +test_is "_python_impl_matches pypy pypy*" 0 +test_is "_python_impl_matches pypy3 pypy*" 0 +test_is "_python_impl_matches python2_7 python*" 0 +test_is "_python_impl_matches python3_6 python*" 0 +test_is "_python_impl_matches python3_7 python*" 0 +test_is "_python_impl_matches pypy python*" 1 +test_is "_python_impl_matches pypy3 python*" 1 +set +f + rm "${tmpfile}" texit diff --git a/eclass/tests/savedconfig.sh b/eclass/tests/savedconfig.sh index 19da181d8404..7643cf4cc823 100755 --- a/eclass/tests/savedconfig.sh +++ b/eclass/tests/savedconfig.sh @@ -1,7 +1,9 @@ #!/bin/bash -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +EAPI=7 + source tests-common.sh inherit savedconfig diff --git a/eclass/tests/scons-utils.sh b/eclass/tests/scons-utils.sh index 7a588863c6a9..873312f67d07 100755 --- a/eclass/tests/scons-utils.sh +++ b/eclass/tests/scons-utils.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 source tests-common.sh @@ -27,7 +27,7 @@ test-scons_clean_makeopts() { } # jobcount expected for non-specified state -jc=$(_scons_get_default_jobs) +jc=$(( $(get_nproc) + 1 )) # failed test counter failed=0 diff --git a/eclass/tests/tests-common.sh b/eclass/tests/tests-common.sh index d52cf3a2687b..674eaa02cdc9 100644 --- a/eclass/tests/tests-common.sh +++ b/eclass/tests/tests-common.sh @@ -103,3 +103,5 @@ PV="0" P="${PN}-${PV}" PF=${P} SLOT=0 + +addwrite() { :; } diff --git a/eclass/tests/toolchain-funcs.sh b/eclass/tests/toolchain-funcs.sh index 79ba6fa407b5..1cf124520c3c 100755 --- a/eclass/tests/toolchain-funcs.sh +++ b/eclass/tests/toolchain-funcs.sh @@ -54,21 +54,21 @@ tend ${ret} # # TEST: tc-ld-is-gold # -tbegin "tc-ld-is-gold (bfd selected)" -LD=ld.bfd tc-ld-is-gold && ret=1 || ret=0 +tbegin "tc-ld-is-gold (ld=bfd cc=bfd)" +LD=ld.bfd LDFLAGS=-fuse-ld=bfd tc-ld-is-gold && ret=1 || ret=0 tend ${ret} -tbegin "tc-ld-is-gold (gold selected)" +tbegin "tc-ld-is-gold (ld=gold cc=default)" LD=ld.gold tc-ld-is-gold ret=$? tend ${ret} -tbegin "tc-ld-is-gold (bfd selected via flags)" +tbegin "tc-ld-is-gold (ld=gold cc=bfd)" LD=ld.gold LDFLAGS=-fuse-ld=bfd tc-ld-is-gold ret=$? tend ${ret} -tbegin "tc-ld-is-gold (gold selected via flags)" +tbegin "tc-ld-is-gold (ld=bfd cc=gold)" LD=ld.bfd LDFLAGS=-fuse-ld=gold tc-ld-is-gold ret=$? tend ${ret} @@ -78,14 +78,14 @@ tend ${ret} # tbegin "tc-ld-disable-gold (bfd selected)" ( -export LD=ld.bfd LDFLAGS= +export LD=ld.bfd LDFLAGS=-fuse-ld=bfd ewarn() { :; } tc-ld-disable-gold -[[ ${LD} == "ld.bfd" && -z ${LDFLAGS} ]] +[[ ${LD} == "ld.bfd" && ${LDFLAGS} == "-fuse-ld=bfd" ]] ) tend $? -tbegin "tc-ld-disable-gold (gold selected)" +tbegin "tc-ld-disable-gold (ld=gold)" ( export LD=ld.gold LDFLAGS= ewarn() { :; } @@ -94,7 +94,7 @@ tc-ld-disable-gold ) tend $? -tbegin "tc-ld-disable-gold (gold selected via flags)" +tbegin "tc-ld-disable-gold (cc=gold)" ( export LD= LDFLAGS="-fuse-ld=gold" ewarn() { :; } @@ -172,8 +172,8 @@ if type -P pathcc &>/dev/null; then tend $? fi -for compiler in gcc clang; do - if type -P ${compielr} &>/dev/null; then +for compiler in gcc clang not-really-a-compiler; do + if type -P ${compiler} &>/dev/null; then tbegin "tc-cpp-is-true ($compiler, defined)" ( export CC=${compiler} diff --git a/eclass/tests/toolchain.sh b/eclass/tests/toolchain.sh index 2c09f2238d74..56609aa180e4 100755 --- a/eclass/tests/toolchain.sh +++ b/eclass/tests/toolchain.sh @@ -150,7 +150,7 @@ test_var_assert() { var_name=${1} exp=${2} - tbegin "asserv variable value: ${var_name} => ${exp}" + tbegin "assert variable value: ${var_name} => ${exp}" if [[ ${!var_name} != ${exp} ]]; then msg="Failure - Expected: \"${exp}\" Got: \"${!var_name}\"" diff --git a/eclass/toolchain-autoconf.eclass b/eclass/toolchain-autoconf.eclass index cd991ec795ac..bc22921c08d3 100644 --- a/eclass/toolchain-autoconf.eclass +++ b/eclass/toolchain-autoconf.eclass @@ -4,7 +4,7 @@ # @ECLASS: toolchain-autoconf.eclass # @MAINTAINER: # <base-system@gentoo.org> -# @SUPPORTED_EAPIS: 6 +# @SUPPORTED_EAPIS: 6 7 # @BLURB: Common code for sys-devel/autoconf ebuilds # @DESCRIPTION: # This eclass contains the common phase functions migrated from @@ -14,7 +14,7 @@ case ${EAPI:-0} in [0-5]) die "${ECLASS} is banned in EAPI ${EAPI:-0}" ;; - 6) + [6-7]) ;; *) die "Unknown EAPI ${EAPI:-0}" diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index a3081c38bac1..8929a1869fc6 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -164,11 +164,16 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then tc_version_is_at_least 4.2 && IUSE+=" +openmp" tc_version_is_at_least 4.3 && IUSE+=" fixed-point" tc_version_is_at_least 4.7 && IUSE+=" go" - # Note: while <=gcc-4.7 also supported graphite, it required forked ppl - # versions which we dropped. Since graphite was also experimental in - # the older versions, we don't want to bother supporting it. #448024 tc_version_is_at_least 4.8 && - IUSE+=" graphite +sanitize" TC_FEATURES+=(graphite) + IUSE+=" +sanitize" + # Note: + # <gcc-4.8 supported graphite, it required forked ppl + # versions which we dropped. Since graphite was also experimental in + # the older versions, we don't want to bother supporting it. #448024 + # <gcc-5 supported graphite, it required cloog + # <gcc-6.5 supported graphite, it required old incompatible isl + tc_version_is_at_least 6.5 && + IUSE+=" graphite" TC_FEATURES+=(graphite) tc_version_is_between 4.9 8 && IUSE+=" cilk" tc_version_is_at_least 4.9 && IUSE+=" +vtv" tc_version_is_at_least 5.0 && IUSE+=" jit" @@ -214,15 +219,7 @@ if tc_has_feature objc-gc ; then fi if tc_has_feature graphite ; then - if tc_version_is_at_least 5.0 ; then - RDEPEND+=" graphite? ( >=dev-libs/isl-0.14:0= )" - elif tc_version_is_at_least 4.8 ; then - RDEPEND+=" - graphite? ( - >=dev-libs/cloog-0.18.0:0= - >=dev-libs/isl-0.11.1:0= - )" - fi + RDEPEND+=" graphite? ( >=dev-libs/isl-0.14:0= )" fi DEPEND="${RDEPEND} @@ -1322,14 +1319,15 @@ toolchain_src_configure() { confgcc+=( --disable-lto ) fi - # graphite was added in 4.4 but we only support it in 4.8+ due to external - # library issues. #448024 - if tc_version_is_at_least 5.0 && in_iuse graphite ; then + # graphite was added in 4.4 but we only support it in 6.5+ due to external + # library issues. #448024, #701270 + if tc_version_is_at_least 6.5 && in_iuse graphite ; then confgcc+=( $(use_with graphite isl) ) use graphite && confgcc+=( --disable-isl-version-check ) - elif tc_version_is_at_least 4.8 && in_iuse graphite ; then - confgcc+=( $(use_with graphite cloog) ) - use graphite && confgcc+=( --disable-isl-version-check ) + elif tc_version_is_at_least 5.0 ; then + confgcc+=( --without-isl ) + elif tc_version_is_at_least 4.8 ; then + confgcc+=( --without-cloog ) elif tc_version_is_at_least 4.4 ; then confgcc+=( --without-{cloog,ppl} ) fi @@ -1831,7 +1829,7 @@ toolchain_src_install() { cd "${D}"${BINPATH} # Ugh: we really need to auto-detect this list. # It's constantly out of date. - for x in cpp gcc g++ c++ gcov g77 gcj gcjh gfortran gccgo ; do + for x in cpp gcc g++ c++ gcov g77 gcj gcjh gfortran gccgo gnat* ; do # For some reason, g77 gets made instead of ${CTARGET}-g77... # this should take care of that if [[ -f ${x} ]] ; then diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass index 40eeea5463bc..6aba6bf488dd 100644 --- a/eclass/virtualx.eclass +++ b/eclass/virtualx.eclass @@ -89,6 +89,8 @@ case ${VIRTUALX_REQUIRED} in fi RDEPEND="" IUSE="${VIRTUALX_REQUIRED}" + [[ ${VIRTUALX_REQUIRED} == test ]] && + RESTRICT+=" !test? ( test )" ;; esac |