summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass')
-rw-r--r--eclass/Manifest.gzbin35972 -> 36120 bytes
-rw-r--r--eclass/acct-user.eclass6
-rw-r--r--eclass/ada.eclass1
-rw-r--r--eclass/distutils-r1.eclass34
-rw-r--r--eclass/git-r3.eclass3
-rw-r--r--eclass/kernel-2.eclass13
-rw-r--r--eclass/mozcoreconf-v4.eclass8
-rw-r--r--eclass/mozcoreconf-v5.eclass8
-rw-r--r--eclass/mozcoreconf-v6.eclass8
-rw-r--r--eclass/multibuild.eclass5
-rw-r--r--eclass/multilib-build.eclass5
-rw-r--r--eclass/php-ext-source-r3.eclass4
-rw-r--r--eclass/python-any-r1.eclass5
-rw-r--r--eclass/python-r1.eclass10
-rw-r--r--eclass/python-single-r1.eclass10
-rw-r--r--eclass/python-utils-r1.eclass2
-rw-r--r--eclass/scons-utils.eclass2
-rwxr-xr-xeclass/tests/distutils-r1.sh72
-rwxr-xr-xeclass/tests/distutils-r1_single.sh122
19 files changed, 261 insertions, 57 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz
index b511174dc4b5..c952bb5b18bc 100644
--- a/eclass/Manifest.gz
+++ b/eclass/Manifest.gz
Binary files differ
diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass
index b66fbbf9d0c2..e82f3c56dbbe 100644
--- a/eclass/acct-user.eclass
+++ b/eclass/acct-user.eclass
@@ -143,8 +143,8 @@ acct-user_add_deps() {
# << Helper functions >>
# @FUNCTION: eislocked
-# @INTERNAL
# @USAGE: <user>
+# @INTERNAL
# @DESCRIPTION:
# Check whether the specified user account is currently locked.
# Returns 0 if it is locked, 1 if it is not, 2 if the platform
@@ -176,8 +176,8 @@ eislocked() {
}
# @FUNCTION: elockuser
-# @INTERNAL
# @USAGE: <user>
+# @INTERNAL
# @DESCRIPTION:
# Lock the specified user account, using the available platform-specific
# functions. This should prevent any login to the account.
@@ -221,8 +221,8 @@ elockuser() {
}
# @FUNCTION: eunlockuser
-# @INTERNAL
# @USAGE: <user>
+# @INTERNAL
# @DESCRIPTION:
# Unlock the specified user account, using the available platform-
# specific functions.
diff --git a/eclass/ada.eclass b/eclass/ada.eclass
index 361ffb65cd10..4b568a8c20a3 100644
--- a/eclass/ada.eclass
+++ b/eclass/ada.eclass
@@ -38,6 +38,7 @@ esac
EXPORT_FUNCTIONS pkg_setup
# @ECLASS-VARIABLE: ADA_DEPS
+# @OUTPUT_VARIABLE
# @DESCRIPTION:
# This is an eclass-generated Ada dependency string for all
# implementations listed in ADA_COMPAT.
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index d29abf71fe30..092c0887d878 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -116,40 +116,40 @@ fi
if [[ ! ${_DISTUTILS_R1} ]]; then
_distutils_set_globals() {
- local rdep=${PYTHON_DEPS}
- local bdep=${rdep}
-
- if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
- local sdep=">=dev-python/setuptools-42.0.2[${PYTHON_USEDEP}]"
- else
- local sdep="$(python_gen_cond_dep '
- >=dev-python/setuptools-42.0.2[${PYTHON_MULTI_USEDEP}]
- ')"
- fi
+ local rdep bdep
+ local setuptools_dep='>=dev-python/setuptools-42.0.2[${PYTHON_USEDEP}]'
case ${DISTUTILS_USE_SETUPTOOLS} in
no|manual)
;;
bdepend)
- bdep+=" ${sdep}"
+ bdep+=" ${setuptools_dep}"
;;
rdepend)
- bdep+=" ${sdep}"
- rdep+=" ${sdep}"
+ bdep+=" ${setuptools_dep}"
+ rdep+=" ${setuptools_dep}"
;;
pyproject.toml)
- bdep+=" dev-python/pyproject2setuppy[${PYTHON_USEDEP}]"
+ bdep+=' dev-python/pyproject2setuppy[${PYTHON_USEDEP}]'
;;
*)
die "Invalid DISTUTILS_USE_SETUPTOOLS=${DISTUTILS_USE_SETUPTOOLS}"
;;
esac
- RDEPEND=${rdep}
+ if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
+ bdep=${bdep//\$\{PYTHON_USEDEP\}/${PYTHON_USEDEP}}
+ rdep=${rdep//\$\{PYTHON_USEDEP\}/${PYTHON_USEDEP}}
+ else
+ [[ -n ${bdep} ]] && bdep="$(python_gen_cond_dep "${bdep}")"
+ [[ -n ${rdep} ]] && rdep="$(python_gen_cond_dep "${rdep}")"
+ fi
+
+ RDEPEND="${PYTHON_DEPS} ${rdep}"
if [[ ${EAPI} != [56] ]]; then
- BDEPEND=${bdep}
+ BDEPEND="${PYTHON_DEPS} ${bdep}"
else
- DEPEND=${bdep}
+ DEPEND="${PYTHON_DEPS} ${bdep}"
fi
REQUIRED_USE=${PYTHON_REQUIRED_USE}
}
diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass
index e0cf41e4342f..6c75d11218ce 100644
--- a/eclass/git-r3.eclass
+++ b/eclass/git-r3.eclass
@@ -90,6 +90,8 @@ fi
: ${EGIT_MIN_CLONE_TYPE:=shallow}
# @ECLASS-VARIABLE: EGIT3_STORE_DIR
+# @USER_VARIABLE
+# @DEFAULT_UNSET
# @DESCRIPTION:
# Storage directory for git sources.
#
@@ -176,6 +178,7 @@ fi
# to the merge commit date.
# @ECLASS-VARIABLE: EGIT_CHECKOUT_DIR
+# @DEFAULT_UNSET
# @DESCRIPTION:
# The directory to check the git sources out to.
#
diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
index 04edee339306..b515a3f63fc5 100644
--- a/eclass/kernel-2.eclass
+++ b/eclass/kernel-2.eclass
@@ -605,6 +605,7 @@ if [[ ${ETYPE} == sources ]]; then
sys-devel/make
>=sys-libs/ncurses-5.2
virtual/libelf
+ virtual/pkgconfig
)"
SLOT="${PVR}"
@@ -1238,27 +1239,37 @@ unipatch() {
if [[ ${GCC_MAJOR_VER} -lt 8 ]] && [[ ${GCC_MAJOR_VER} -gt 4 ]]; then
UNIPATCH_DROP+=" 5011_enable-cpu-optimizations-for-gcc8.patch"
UNIPATCH_DROP+=" 5012_enable-cpu-optimizations-for-gcc91.patch"
+ UNIPATCH_DROP+=" 5013_enable-cpu-optimizations-for-gcc10.patch"
# optimization patch for gcc >= 8 and kernel ge 4.13
elif [[ "${GCC_MAJOR_VER}" -eq 8 ]]; then
# support old kernels for a period. For now, remove as all gcc versions required are masked
UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc.patch"
UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"
UNIPATCH_DROP+=" 5012_enable-cpu-optimizations-for-gcc91.patch"
- elif [[ "${GCC_MAJOR_VER}" -ge 9 ]] && [[ ${GCC_MINOR_VER} -ge 1 ]]; then
+ UNIPATCH_DROP+=" 5013_enable-cpu-optimizations-for-gcc10.patch"
+ elif [[ "${GCC_MAJOR_VER}" -eq 9 ]] && [[ ${GCC_MINOR_VER} -ge 1 ]]; then
UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc.patch"
UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"
UNIPATCH_DROP+=" 5011_enable-cpu-optimizations-for-gcc8.patch"
+ UNIPATCH_DROP+=" 5013_enable-cpu-optimizations-for-gcc10.patch"
+ elif [[ "${GCC_MAJOR_VER}" -eq 10 ]] && [[ ${GCC_MINOR_VER} -ge 1 ]]; then
+ UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc.patch"
+ UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"
+ UNIPATCH_DROP+=" 5011_enable-cpu-optimizations-for-gcc8.patch"
+ UNIPATCH_DROP+=" 5012_enable-cpu-optimizations-for-gcc91.patch"
else
UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc.patch"
UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"
UNIPATCH_DROP+=" 5011_enable-cpu-optimizations-for-gcc8.patch"
UNIPATCH_DROP+=" 5012_enable-cpu-optimizations-for-gcc91.patch"
+ UNIPATCH_DROP+=" 5013_enable-cpu-optimizations-for-gcc10.patch"
fi
else
UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc.patch"
UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"
UNIPATCH_DROP+=" 5011_enable-cpu-optimizations-for-gcc8.patch"
UNIPATCH_DROP+=" 5012_enable-cpu-optimizations-for-gcc91.patch"
+ UNIPATCH_DROP+=" 5013_enable-cpu-optimizations-for-gcc10.patch"
fi
fi
done
diff --git a/eclass/mozcoreconf-v4.eclass b/eclass/mozcoreconf-v4.eclass
index eef1b5e7da70..ba9a65349fd1 100644
--- a/eclass/mozcoreconf-v4.eclass
+++ b/eclass/mozcoreconf-v4.eclass
@@ -53,8 +53,8 @@ mozconfig_use_enable() {
mozconfig_annotate "$(use $1 && echo +$1 || echo -$1)" "${flag}"
}
-# @FUNCTION mozconfig_use_with
-# @DESCRIPTION
+# @FUNCTION: mozconfig_use_with
+# @DESCRIPTION:
# add a line to .mozconfig based on a USE-flag
#
# Example:
@@ -65,8 +65,8 @@ mozconfig_use_with() {
mozconfig_annotate "$(use $1 && echo +$1 || echo -$1)" "${flag}"
}
-# @FUNCTION mozconfig_use_extension
-# @DESCRIPTION
+# @FUNCTION: mozconfig_use_extension
+# @DESCRIPTION:
# enable or disable an extension based on a USE-flag
#
# Example:
diff --git a/eclass/mozcoreconf-v5.eclass b/eclass/mozcoreconf-v5.eclass
index ab8440b94273..a78b190aff69 100644
--- a/eclass/mozcoreconf-v5.eclass
+++ b/eclass/mozcoreconf-v5.eclass
@@ -53,8 +53,8 @@ mozconfig_use_enable() {
mozconfig_annotate "$(use $1 && echo +$1 || echo -$1)" "${flag}"
}
-# @FUNCTION mozconfig_use_with
-# @DESCRIPTION
+# @FUNCTION: mozconfig_use_with
+# @DESCRIPTION:
# add a line to .mozconfig based on a USE-flag
#
# Example:
@@ -65,8 +65,8 @@ mozconfig_use_with() {
mozconfig_annotate "$(use $1 && echo +$1 || echo -$1)" "${flag}"
}
-# @FUNCTION mozconfig_use_extension
-# @DESCRIPTION
+# @FUNCTION: mozconfig_use_extension
+# @DESCRIPTION:
# enable or disable an extension based on a USE-flag
#
# Example:
diff --git a/eclass/mozcoreconf-v6.eclass b/eclass/mozcoreconf-v6.eclass
index 04320849a747..045aabc164c8 100644
--- a/eclass/mozcoreconf-v6.eclass
+++ b/eclass/mozcoreconf-v6.eclass
@@ -51,8 +51,8 @@ mozconfig_use_enable() {
mozconfig_annotate "$(use $1 && echo +$1 || echo -$1)" "${flag}"
}
-# @FUNCTION mozconfig_use_with
-# @DESCRIPTION
+# @FUNCTION: mozconfig_use_with
+# @DESCRIPTION:
# add a line to .mozconfig based on a USE-flag
#
# Example:
@@ -63,8 +63,8 @@ mozconfig_use_with() {
mozconfig_annotate "$(use $1 && echo +$1 || echo -$1)" "${flag}"
}
-# @FUNCTION mozconfig_use_extension
-# @DESCRIPTION
+# @FUNCTION: mozconfig_use_extension
+# @DESCRIPTION:
# enable or disable an extension based on a USE-flag
#
# Example:
diff --git a/eclass/multibuild.eclass b/eclass/multibuild.eclass
index 169c0fa00843..dd5d627ad960 100644
--- a/eclass/multibuild.eclass
+++ b/eclass/multibuild.eclass
@@ -27,6 +27,7 @@ esac
if [[ ! ${_MULTIBUILD} ]]; then
# @ECLASS-VARIABLE: MULTIBUILD_VARIANTS
+# @REQUIRED
# @DESCRIPTION:
# An array specifying all enabled variants which multibuild_foreach*
# can execute the process for.
@@ -43,6 +44,7 @@ if [[ ! ${_MULTIBUILD} ]]; then
# @CODE
# @ECLASS-VARIABLE: MULTIBUILD_VARIANT
+# @OUTPUT_VARIABLE
# @DESCRIPTION:
# The current variant which the function was executed for.
#
@@ -52,6 +54,7 @@ if [[ ! ${_MULTIBUILD} ]]; then
# @CODE
# @ECLASS-VARIABLE: MULTIBUILD_ID
+# @OUTPUT_VARIABLE
# @DESCRIPTION:
# The unique identifier for a multibuild run. In a simple run, it is
# equal to MULTIBUILD_VARIANT. In a nested multibuild environment, it
@@ -65,6 +68,8 @@ if [[ ! ${_MULTIBUILD} ]]; then
# @CODE
# @ECLASS-VARIABLE: BUILD_DIR
+# @OUTPUT_VARIABLE
+# @DEFAULT_UNSET
# @DESCRIPTION:
# The current build directory. In global scope, it is supposed
# to contain an 'initial' build directory. If unset, ${S} is used.
diff --git a/eclass/multilib-build.eclass b/eclass/multilib-build.eclass
index 828fc772066f..620bdcedce58 100644
--- a/eclass/multilib-build.eclass
+++ b/eclass/multilib-build.eclass
@@ -79,6 +79,7 @@ readonly _MULTILIB_FLAGS
# @CODE
# @ECLASS-VARIABLE: MULTILIB_USEDEP
+# @OUTPUT_VARIABLE
# @DESCRIPTION:
# The USE-dependency to be used on dependencies (libraries) needing
# to support multilib as well.
@@ -90,7 +91,7 @@ readonly _MULTILIB_FLAGS
# @CODE
# @ECLASS-VARIABLE: MULTILIB_ABI_FLAG
-# @DEFAULT_UNSET
+# @OUTPUT_VARIABLE
# @DESCRIPTION:
# The complete ABI name. Resembles the USE flag name.
#
@@ -320,6 +321,7 @@ multilib_copy_sources() {
}
# @ECLASS-VARIABLE: MULTILIB_WRAPPED_HEADERS
+# @DEFAULT_UNSET
# @DESCRIPTION:
# A list of headers to wrap for multilib support. The listed headers
# will be moved to a non-standard location and replaced with a file
@@ -342,6 +344,7 @@ multilib_copy_sources() {
# @CODE
# @ECLASS-VARIABLE: MULTILIB_CHOST_TOOLS
+# @DEFAULT_UNSET
# @DESCRIPTION:
# A list of tool executables to preserve for each multilib ABI.
# The listed executables will be renamed to ${CHOST}-${basename},
diff --git a/eclass/php-ext-source-r3.eclass b/eclass/php-ext-source-r3.eclass
index 12e4a24facd6..b2eae22fb74d 100644
--- a/eclass/php-ext-source-r3.eclass
+++ b/eclass/php-ext-source-r3.eclass
@@ -81,9 +81,9 @@ esac
# This allows ordering of extensions such that one is loaded before
# or after another. Defaults to the PHP_EXT_NAME.
# Example (produces 40-foo.ini file):
-# @CODE@
+# @CODE
# PHP_INI_NAME="40-foo"
-# @CODE@
+# @CODE
: ${PHP_INI_NAME:=${PHP_EXT_NAME}}
# @ECLASS-VARIABLE: PHP_EXT_NEEDED_USE
diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass
index eef4c57b7e25..c634e19813e0 100644
--- a/eclass/python-any-r1.eclass
+++ b/eclass/python-any-r1.eclass
@@ -69,7 +69,8 @@ EXPORT_FUNCTIONS pkg_setup
# @CODE
# @ECLASS-VARIABLE: PYTHON_COMPAT_OVERRIDE
-# @INTERNAL
+# @USER_VARIABLE
+# @DEFAULT_UNSET
# @DESCRIPTION:
# This variable can be used when working with ebuilds to override
# the in-ebuild PYTHON_COMPAT. It is a string naming the implementation
@@ -105,6 +106,7 @@ EXPORT_FUNCTIONS pkg_setup
# @CODE
# @ECLASS-VARIABLE: PYTHON_DEPS
+# @OUTPUT_VARIABLE
# @DESCRIPTION:
# This is an eclass-generated Python dependency string for all
# implementations listed in PYTHON_COMPAT.
@@ -124,6 +126,7 @@ EXPORT_FUNCTIONS pkg_setup
# @CODE
# @ECLASS-VARIABLE: PYTHON_USEDEP
+# @OUTPUT_VARIABLE
# @DESCRIPTION:
# An eclass-generated USE-dependency string for the currently tested
# implementation. It is set locally for python_check_deps() call.
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
index 8687b595123a..8c3ff5b08095 100644
--- a/eclass/python-r1.eclass
+++ b/eclass/python-r1.eclass
@@ -72,7 +72,8 @@ fi
# @CODE
# @ECLASS-VARIABLE: PYTHON_COMPAT_OVERRIDE
-# @INTERNAL
+# @USER_VARIABLE
+# @DEFAULT_UNSET
# @DESCRIPTION:
# This variable can be used when working with ebuilds to override
# the in-ebuild PYTHON_COMPAT. It is a string listing all
@@ -111,6 +112,7 @@ fi
# @CODE
# @ECLASS-VARIABLE: PYTHON_DEPS
+# @OUTPUT_VARIABLE
# @DESCRIPTION:
# This is an eclass-generated Python dependency string for all
# implementations listed in PYTHON_COMPAT.
@@ -130,6 +132,7 @@ fi
# @CODE
# @ECLASS-VARIABLE: PYTHON_USEDEP
+# @OUTPUT_VARIABLE
# @DESCRIPTION:
# This is an eclass-generated USE-dependency string which can be used to
# depend on another Python package being built for the same Python
@@ -150,6 +153,7 @@ fi
# @CODE
# @ECLASS-VARIABLE: PYTHON_REQUIRED_USE
+# @OUTPUT_VARIABLE
# @DESCRIPTION:
# This is an eclass-generated required-use expression which ensures at
# least one Python implementation has been enabled.
@@ -273,8 +277,8 @@ _python_validate_useflags() {
}
# @FUNCTION: _python_gen_usedep
-# @INTERNAL
# @USAGE: [<pattern>...]
+# @INTERNAL
# @DESCRIPTION:
# Output a USE dependency string for Python implementations which
# are both in PYTHON_COMPAT and match any of the patterns passed
@@ -574,6 +578,8 @@ python_gen_any_dep() {
}
# @ECLASS-VARIABLE: BUILD_DIR
+# @OUTPUT_VARIABLE
+# @DEFAULT_UNSET
# @DESCRIPTION:
# The current build directory. In global scope, it is supposed to
# contain an initial build directory; if unset, it defaults to ${S}.
diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass
index d516e3629696..6fedc7cdf4e0 100644
--- a/eclass/python-single-r1.eclass
+++ b/eclass/python-single-r1.eclass
@@ -80,7 +80,8 @@ EXPORT_FUNCTIONS pkg_setup
# @CODE
# @ECLASS-VARIABLE: PYTHON_COMPAT_OVERRIDE
-# @INTERNAL
+# @USER_VARIABLE
+# @DEFAULT_UNSET
# @DESCRIPTION:
# This variable can be used when working with ebuilds to override
# the in-ebuild PYTHON_COMPAT. It is a string naming the implementation
@@ -119,6 +120,7 @@ EXPORT_FUNCTIONS pkg_setup
# @CODE
# @ECLASS-VARIABLE: PYTHON_DEPS
+# @OUTPUT_VARIABLE
# @DESCRIPTION:
# This is an eclass-generated Python dependency string for all
# implementations listed in PYTHON_COMPAT.
@@ -140,6 +142,7 @@ EXPORT_FUNCTIONS pkg_setup
# @CODE
# @ECLASS-VARIABLE: PYTHON_SINGLE_USEDEP
+# @OUTPUT_VARIABLE
# @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
@@ -159,6 +162,7 @@ EXPORT_FUNCTIONS pkg_setup
# @CODE
# @ECLASS-VARIABLE: PYTHON_USEDEP
+# @OUTPUT_VARIABLE
# @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
@@ -177,11 +181,13 @@ EXPORT_FUNCTIONS pkg_setup
# @CODE
# @ECLASS-VARIABLE: PYTHON_MULTI_USEDEP
+# @OUTPUT_VARIABLE
# @DESCRIPTION:
# This is a backwards-compatibility placeholder. Use PYTHON_USEDEP
# instead.
# @ECLASS-VARIABLE: PYTHON_REQUIRED_USE
+# @OUTPUT_VARIABLE
# @DESCRIPTION:
# This is an eclass-generated required-use expression which ensures
# that exactly one PYTHON_SINGLE_TARGET value has been enabled.
@@ -266,8 +272,8 @@ unset -f _python_single_set_globals
if [[ ! ${_PYTHON_SINGLE_R1} ]]; then
# @FUNCTION: _python_gen_usedep
-# @INTERNAL
# @USAGE: [<pattern>...]
+# @INTERNAL
# @DESCRIPTION:
# Output a USE dependency string for Python implementations which
# are both in PYTHON_COMPAT and match any of the patterns passed
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 1067d2367aba..9bad72a77e98 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1164,8 +1164,8 @@ python_fix_shebang() {
# @FUNCTION: _python_check_locale_sanity
# @USAGE: <locale>
-# @INTERNAL
# @RETURN: 0 if sane, 1 otherwise
+# @INTERNAL
# @DESCRIPTION:
# Check whether the specified locale sanely maps between lowercase
# and uppercase ASCII characters.
diff --git a/eclass/scons-utils.eclass b/eclass/scons-utils.eclass
index 33838e3ec8bb..c616e4a3f455 100644
--- a/eclass/scons-utils.eclass
+++ b/eclass/scons-utils.eclass
@@ -217,8 +217,8 @@ escons() {
}
# @FUNCTION: _scons_clean_makeopts
-# @INTERNAL
# @USAGE: [makeflags] [...]
+# @INTERNAL
# @DESCRIPTION:
# Strip the supplied makeflags (or ${MAKEOPTS} if called without
# an argument) of options not supported by SCons and make sure --jobs
diff --git a/eclass/tests/distutils-r1.sh b/eclass/tests/distutils-r1.sh
index 4c8e37b26170..93496f9ac007 100755
--- a/eclass/tests/distutils-r1.sh
+++ b/eclass/tests/distutils-r1.sh
@@ -1,9 +1,9 @@
#!/bin/bash
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=5
-PYTHON_COMPAT=( python2_7 )
+EAPI=7
+PYTHON_COMPAT=( python3_8 )
source tests-common.sh
test-phase_name_free() {
@@ -21,23 +21,57 @@ test-distutils_enable_tests() {
local runner=${1}
local exp_IUSE=${2}
local exp_RESTRICT=${3}
- local exp_DEPEND=${4}
+ local exp_BDEPEND=${4}
local IUSE=${IUSE}
local RESTRICT=${RESTRICT}
- local DEPEND=${DEPEND}
+ local BDEPEND=${BDEPEND}
tbegin "${runner}"
distutils_enable_tests "${runner}"
- local ret var
- for var in IUSE RESTRICT DEPEND; do
+ local ret var val
+ for var in IUSE RESTRICT BDEPEND; do
local exp_var=exp_${var}
- if [[ ${!var} != "${!exp_var}" ]]; then
+ # (this normalizes whitespace)
+ read -d $'\0' -r -a val <<<"${!var}"
+ val=${val[*]}
+ if [[ ${val} != "${!exp_var}" ]]; then
eindent
eerror "${var} expected: ${!exp_var}"
- eerror "${var} actual: ${!var}"
+ eerror "${var} actual: ${val}"
+ eoutdent
+ ret=1
+ tret=1
+ fi
+ done
+
+ tend ${ret}
+}
+
+test-DISTUTILS_USE_SETUPTOOLS() {
+ local DISTUTILS_USE_SETUPTOOLS=${1}
+ local exp_BDEPEND=${2}
+ local exp_RDEPEND=${3}
+
+ tbegin "${1}"
+
+ local BDEPEND=
+ local RDEPEND=
+ unset _DISTUTILS_R1
+ inherit distutils-r1
+
+ local ret var val
+ for var in BDEPEND RDEPEND; do
+ local exp_var=exp_${var}
+ # (this normalizes whitespace)
+ read -d $'\0' -r -a val <<<"${!var}"
+ val=${val[*]}
+ if [[ ${val} != "${!exp_var}" ]]; then
+ eindent
+ eerror "${var} expected: ${!exp_var}"
+ eerror "${var} actual: ${val}"
eoutdent
ret=1
tret=1
@@ -62,17 +96,17 @@ 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 )"
+BASE_IUSE="python_targets_python3_8"
+BASE_DEPS="python_targets_python3_8? ( dev-lang/python:3.8 ) >=dev-lang/python-exec-2:=[python_targets_python3_8(-)?,-python_single_target_python3_8(-)]"
+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-4.5.0[${PYTHON_USEDEP}] )"
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( >=dev-python/pytest-4.5.0[${PYTHON_USEDEP}] )"
test-distutils_enable_tests nose \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( >=dev-python/nose-1.3.7-r4[${PYTHON_USEDEP}] )"
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( >=dev-python/nose-1.3.7-r4[${PYTHON_USEDEP}] )"
test-distutils_enable_tests unittest \
"${BASE_IUSE}" "" "${BASE_DEPS}"
test-distutils_enable_tests setup.py \
@@ -95,4 +129,14 @@ eoutdent
eoutdent
+einfo DISTUTILS_USE_SETUPTOOLS
+eindent
+SETUPTOOLS_DEP=">=dev-python/setuptools-42.0.2[python_targets_python3_8(-)?,-python_single_target_python3_8(-)]"
+test-DISTUTILS_USE_SETUPTOOLS no "${BASE_DEPS}" "${BASE_DEPS}"
+test-DISTUTILS_USE_SETUPTOOLS bdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS}"
+test-DISTUTILS_USE_SETUPTOOLS rdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS} ${SETUPTOOLS_DEP}"
+test-DISTUTILS_USE_SETUPTOOLS pyproject.toml "${BASE_DEPS} dev-python/pyproject2setuppy[python_targets_python3_8(-)?,-python_single_target_python3_8(-)]" "${BASE_DEPS}"
+test-DISTUTILS_USE_SETUPTOOLS manual "${BASE_DEPS}" "${BASE_DEPS}"
+eoutdent
+
texit
diff --git a/eclass/tests/distutils-r1_single.sh b/eclass/tests/distutils-r1_single.sh
new file mode 100755
index 000000000000..80c152b6ee0c
--- /dev/null
+++ b/eclass/tests/distutils-r1_single.sh
@@ -0,0 +1,122 @@
+#!/bin/bash
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python3_8 )
+source tests-common.sh
+
+test-distutils_enable_tests() {
+ local runner=${1}
+ local exp_IUSE=${2}
+ local exp_RESTRICT=${3}
+ local exp_BDEPEND=${4}
+
+ local IUSE=${IUSE}
+ local RESTRICT=${RESTRICT}
+ local BDEPEND=${BDEPEND}
+
+ tbegin "${runner}"
+
+ distutils_enable_tests "${runner}"
+
+ local ret var
+ for var in IUSE RESTRICT BDEPEND; do
+ local exp_var=exp_${var}
+ # (this normalizes whitespace)
+ read -d $'\0' -r -a val <<<"${!var}"
+ val=${val[*]}
+ if [[ ${val} != "${!exp_var}" ]]; then
+ eindent
+ eerror "${var} expected: ${!exp_var}"
+ eerror "${var} actual: ${val}"
+ eoutdent
+ ret=1
+ tret=1
+ fi
+ done
+
+ tend ${ret}
+}
+
+test-DISTUTILS_USE_SETUPTOOLS() {
+ local DISTUTILS_USE_SETUPTOOLS=${1}
+ local exp_BDEPEND=${2}
+ local exp_RDEPEND=${3}
+
+ tbegin "${1}"
+
+ local BDEPEND=
+ local RDEPEND=
+ unset _DISTUTILS_R1
+ inherit distutils-r1
+
+ local ret var val
+ for var in BDEPEND RDEPEND; do
+ local exp_var=exp_${var}
+ # (this normalizes whitespace)
+ read -d $'\0' -r -a val <<<"${!var}"
+ val=${val[*]}
+ if [[ ${val} != "${!exp_var}" ]]; then
+ eindent
+ eerror "${var} expected: ${!exp_var}"
+ eerror "${var} actual: ${val}"
+ eoutdent
+ ret=1
+ tret=1
+ fi
+ done
+
+ tend ${ret}
+}
+
+DISTUTILS_USE_SETUPTOOLS=no
+DISTUTILS_SINGLE_IMPL=1
+inherit distutils-r1
+
+einfo distutils_enable_tests
+eindent
+BASE_IUSE="+python_single_target_python3_8"
+BASE_DEPS="python_single_target_python3_8? ( dev-lang/python:3.8 >=dev-lang/python-exec-2:=[python_targets_python3_8] )"
+TEST_RESTRICT="!test? ( test )"
+
+einfo "empty RDEPEND"
+eindent
+RDEPEND=""
+test-distutils_enable_tests pytest \
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( python_single_target_python3_8? ( >=dev-python/pytest-4.5.0[python_targets_python3_8(-)] ) )"
+test-distutils_enable_tests nose \
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( python_single_target_python3_8? ( >=dev-python/nose-1.3.7-r4[python_targets_python3_8(-)] ) )"
+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_SINGLE_USEDEP}]"
+RDEPEND=${BASE_RDEPEND}
+test-distutils_enable_tests pytest \
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} python_single_target_python3_8? ( >=dev-python/pytest-4.5.0[python_targets_python3_8(-)] ) )"
+test-distutils_enable_tests nose \
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} python_single_target_python3_8? ( >=dev-python/nose-1.3.7-r4[python_targets_python3_8(-)] ) )"
+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
+
+einfo DISTUTILS_USE_SETUPTOOLS
+eindent
+SETUPTOOLS_DEP="python_single_target_python3_8? ( >=dev-python/setuptools-42.0.2[python_targets_python3_8(-)] )"
+test-DISTUTILS_USE_SETUPTOOLS no "${BASE_DEPS}" "${BASE_DEPS}"
+test-DISTUTILS_USE_SETUPTOOLS bdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS}"
+test-DISTUTILS_USE_SETUPTOOLS rdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS} ${SETUPTOOLS_DEP}"
+test-DISTUTILS_USE_SETUPTOOLS pyproject.toml "${BASE_DEPS} python_single_target_python3_8? ( dev-python/pyproject2setuppy[python_targets_python3_8(-)] )" "${BASE_DEPS}"
+test-DISTUTILS_USE_SETUPTOOLS manual "${BASE_DEPS}" "${BASE_DEPS}"
+eoutdent
+
+texit