diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-10-09 04:26:33 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-10-09 04:26:33 +0100 |
commit | 6ee17dd82a3bcd0e90af4ebfbb3e411d342761be (patch) | |
tree | 5ade54018efa76614b79d832bbe15a22021b6d8c /eclass/distutils-r1.eclass | |
parent | 325837835fc86686829aaa6acace3d3c06c74cea (diff) |
gentoo auto-resync : 09:10:2024 - 04:26:32
Diffstat (limited to 'eclass/distutils-r1.eclass')
-rw-r--r-- | eclass/distutils-r1.eclass | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index 5a6ebdcede8a..c3a7d112b03f 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -44,11 +44,6 @@ # For more information, please see the Python Guide: # https://projects.gentoo.org/python/guide/ -case ${EAPI} in - 7|8) ;; - *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; -esac - # @ECLASS_VARIABLE: DISTUTILS_EXT # @PRE_INHERIT # @DEFAULT_UNSET @@ -225,6 +220,11 @@ esac if [[ -z ${_DISTUTILS_R1_ECLASS} ]]; then _DISTUTILS_R1_ECLASS=1 +case ${EAPI} in + 7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + inherit flag-o-matic inherit multibuild multilib multiprocessing ninja-utils toolchain-funcs @@ -493,7 +493,7 @@ unset -f _distutils_set_globals # python_compile_all(), you can call the original implementation # as sphinx_compile_all. distutils_enable_sphinx() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" [[ ${#} -ge 1 ]] || die "${FUNCNAME} takes at least one arg: <subdir>" _DISTUTILS_SPHINX_SUBDIR=${1} @@ -589,7 +589,7 @@ distutils_enable_sphinx() { # This function must be called in global scope, after RDEPEND has been # declared. Take care not to overwrite the variables set by it. distutils_enable_tests() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" case ${1} in --install) @@ -670,7 +670,7 @@ distutils_enable_tests() { # # This command dies on failure. esetup.py() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" _python_check_EPYTHON @@ -729,7 +729,7 @@ distutils_install_for_testing() { # This function must only be used in python_test(). The created file # will automatically be removed upon leaving the test phase. distutils_write_namespace() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" if [[ ! ${DISTUTILS_USE_PEP517:-no} != no ]]; then die "${FUNCNAME} is available only in PEP517 mode" @@ -935,7 +935,7 @@ _distutils-r1_print_package_versions() { # At some point in the future, it may also apply eclass-specific # distutils patches and/or quirks. distutils-r1_python_prepare_all() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" _python_sanity_checks _distutils-r1_check_all_phase_mismatch @@ -1022,7 +1022,7 @@ _distutils-r1_create_setup_cfg() { [install] compile = True optimize = 2 - root = ${D%/} + root = ${D} _EOF_ if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then @@ -1057,7 +1057,7 @@ _distutils-r1_copy_egg_info() { # Print the DISTUTILS_USE_PEP517 value corresponding to the backend # passed as the only argument. _distutils-r1_backend_to_key() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" local backend=${1} case ${backend} in @@ -1109,7 +1109,7 @@ _distutils-r1_backend_to_key() { # Read (or guess, in case of setuptools) the build-backend # for the package in the current directory. _distutils-r1_get_backend() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" local build_backend legacy_fallback if [[ -f pyproject.toml ]]; then @@ -1179,7 +1179,7 @@ _distutils-r1_get_backend() { # # This function is intended for expert use only. distutils_wheel_install() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" if [[ ${#} -ne 2 ]]; then die "${FUNCNAME} takes exactly two arguments: <root> <wheel>" fi @@ -1236,7 +1236,7 @@ distutils_wheel_install() { # wrapping executables. The wheel path is returned # in DISTUTILS_WHEEL_PATH variable. distutils_pep517_install() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" [[ ${#} -eq 1 ]] || die "${FUNCNAME} takes exactly one argument: root" if [[ ! ${DISTUTILS_USE_PEP517:-no} != no ]]; then @@ -1448,7 +1448,7 @@ declare -g -A DISTUTILS_WHEELS=() # function will be appended to setup.py invocation, i.e. passed # as options to the 'build' command. distutils-r1_python_compile() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" _python_check_EPYTHON @@ -1514,7 +1514,7 @@ distutils-r1_python_compile() { # @DESCRIPTION: # Moves and wraps all installed scripts/executables as necessary. _distutils-r1_wrap_scripts() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" [[ ${#} -eq 1 ]] || die "usage: ${FUNCNAME} <bindir>" local bindir=${1} @@ -1522,10 +1522,10 @@ _distutils-r1_wrap_scripts() { local scriptdir=$(python_get_scriptdir) local f python_files=() non_python_files=() - if [[ -d ${D%/}${scriptdir} ]]; then - for f in "${D%/}${scriptdir}"/*; do + if [[ -d ${D}${scriptdir} ]]; then + for f in "${D}${scriptdir}"/*; do [[ -d ${f} ]] && die "Unexpected directory: ${f}" - debug-print "${FUNCNAME}: found executable at ${f#${D%/}/}" + debug-print "${FUNCNAME}: found executable at ${f#${D}/}" local shebang read -r shebang < "${f}" @@ -1537,7 +1537,7 @@ _distutils-r1_wrap_scripts() { non_python_files+=( "${f}" ) fi - mkdir -p "${D%/}${bindir}" || die + mkdir -p "${D}${bindir}" || die done for f in "${python_files[@]}"; do @@ -1553,8 +1553,8 @@ _distutils-r1_wrap_scripts() { for f in "${non_python_files[@]}"; do local basename=${f##*/} - debug-print "${FUNCNAME}: moving ${f#${D%/}/} to ${bindir}/${basename}" - mv "${f}" "${D%/}${bindir}/${basename}" || die + debug-print "${FUNCNAME}: moving ${f#${D}/} to ${bindir}/${basename}" + mv "${f}" "${D}${bindir}/${basename}" || die done fi } @@ -1568,7 +1568,7 @@ _distutils-r1_wrap_scripts() { # # This function is used only if distutils_enable_tests is called. distutils-r1_python_test() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" if [[ -z ${_DISTUTILS_TEST_RUNNER} ]]; then die "${FUNCNAME} can be only used after calling distutils_enable_tests" @@ -1611,7 +1611,7 @@ distutils-r1_python_test() { # Any parameters passed to this function will be appended # to the setup.py invocation (i.e. as options to the 'install' command). distutils-r1_python_install() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" _python_check_EPYTHON @@ -1662,8 +1662,8 @@ distutils-r1_python_install() { find "${BUILD_DIR}"/install -type d -empty -delete || die [[ -d ${BUILD_DIR}/install ]] && merge_root=1 else - local root=${D%/}/_${EPYTHON} - [[ ${DISTUTILS_SINGLE_IMPL} ]] && root=${D%/} + local root=${D}/_${EPYTHON} + [[ ${DISTUTILS_SINGLE_IMPL} ]] && root=${D} # inline DISTUTILS_ARGS logic from esetup.py in order to make # argv overwriting easier @@ -1717,7 +1717,7 @@ distutils-r1_python_install() { fi if [[ ${merge_root} ]]; then - multibuild_merge_root "${root}" "${D%/}" + multibuild_merge_root "${root}" "${D}" fi if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then _distutils-r1_wrap_scripts "${scriptdir}" @@ -1728,7 +1728,7 @@ distutils-r1_python_install() { # @DESCRIPTION: # The default python_install_all(). It installs the documentation. distutils-r1_python_install_all() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" _distutils-r1_check_all_phase_mismatch einstalldocs @@ -1748,7 +1748,7 @@ distutils-r1_python_install_all() { # holding the per-implementation copy of sources. BUILD_DIR points # to the 'build' subdirectory. distutils-r1_run_phase() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" if [[ ${DISTUTILS_IN_SOURCE_BUILD} ]]; then [[ ${DISTUTILS_USE_PEP517} ]] && @@ -1869,7 +1869,7 @@ _distutils-r1_run_common_phase() { # Run the given phase for each implementation if multiple implementations # are enabled, once otherwise. _distutils-r1_run_foreach_impl() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" # store for restoring after distutils-r1_run_phase. local _DISTUTILS_INITIAL_CWD=${PWD} @@ -1890,7 +1890,7 @@ _distutils-r1_run_foreach_impl() { } distutils-r1_src_prepare() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" local ret=0 local _DISTUTILS_DEFAULT_CALLED @@ -1913,7 +1913,7 @@ distutils-r1_src_prepare() { } distutils-r1_src_configure() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" local ret=0 if declare -f python_configure >/dev/null; then @@ -1933,7 +1933,7 @@ distutils-r1_src_configure() { # Verify the the match between files installed between this and previous # implementation. _distutils-r1_compare_installed_files() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" # QA check requires diff(1). if ! type -P diff &>/dev/null; then @@ -1971,7 +1971,7 @@ _distutils-r1_compare_installed_files() { # Post-phase function called after python_compile. In PEP517 mode, # it adjusts the install tree for venv-style usage. _distutils-r1_post_python_compile() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" local root=${BUILD_DIR}/install if [[ ${DISTUTILS_USE_PEP517} && -d ${root} ]]; then @@ -2005,7 +2005,7 @@ _distutils-r1_post_python_compile() { } distutils-r1_src_compile() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" local ret=0 if declare -f python_compile >/dev/null; then @@ -2040,7 +2040,7 @@ _distutils-r1_clean_egg_info() { # @DESCRIPTION: # Post-phase function called after python_test. _distutils-r1_post_python_test() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" if [[ ! ${DISTUTILS_USE_PEP517} ]]; then _distutils-r1_clean_egg_info @@ -2048,7 +2048,7 @@ _distutils-r1_post_python_test() { } distutils-r1_src_test() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" local ret=0 if declare -f python_test >/dev/null; then @@ -2069,7 +2069,7 @@ distutils-r1_src_test() { # Find and remove setuptools-style namespaces in the specified # directory. _distutils-r1_strip_namespace_packages() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" local sitedir=${1} local f ns had_any= @@ -2098,9 +2098,9 @@ _distutils-r1_strip_namespace_packages() { # Post-phase function called after python_install. Performs QA checks. # In PEP517 mode, additionally optimizes installed Python modules. _distutils-r1_post_python_install() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" - local sitedir=${D%/}$(python_get_sitedir) + local sitedir=${D}$(python_get_sitedir) if [[ -d ${sitedir} ]]; then _distutils-r1_strip_namespace_packages "${sitedir}" @@ -2161,13 +2161,13 @@ _distutils-r1_check_namespace_pth() { while IFS= read -r -d '' f; do pth+=( "${f}" ) - done < <(find "${ED%/}" -name '*-nspkg.pth' -print0) + done < <(find "${ED}" -name '*-nspkg.pth' -print0) if [[ ${pth[@]} ]]; then eerror "The following *-nspkg.pth files were found installed:" eerror for f in "${pth[@]}"; do - eerror " ${f#${ED%/}}" + eerror " ${f#${ED}}" done eerror eerror "The presence of those files may break namespaces in Python 3.5+. Please" @@ -2181,7 +2181,7 @@ _distutils-r1_check_namespace_pth() { } distutils-r1_src_install() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" local ret=0 if declare -f python_install >/dev/null; then |